|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
public abstract class AbstractOsgiTests
Base test for OSGi environments. Takes care of starting the OSGi platform, installing the given bundles and delegating the test execution to a copy which runs inside OSGi.
Field Summary | |
---|---|
protected BundleContext |
bundleContext
|
protected ResourceLoader |
resourceLoader
|
Fields inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests |
---|
AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_NO |
Fields inherited from class org.springframework.test.AbstractSingleSpringContextTests |
---|
applicationContext |
Fields inherited from class org.springframework.test.ConditionalTestCase |
---|
logger |
Fields inherited from interface org.springframework.osgi.internal.test.OsgiJUnitTest |
---|
FOR_OSGI, FROM_OSGI, OSGI_TEST, OSGI_TEST_BUNDLE_ID |
Constructor Summary | |
---|---|
AbstractOsgiTests()
|
|
AbstractOsgiTests(String name)
|
Method Summary | |
---|---|
protected abstract OsgiPlatform |
createPlatform()
Create (and configure) the OSGi platform. |
protected BundleContext |
getBundleContext()
Deprecated. use the bundleContext field directly |
protected String[] |
getBundleLocations()
Deprecated. use |
protected String[] |
getBundles()
Deprecated. use #getTestBundlesNames() |
protected abstract String[] |
getMandatoryBundles()
Deprecated. use getTestFrameworkBundles() |
protected ResourceLoader |
getResourceLoader()
Deprecated. use the resourceLoader field directly |
protected abstract Resource[] |
getTestBundles()
Bundles required for the the test execution. |
protected abstract Resource[] |
getTestFrameworkBundles()
Test framework bundles (part of the test setup). |
void |
injectBundleContext(BundleContext bundleContext)
Set the bundle context to be used by this test. |
void |
injectOsgiJUnitTest(org.springframework.osgi.internal.test.OsgiJUnitTest test)
Set the underlying OsgiJUnitTest used for the test delegation. |
void |
osgiRunTest()
Actual test execution (delegates to the superclass implementation). |
void |
osgiSetUp()
the setUp version for the OSGi environment. |
void |
osgiTearDown()
|
protected void |
postProcessBundleContext(BundleContext platformBundleContext)
Callback for processing the platform bundle context after the critical test infrastructure bundles have been installed and started. |
protected void |
preProcessBundleContext(BundleContext platformBundleContext)
Callback for processing the platform bundle context before any bundles have been installed. |
void |
run(TestResult result)
Replacement run method. |
void |
runBare()
|
void |
setName(String name)
|
Methods inherited from class org.springframework.osgi.test.AbstractOptionalDependencyInjectionTests |
---|
createApplicationContext |
Methods inherited from class org.springframework.test.AbstractDependencyInjectionSpringContextTests |
---|
getAutowireMode, injectDependencies, isDependencyCheck, isPopulateProtectedVariables, prepareTestInstance, setAutowireMode, setDependencyCheck, setPopulateProtectedVariables |
Methods inherited from class org.springframework.test.AbstractSingleSpringContextTests |
---|
contextKey, customizeBeanFactory, getApplicationContext, getConfigLocations, getConfigPath, getConfigPaths, getLoadCount, loadContext, loadContextLocations, onSetUp, onTearDown, setDirty, setUp, tearDown |
Methods inherited from class org.springframework.test.AbstractSpringContextTests |
---|
addContext, contextKeyString, getContext, hasCachedContext, setDirty |
Methods inherited from class org.springframework.test.ConditionalTestCase |
---|
getDisabledTestCount, isDisabledInThisEnvironment, recordDisabled |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, runTest, toString |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected BundleContext bundleContext
protected ResourceLoader resourceLoader
Constructor Detail |
---|
public AbstractOsgiTests()
public AbstractOsgiTests(String name)
Method Detail |
---|
protected String[] getBundleLocations()
protected ResourceLoader getResourceLoader()
resourceLoader
field directly
protected BundleContext getBundleContext()
bundleContext
field directly
getBundleContext
in class AbstractOptionalDependencyInjectionTests
protected String[] getBundles()
#getTestBundlesNames()
protected abstract String[] getMandatoryBundles()
getTestFrameworkBundles()
getBundles()
instead.
protected abstract Resource[] getTestFrameworkBundles()
getBundles()
instead.
protected abstract Resource[] getTestBundles()
protected abstract OsgiPlatform createPlatform() throws Exception
Exception
protected void preProcessBundleContext(BundleContext platformBundleContext) throws Exception
platformBundleContext
-
Exception
postProcessBundleContext(BundleContext)
protected void postProcessBundleContext(BundleContext platformBundleContext) throws Exception
getBundleContext()
returns null
since the OSGi test execution hasn't started yet - the only BundleContext
available is that of the OSGi framework.
platformBundleContext
-
Exception
preProcessBundleContext(BundleContext)
public final void run(TestResult result)
run
in interface Test
run
in class TestCase
public void runBare() throws Throwable
runBare
in class ConditionalTestCase
Throwable
public final void osgiSetUp() throws Exception
osgiSetUp
in interface org.springframework.osgi.internal.test.OsgiJUnitTest
Exception
public final void osgiTearDown() throws Exception
osgiTearDown
in interface org.springframework.osgi.internal.test.OsgiJUnitTest
Exception
public final void osgiRunTest() throws Throwable
osgiRunTest
in interface org.springframework.osgi.internal.test.OsgiJUnitTest
Throwable
public final void injectBundleContext(BundleContext bundleContext)
injectBundleContext
in interface org.springframework.osgi.internal.test.OsgiJUnitTest
public void setName(String name)
setName
in interface org.springframework.osgi.internal.test.OsgiJUnitTest
setName
in class TestCase
public final void injectOsgiJUnitTest(org.springframework.osgi.internal.test.OsgiJUnitTest test)
test
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |