org.springframework.osgi.test
Class AbstractConfigurableBundleCreatorTests

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
                                      extended by org.springframework.osgi.test.AbstractSynchronizedOsgiTests
                                          extended by org.springframework.osgi.test.AbstractDependencyManagerTests
                                              extended by org.springframework.osgi.test.AbstractOnTheFlyBundleCreatorTests
                                                  extended by org.springframework.osgi.test.AbstractConfigurableBundleCreatorTests
All Implemented Interfaces:
Test, org.springframework.osgi.internal.test.OsgiJUnitTest

public abstract class AbstractConfigurableBundleCreatorTests
extends AbstractOnTheFlyBundleCreatorTests

Subclass of AbstractOnTheFlyBundleCreatorTests which adds extra functionality for configuring the jar creation. The created bundle (jar) can be configured by indicating the locations for:

These settings can be configured by:

Author:
Costin Leau

Field Summary
static Properties DEFAULT_SETTINGS
           
protected static String INCLUDE_PATTERNS
           
protected static Properties jarSettings
          Settings for the jar creation.
protected static String LIBS
           
protected static String MANIFEST
           
protected static String ROOT_DIR
           
 
Fields inherited from class org.springframework.osgi.test.AbstractSynchronizedOsgiTests
DEFAULT_WAIT_TIME
 
Fields inherited from class org.springframework.osgi.test.AbstractConfigurableOsgiTests
OSGI_FRAMEWORK_SELECTOR
 
Fields inherited from class org.springframework.osgi.test.AbstractOsgiTests
bundleContext, 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
AbstractConfigurableBundleCreatorTests()
           
 
Method Summary
protected  String[] getBundleContentPattern()
          Patterns for identifying the resources added to the jar.
protected  String getManifestLocation()
          Return the location (in Spring resource style) of the manifest location to be used.
protected  String getRootPath()
          Resources' root path (the root path does not become part of the jar).
protected  Properties getSettings()
          Load the settings (if they are found).
protected  String getSettingsLocation()
          Returns the settings location (by default, the test name; i.e.
protected  void postProcessBundleContext(BundleContext context)
          Load the jar settings, first from the disk falling back to the default settings, if none is found.
 
Methods inherited from class org.springframework.osgi.test.AbstractOnTheFlyBundleCreatorTests
createDefaultManifest, getManifest
 
Methods inherited from class org.springframework.osgi.test.AbstractDependencyManagerTests
getBundleLocations, getBundles, getLocator, getMandatoryBundles, getSpringBundledVersion, getSpringOsgiVersion, getTestBundles, getTestBundlesNames, getTestFrameworkBundles, getTestFrameworkBundlesNames, getTestingFrameworkBundlesConfiguration, injectLocator, localMavenArtifact, localMavenArtifact, locateBundle, preProcessBundleContext
 
Methods inherited from class org.springframework.osgi.test.AbstractSynchronizedOsgiTests
getDefaultWaitTime, shouldWaitForSpringBundlesContextCreation, waitOnContextCreation, waitOnContextCreation, waitOnContextCreation
 
Methods inherited from class org.springframework.osgi.test.AbstractConfigurableOsgiTests
createPlatform, getBootDelegationPackages, getPlatformName
 
Methods inherited from class org.springframework.osgi.test.AbstractOsgiTests
getBundleContext, getResourceLoader, injectBundleContext, injectOsgiJUnitTest, osgiRunTest, osgiSetUp, osgiTearDown, run, runBare, setName
 
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

ROOT_DIR

protected static final String ROOT_DIR
See Also:
Constant Field Values

INCLUDE_PATTERNS

protected static final String INCLUDE_PATTERNS
See Also:
Constant Field Values

LIBS

protected static final String LIBS
See Also:
Constant Field Values

MANIFEST

protected static final String MANIFEST
See Also:
Constant Field Values

DEFAULT_SETTINGS

public static final Properties DEFAULT_SETTINGS

jarSettings

protected static Properties jarSettings
Settings for the jar creation.

Constructor Detail

AbstractConfigurableBundleCreatorTests

public AbstractConfigurableBundleCreatorTests()
Method Detail

getRootPath

protected String getRootPath()
Resources' root path (the root path does not become part of the jar).

Returns:
the root path

getBundleContentPattern

protected String[] getBundleContentPattern()
Patterns for identifying the resources added to the jar. The patterns are added to the root path when performing the search.

Overrides:
getBundleContentPattern in class AbstractOnTheFlyBundleCreatorTests
Returns:
the patterns

getManifestLocation

protected String getManifestLocation()
Return the location (in Spring resource style) of the manifest location to be used.

Overrides:
getManifestLocation in class AbstractOnTheFlyBundleCreatorTests
Returns:
the manifest location

getSettingsLocation

protected String getSettingsLocation()
Returns the settings location (by default, the test name; i.e. foo.bar.SomeTest will try to load foo/bar/SomeTest.properties).

Returns:

getSettings

protected Properties getSettings()
                          throws Exception
Load the settings (if they are found). A non-null properties object will always be returned.

Returns:
Throws:
Exception

postProcessBundleContext

protected void postProcessBundleContext(BundleContext context)
                                 throws Exception
Load the jar settings, first from the disk falling back to the default settings, if none is found.

Overrides:
postProcessBundleContext in class AbstractOnTheFlyBundleCreatorTests
Throws:
Exception
See Also:
AbstractOsgiTests.preProcessBundleContext(BundleContext)


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