org.springframework.osgi.test
Class AbstractOsgiTests
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
- All Implemented Interfaces:
- Test
- Direct Known Subclasses:
- AbstractConfigurableOsgiTests
public abstract class AbstractOsgiTests
- extends AbstractOptionalDependencyInjectionTests
Base test for OSGi environments. Takes care of configuring the chosen OSGi
platform, starting it, installing a number of bundles and delegating the test
execution to a test copy that runs inside OSGi.
- Author:
- Costin Leau
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 |
resourceLoader
protected ResourceLoader resourceLoader
AbstractOsgiTests
public AbstractOsgiTests()
- Default constructor. Constructs a new
AbstractOsgiTests
instance.
AbstractOsgiTests
public AbstractOsgiTests(String name)
- Constructs a new
AbstractOsgiTests
instance.
- Parameters:
name
- test name
getTestFrameworkBundles
protected abstract Resource[] getTestFrameworkBundles()
- Returns the test framework bundles (part of the test setup). Used by the
test infrastructure. Override this method only if you want to
change the jars used by default, by the testing infrastructure.
User subclasses should use
getTestBundles()
instead.
- Returns:
- the array of test framework bundle resources
getTestBundles
protected abstract Resource[] getTestBundles()
- Returns the bundles required for the test execution.
- Returns:
- the array of bundles to install
createPlatform
protected abstract OsgiPlatform createPlatform()
throws Exception
- Creates (and configures) the OSGi platform.
- Returns:
- OSGi platform instance
- Throws:
Exception
- if the platform creation fails
preProcessBundleContext
protected void preProcessBundleContext(BundleContext platformBundleContext)
throws Exception
- Pre-processes the bundle context. This call back gives access to 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 once during the lifecycle of a
test suite.
- Parameters:
platformBundleContext
- the platform bundle context
- Throws:
Exception
- if processing the bundle context fails- See Also:
postProcessBundleContext(BundleContext)
postProcessBundleContext
protected void postProcessBundleContext(BundleContext platformBundleContext)
throws Exception
- Post-processes the bundle context. This call back gives access to the
platform bundle context after the critical test infrastructure bundles
have been installed and started. The method is invoked after
preparing the OSGi environment for the test execution but before
any test is executed.
The given
BundleContext
belongs to the underlying OSGi
framework.
Normally, this method is called only one during the lifecycle of a
test suite.
- Parameters:
platformBundleContext
- the platform bundle context
- Throws:
Exception
- See Also:
preProcessBundleContext(BundleContext)
run
public final void run(TestResult result)
-
Replacement run method. Gets a hold of the TestRunner used for
running this test so it can populate it with the results retrieved from
OSGi.
- Specified by:
run
in interface Test
- Overrides:
run
in class TestCase
runBare
public void runBare()
throws Throwable
- Overrides:
runBare
in class ConditionalTestCase
- Throws:
Throwable
Copyright © 2006-2008 Spring Framework. All Rights Reserved.