org.springframework.osgi.test
Class AbstractDependencyManagerTests
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.springframework.test.ConditionalTestCase
org.springframework.test.AbstractSpringContextTests
org.springframework.test.AbstractSingleSpringContextTests
org.springframework.test.AbstractDependencyInjectionSpringContextTests
org.springframework.osgi.test.AbstractOptionalDependencyInjectionTests
org.springframework.osgi.test.AbstractOsgiTests
org.springframework.osgi.test.AbstractConfigurableOsgiTests
org.springframework.osgi.test.AbstractSynchronizedOsgiTests
org.springframework.osgi.test.AbstractDependencyManagerTests
- All Implemented Interfaces:
- Test, org.springframework.osgi.test.internal.OsgiJUnitTest
- Direct Known Subclasses:
- AbstractOnTheFlyBundleCreatorTests
public abstract class AbstractDependencyManagerTests
- extends AbstractSynchronizedOsgiTests
Dependency manager layer - uses internally an ArtifactLocator
to
retrieve the required dependencies for the running test.
- Author:
- Costin Leau
Fields inherited from interface org.springframework.osgi.test.internal.OsgiJUnitTest |
FOR_OSGI, FROM_OSGI, OSGI_TEST, OSGI_TEST_BUNDLE_ID |
Methods inherited from class org.springframework.test.AbstractSingleSpringContextTests |
contextKey, createBeanDefinitionReader, customizeBeanFactory, getApplicationContext, getConfigLocations, getConfigPath, getConfigPaths, getLoadCount, loadContext, loadContextLocations, onSetUp, onTearDown, setDirty, setUp, tearDown |
Methods inherited from class junit.framework.Assert |
assertEquals, 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, fail, fail, failNotEquals, failNotSame, failSame |
AbstractDependencyManagerTests
public AbstractDependencyManagerTests()
AbstractDependencyManagerTests
public AbstractDependencyManagerTests(String name)
getSpringDMVersion
protected String getSpringDMVersion()
- Return the Spring-DM version used by the core bundles.
- Returns:
getSpringOsgiVersion
protected String getSpringOsgiVersion()
- Deprecated. use
getSpringDMVersion()
instead.
- Returns:
getSpringVersion
protected String getSpringVersion()
- Return the Spring osgified version used by the test core bundles.
- Returns:
getSpringBundledVersion
protected String getSpringBundledVersion()
- Deprecated. - use
getSpringVersion()
instead
- Returns:
getTestBundlesNames
protected String[] getTestBundlesNames()
- Bundles that have to be installed as part of the test setup. This method
provides an alternative to
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 format
is expected.
This method allows a declarative approach in declaring bundles as
opposed to getTestBundles()
which provides a programmatic one.
- Returns:
- an array of bundle identifiers
- See Also:
locateBundle(String)
getTestFrameworkBundlesNames
protected String[] getTestFrameworkBundlesNames()
- Declarative method indicating the bundles required by the test framework,
by their names rather then as
Resource
s.
This implementation reads a predefined properties file to determine
the bundles needed.
This method allows a declarative approach in declaring bundles as
opposed to getTestBundles()
which provides a programmatic one.
- Returns:
- an array of bundle identifiers
- See Also:
getTestingFrameworkBundlesConfiguration()
,
locateBundle(String)
getTestingFrameworkBundlesConfiguration
protected Resource getTestingFrameworkBundlesConfiguration()
- Return the location of the test framework bundles configuration.
- Returns:
- location of the test framework bundles configuration
getTestBundles
protected Resource[] getTestBundles()
- Default implementation that uses the
ArtifactLocator
to resolve
the bundles specified in getTestBundlesNames()
.
Subclasses that override this method should decide whether they want to
support getTestBundlesNames()
or not.
- Specified by:
getTestBundles
in class AbstractOsgiTests
- Returns:
- the array of bundles to install
- See Also:
AbstractOsgiTests.getTestBundles()
getTestFrameworkBundles
protected Resource[] getTestFrameworkBundles()
- Default implementation that uses
getTestFrameworkBundlesNames()
to discover the bundles part of the testing framework.
- Specified by:
getTestFrameworkBundles
in class AbstractOsgiTests
- Returns:
- the array of test framework bundle resources
- See Also:
AbstractOsgiTests.getTestFrameworkBundles()
locateBundles
protected Resource[] locateBundles(String[] bundles)
- Utility method that loads the bundles given as strings. Will delegate to
locateBundle(String)
.
- Parameters:
bundles
-
- Returns:
preProcessBundleContext
protected void preProcessBundleContext(BundleContext platformBundleContext)
throws Exception
- Description copied from class:
AbstractOsgiTests
- Callback for processing the platform bundle context before any bundles
have been installed. The method is invoked after starting the
OSGi environment but before any bundles are installed in the OSGi
framework.
Normally, this method is called only one during the lifecycle of a test
suite.
- Overrides:
preProcessBundleContext
in class AbstractOsgiTests
- Throws:
Exception
- See Also:
AbstractOsgiTests.postProcessBundleContext(BundleContext)
locateBundle
protected Resource locateBundle(String bundleId)
- Locate (through the
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.
- Parameters:
bundleId
- the bundle identifier in CSV format
- Returns:
- a resource pointing to the artifact location
injectLocator
public void injectLocator(ArtifactLocator locator)
- Parameters:
locator
- The locator to set.
getLocator
public ArtifactLocator getLocator()
- Returns:
- Returns the locator.
Copyright © 2006-2007 Spring Framework. All Rights Reserved.