org.springframework.osgi.test
Class AbstractConfigurableOsgiTests

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.springframework.test.ConditionalTestCase
              extended by org.springframework.test.AbstractSpringContextTests
                  extended by org.springframework.test.AbstractSingleSpringContextTests
                      extended by org.springframework.test.AbstractDependencyInjectionSpringContextTests
                          extended by org.springframework.osgi.test.AbstractOptionalDependencyInjectionTests
                              extended by org.springframework.osgi.test.AbstractOsgiTests
                                  extended by org.springframework.osgi.test.AbstractConfigurableOsgiTests
All Implemented Interfaces:
Test
Direct Known Subclasses:
AbstractSynchronizedOsgiTests

public abstract class AbstractConfigurableOsgiTests
extends AbstractOsgiTests

Abstract JUnit super class which configures an OsgiPlatform.

This class offers more hooks for programmatic and declarative configuration of the underlying OSGi platform used when running the test suite.

Author:
Costin Leau

Field Summary
static String OSGI_FRAMEWORK_SELECTOR
          System property for selecting the appropriate OSGi implementation.
 
Fields inherited from class org.springframework.osgi.test.AbstractOsgiTests
resourceLoader
 
Fields inherited from class org.springframework.osgi.test.AbstractOptionalDependencyInjectionTests
bundleContext
 
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
 
Constructor Summary
AbstractConfigurableOsgiTests()
          Default constructor.
AbstractConfigurableOsgiTests(String name)
          Constructs a new AbstractConfigurableOsgiTests instance.
 
Method Summary
protected  OsgiPlatform createPlatform()
          Creates (and configures) the OSGi platform.

This implementation determines and creates the OSGi platform used by the test suite (Equinox by default).

protected  List getBootDelegationPackages()
          Returns the list of OSGi packages that are delegated to the boot classpath.
protected  String getPlatformName()
          Indicates what OSGi platform should be used by the test suite.
 
Methods inherited from class org.springframework.osgi.test.AbstractOsgiTests
getTestBundles, getTestFrameworkBundles, postProcessBundleContext, preProcessBundleContext, run, runBare
 
Methods inherited from class org.springframework.osgi.test.AbstractOptionalDependencyInjectionTests
createApplicationContext, isContextKeyEmpty
 
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, createBeanDefinitionReader, 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, setName, 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

OSGI_FRAMEWORK_SELECTOR

public static final String OSGI_FRAMEWORK_SELECTOR
System property for selecting the appropriate OSGi implementation.

See Also:
Constant Field Values
Constructor Detail

AbstractConfigurableOsgiTests

public AbstractConfigurableOsgiTests()
Default constructor. Constructs a new AbstractConfigurableOsgiTests instance.


AbstractConfigurableOsgiTests

public AbstractConfigurableOsgiTests(String name)
Constructs a new AbstractConfigurableOsgiTests instance.

Parameters:
name - test name
Method Detail

createPlatform

protected OsgiPlatform createPlatform()
Creates (and configures) the OSGi platform.

This implementation determines and creates the OSGi platform used by the test suite (Equinox by default). It will try to create a Platform instance based on the getPlatformName, falling back to Equinox in case of a failure.

Specified by:
createPlatform in class AbstractOsgiTests
Returns:
OSGi platform instance
See Also:
for an easier alternative.

getPlatformName

protected String getPlatformName()
Indicates what OSGi platform should be used by the test suite. By default, OSGI_FRAMEWORK_SELECTOR system property is used. Subclasses can override this and provide directly the OSGi platform name. By default, the platform name holds the fully qualified name of the OSGi platform class.

Returns:
platform platform name
See Also:
Platforms

getBootDelegationPackages

protected List getBootDelegationPackages()
Returns the list of OSGi packages that are delegated to the boot classpath. See the OSGi specification regarding the format of the package string representation.

Returns:
the list of strings representing the packages that the OSGi platform will delegate to the boot class path.


Copyright © 2006-2008 Spring Framework. All Rights Reserved.