|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.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
org.springframework.osgi.test.AbstractOnTheFlyBundleCreatorTests
org.springframework.osgi.test.AbstractConfigurableBundleCreatorTests
org.universAAL.itests.IntegrationTest
public class IntegrationTest
This class has to be extended for the purpose of OSGi integration test implementation. IntegrationTest extends class from Spring DM framework and adds feature of setting up the TestCase with the use of Eclipse launch configuration or Pax composite files. Comment about logging: org.universAAL.middleware.container.utils.LogUtils cannot be used because BundleContext (and therefore ModuleContext) does not yet exist for the bundle in which integration tests are to be launched. Thus exceptions are simple printed out to screen.
Nested Class Summary | |
---|---|
class |
IntegrationTest.FakeBundleContext
The class is used for intercepting installation of test bundle. |
Field Summary |
---|
Fields inherited from class org.springframework.osgi.test.AbstractConfigurableBundleCreatorTests |
---|
INCLUDE_PATTERNS, LIBS, MANIFEST, 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 |
---|
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 | |
---|---|
protected |
IntegrationTest()
Invoking noargument constructor indicates as follows: Default uAAL rundir, deployed to the nexus, is used The pax composite from project's target/artifact.composite file is launched. |
protected |
IntegrationTest(String eclipseLaunchConfiguration)
Invoking this constructor indicates that provided eclipse launch configuration is used for: providing set of bundles which should be started, providing run arguments, providing bundles.configuration.location (uAAL runtime configuration directory) Run arguments and bundles.configuration.location can be overridden by invocation of appropriate setter methods. |
Method Summary | |
---|---|
protected String |
formatMsg(String format,
Object... args)
Formatting log messages with a use of String.format. |
protected String |
getPlatformName()
This method informs Spring DM framework that Felix should be used as the OSGi platform for the tests. |
protected org.springframework.core.io.Resource[] |
getTestBundles()
This method returns sorted list of bundles which will be started for the purpose of the TestCase. |
protected void |
log(String logMsg)
Method for logging. |
protected void |
logAllBundles()
Logs all bundles. |
protected void |
postProcessBundleContext(org.osgi.framework.BundleContext context)
Method postProcessBundleContext has to be overridden to wrap system bundleContext into a fake one. |
protected void |
setBundleConfLocation(String path)
Sets bundles.configuration.location system property. |
void |
setIgnoreVersionMismatch(boolean ignoreVersionMismatch)
If set to true than version mismatch between bundle version specified in pom and bundle version specified in the manifest is ignored. |
protected void |
setLogLevel(int level)
Sets felix.log.level property. |
protected void |
setPaxArtifactUrls(String... urls)
Sets urls of pax artifacts which should be launched for integration testing. |
protected void |
setRunArguments(Properties p)
Sets run arguments of uAAL platform. |
protected void |
setRunArguments(String... args)
Sets run arguments of uAAL platform. |
protected void |
setUseOnlyLocalRepo(boolean useOnlyLocalRepo)
Sets flag which can force mvn url handler to look up only local maven repository. |
Methods inherited from class org.springframework.osgi.test.AbstractConfigurableBundleCreatorTests |
---|
getBundleContentPattern, getDefaultSettings, getManifestLocation, getRootPath, getSettings, getSettingsLocation |
Methods inherited from class org.springframework.osgi.test.AbstractOnTheFlyBundleCreatorTests |
---|
createDefaultManifest, createManifestOnlyFromTestClass, getManifest |
Methods inherited from class org.springframework.osgi.test.AbstractDependencyManagerTests |
---|
getLocator, getSpringDMVersion, getSpringVersion, getTestBundlesNames, getTestFrameworkBundles, getTestFrameworkBundlesNames, getTestingFrameworkBundlesConfiguration, locateBundle, locateBundles, preProcessBundleContext |
Methods inherited from class org.springframework.osgi.test.AbstractSynchronizedOsgiTests |
---|
getDefaultWaitTime, isSpringDMManaged, shouldWaitForSpringBundlesContextCreation, waitOnContextCreation, waitOnContextCreation, waitOnContextCreation |
Methods inherited from class org.springframework.osgi.test.AbstractConfigurableOsgiTests |
---|
createPlatform, getBootDelegationPackages |
Methods inherited from class org.springframework.osgi.test.AbstractOsgiTests |
---|
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, prepareApplicationContext, 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 |
---|
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, runTest, setName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected IntegrationTest()
protected IntegrationTest(String eclipseLaunchConfiguration)
eclipseLaunchConfiguration
- path to the launch configuration which will be used for
setting up the OSGi platform in which TestCase will be
executed.Method Detail |
---|
protected void log(String logMsg)
logMsg
- Log message to be printed.protected String formatMsg(String format, Object... args)
format
- Format in accordance with String.format API.args
- Arguments to be printed in accordance with passed format.
protected void logAllBundles()
protected void setLogLevel(int level)
protected void setRunArguments(String... args)
args
- Arguments have to provided as list of strings. There has to be
even number of arguments. All odd strings are interpreted as
keys and all even string are interpreted as values.protected void setRunArguments(Properties p)
p
- Properties which represent run arguments.protected void setPaxArtifactUrls(String... urls)
urls
- List of pax artifacts urls.protected void setBundleConfLocation(String path)
path
- Path to which bundles.configuration.location is to be set.protected void setUseOnlyLocalRepo(boolean useOnlyLocalRepo)
useOnlyLocalRepo
- public void setIgnoreVersionMismatch(boolean ignoreVersionMismatch)
protected String getPlatformName()
getPlatformName
in class org.springframework.osgi.test.AbstractConfigurableOsgiTests
protected void postProcessBundleContext(org.osgi.framework.BundleContext context) throws Exception
postProcessBundleContext
in class org.springframework.osgi.test.AbstractConfigurableBundleCreatorTests
Exception
protected org.springframework.core.io.Resource[] getTestBundles()
getTestBundles
in class org.springframework.osgi.test.AbstractDependencyManagerTests
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |