Package org.nuxeo.runtime.test
Class NXRuntimeTestCase
java.lang.Object
org.nuxeo.runtime.test.RuntimeHarnessImpl
org.nuxeo.runtime.test.NXRuntimeTestCase
- All Implemented Interfaces:
RuntimeHarness
Deprecated.
Abstract base class for test cases that require a test runtime service.
The runtime service itself is conveniently available as the runtime instance variable in derived
classes.
Warning: NXRuntimeTestCase subclasses must
- not declare they own @Before and @After.
- override doSetUp and doTearDown (and postSetUp if needed) instead of setUp and tearDown.
- never call deployXXX methods outside the doSetUp method.
- Author:
- Bogdan Stefanescu
-
Field Summary
FieldsModifier and TypeFieldDescriptionDeprecated.protected final booleanDeprecated.Set to true when the instance of this class is a JUnit test case.protected org.jmock.MockeryDeprecated.Fields inherited from class org.nuxeo.runtime.test.RuntimeHarnessImpl
bundleLoader, bundles, frameworkStarted, osgi, readUris, runtime, runtimeBundle, targetResourceLocator, urls, wdConfigs, workingDir -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Used when subclassing to create standalone test casesNXRuntimeTestCase(Class<?> clazz) Deprecated.Used by the features runner to manage the Nuxeo framework -
Method Summary
Modifier and TypeMethodDescriptionprotected voidDeprecated.Should be called by subclasses after one or more inline deployments are made inside a test method.voiddeployContrib(String uri) Deprecated.Deploy a contribution specified as a "bundleName:path" uriprotected voiddeployContrib(URL url) Deprecated.static URLgetResource(String name) Deprecated.protected OSGiRuntimeServicehandleNewRuntime(OSGiRuntimeService aRuntime) Deprecated.protected static booleanDeprecated.protected URLlookupBundleUrl(String bundle) Deprecated.Resolves an URL for bundle deployment code.voidDeprecated.Remove the latest deployed components usingpushInlineDeployments(String...).voidpopInlineDeployments(int index) Deprecated.protected voidDeprecated.Called after framework was started (at the end of setUp).voidpushInlineDeployments(String... deploymentUris) Deprecated.Hot deploy the given components (identified by an URI).protected voidDeprecated.Should be called by subclasses to remove any inline deployments made in the current test method.protected voidsetUp()Deprecated.Implementors should override this method to setup tests and not thestartRuntime()method.voidstart()Deprecated.voidDeprecated.voidstop()Deprecated.voidDeprecated.protected voidtearDown()Deprecated.Implementors should override this method to implement any specific test tear down and not thestopRuntime()methodvoidundeployContrib(String uri) Deprecated.Methods inherited from class org.nuxeo.runtime.test.RuntimeHarnessImpl
addWorkingDirectoryConfigurator, deployBundle, deployContrib, deployPartial, deployPartialComponent, fireFrameworkStarted, getContext, getOSGiAdapter, getWorkingDir, initOsgiRuntime, initUrls, introspectClasspath, isAnEmptyTestProperty, isStarted, listBundleComponents, lookupBundle, readSymbolicName, undeployContrib, wipeEmptyTestSystemProperties, wipeRuntime
-
Field Details
-
jmcontext
protected org.jmock.Mockery jmcontextDeprecated. -
deploymentStack
Deprecated. -
isTestUnit
protected final boolean isTestUnitDeprecated.Set to true when the instance of this class is a JUnit test case. Set to false when the instance of this class is instantiated by the FeaturesRunner to manage the framework If the class is a JUnit test case then the runtime components will be started at the end of the setUp method
-
-
Constructor Details
-
NXRuntimeTestCase
public NXRuntimeTestCase()Deprecated.Used when subclassing to create standalone test cases -
NXRuntimeTestCase
Deprecated.Used by the features runner to manage the Nuxeo framework
-
-
Method Details
-
start
Deprecated.- Specified by:
startin interfaceRuntimeHarness- Overrides:
startin classRuntimeHarnessImpl- Throws:
Exception
-
startRuntime
Deprecated.- Throws:
Exception
-
setUp
Deprecated.Implementors should override this method to setup tests and not thestartRuntime()method. This method should contain all the bundle or component deployments needed by the tests. At the time this method is called the components are not yet started. If you need to perform component/service lookups use instead thepostSetUp()method- Throws:
Exception
-
tearDown
Deprecated.Implementors should override this method to implement any specific test tear down and not thestopRuntime()method- Throws:
Exception
-
postSetUp
Deprecated.Called after framework was started (at the end of setUp). Implementors may use this to use deployed services to initialize fields etc.- Throws:
Exception
-
stopRuntime
Deprecated.- Throws:
Exception
-
stop
Deprecated.- Specified by:
stopin interfaceRuntimeHarness- Overrides:
stopin classRuntimeHarnessImpl- Throws:
Exception
-
handleNewRuntime
Deprecated. -
getResource
Deprecated. -
deployContrib
Deprecated. -
deployContrib
Deprecated.Deploy a contribution specified as a "bundleName:path" uri- Throws:
Exception
-
undeployContrib
Deprecated.- Throws:
Exception
-
isVersionSuffix
Deprecated. -
lookupBundleUrl
Deprecated.Resolves an URL for bundle deployment code.TODO: Implementation could be finer...
- Returns:
- the resolved url
-
applyInlineDeployments
Deprecated.Should be called by subclasses after one or more inline deployments are made inside a test method. Without calling this the inline deployment(s) will not have any effects.Be Warned that if you reference runtime services or components you should lookup them again after calling this method!
This method also calls
postSetUp()for convenience.- Throws:
Exception
-
removeInlineDeployments
Deprecated.Should be called by subclasses to remove any inline deployments made in the current test method.Be Warned that if you reference runtime services or components you should lookup them again after calling this method!
This method also calls
postSetUp()for convenience.- Throws:
Exception
-
pushInlineDeployments
Deprecated.Hot deploy the given components (identified by an URI). All the started components are stopped, the new ones are registered and then all components are started. You can undeploy these components by callingpopInlineDeployments()A component URI is of the form: bundleSymbolicName:pathToComponentXmlInBundle
- Throws:
Exception
-
popInlineDeployments
Deprecated.Remove the latest deployed components usingpushInlineDeployments(String...).- Throws:
Exception
-
popInlineDeployments
Deprecated.- Throws:
Exception
-
RuntimeHarnessImpl