public abstract class AbstractDependencyManagerTests extends AbstractSynchronizedOsgiTests
ArtifactLocator to
retrieve the required dependencies for the running test. By default, the
artifact locator uses the local maven 2 repository. Maven configurations
(such as <settings.xml>) are supported. Alternatively for Maven
repositories located in non-default locations, one can use the
localRepository system property to specify the folder URL.DEFAULT_WAIT_TIMEOSGI_FRAMEWORK_SELECTORresourceLoaderbundleContextAUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_NOapplicationContextlogger| Constructor and Description |
|---|
AbstractDependencyManagerTests()
Default constructor.
|
AbstractDependencyManagerTests(String name)
Constructs a new
AbstractDependencyManagerTests instance. |
| Modifier and Type | Method and Description |
|---|---|
protected ArtifactLocator |
getLocator()
Returns the ArtifactLocator used by this test suite.
|
protected String |
getSpringDMVersion()
Returns the version of the Spring-DM bundles installed by the testing
framework.
|
protected String |
getSpringVersion()
Returns the version of the Spring bundles installed by the testing
framework.
|
protected org.springframework.core.io.Resource[] |
getTestBundles()
Returns the bundles required for the test execution.
|
protected String[] |
getTestBundlesNames()
Returns the bundles that have to be installed as part of the test setup.
|
protected org.springframework.core.io.Resource[] |
getTestFrameworkBundles()
Returns the test framework bundles (part of the test setup).
|
protected String[] |
getTestFrameworkBundlesNames()
Returns the bundles that have to be installed as part of the test setup.
|
protected org.springframework.core.io.Resource |
getTestingFrameworkBundlesConfiguration()
Returns the location of the test framework bundles configuration.
|
protected org.springframework.core.io.Resource |
locateBundle(String bundleId)
Locates (through the
ArtifactLocator) an OSGi bundle given as a
String. |
protected org.springframework.core.io.Resource[] |
locateBundles(String[] bundles)
Locates the given bundle identifiers.
|
protected void |
preProcessBundleContext(org.osgi.framework.BundleContext platformBundleContext)
Pre-processes the bundle context.
|
getDefaultWaitTime, isSpringDMManaged, postProcessBundleContext, shouldWaitForSpringBundlesContextCreation, waitOnContextCreation, waitOnContextCreation, waitOnContextCreationcreatePlatform, getBootDelegationPackages, getPlatformNamerun, runBarecreateApplicationContext, isContextKeyEmptygetAutowireMode, injectDependencies, isDependencyCheck, isPopulateProtectedVariables, prepareTestInstance, setAutowireMode, setDependencyCheck, setPopulateProtectedVariablescontextKey, createBeanDefinitionReader, customizeBeanFactory, getApplicationContext, getConfigLocations, getConfigPath, getConfigPaths, getLoadCount, loadContext, loadContextLocations, onSetUp, onTearDown, prepareApplicationContext, setDirty, setUp, tearDownaddContext, contextKeyString, getContext, hasCachedContext, setDirtygetDisabledTestCount, isDisabledInThisEnvironment, recordDisabledassertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, runTest, setName, toStringpublic AbstractDependencyManagerTests()
AbstractDependencyManagerTests instance.public AbstractDependencyManagerTests(String name)
AbstractDependencyManagerTests instance.name - test nameprotected String getSpringDMVersion()
protected String getSpringVersion()
protected String[] getTestBundlesNames()
getTestBundles() as it
allows subclasses to specify just the bundle name w/o worrying about
locating the artifact (which is resolved through the
ArtifactLocator).
A bundle name can have any value and depends on the format expected
by the ArtifactLocator implementation. By default, a CSV (Comma
Separated Values) format is expected.
This method allows a declarative approach in declaring bundles as
opposed to getTestBundles() which provides a programmatic one.locateBundle(String)protected String[] getTestFrameworkBundlesNames()
Resources. It allows for a declarative approach for
specifying bundles as opposed to getTestBundles() which provides
a programmatic one.
This implementation reads a predefined properties file to determine
the bundles needed. If the configuration needs to be changed, consider
changing the configuration location.getTestingFrameworkBundlesConfiguration(),
locateBundle(String)protected org.springframework.core.io.Resource getTestingFrameworkBundlesConfiguration()
protected org.springframework.core.io.Resource[] getTestBundles()
ArtifactLocator to
resolve the bundles specified in getTestBundlesNames().
Subclasses that override this method should decide whether they want to
support getTestBundlesNames() or not.getTestBundles in class AbstractOsgiTestsAbstractOsgiTests.getTestBundles()protected org.springframework.core.io.Resource[] getTestFrameworkBundles()
AbstractOsgiTests.getTestBundles() instead.
Default implementation that uses
getTestFrameworkBundlesNames() to discover the bundles part of
the testing framework.getTestFrameworkBundles in class AbstractOsgiTestsAbstractOsgiTests.getTestFrameworkBundles()protected org.springframework.core.io.Resource[] locateBundles(String[] bundles)
locateBundle(String).bundles - bundle identifiersprotected void preProcessBundleContext(org.osgi.framework.BundleContext platformBundleContext)
throws Exception
preProcessBundleContext in class AbstractOsgiTestsplatformBundleContext - the platform bundle contextException - if processing the bundle context failsAbstractOsgiTests.postProcessBundleContext(BundleContext)protected org.springframework.core.io.Resource locateBundle(String bundleId)
ArtifactLocator) an OSGi bundle given as a
String.
The default implementation expects the argument to be in Comma Separated
Values (CSV) format which indicates an artifact group, id, version and
optionally the type.bundleId - the bundle identifier in CSV formatprotected ArtifactLocator getLocator()
Note: This method will be used each time a bundle has to be retrieved; it is highly recommended to return a cached instance instead of a new one each time.
Copyright © 2006–2023. All rights reserved.