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
Modifier and TypeFieldDescriptionDeprecated.protected final boolean
Deprecated.Set to true when the instance of this class is a JUnit test case.protected org.jmock.Mockery
Deprecated.protected boolean
Deprecated.Fields inherited from class org.nuxeo.runtime.test.RuntimeHarnessImpl
bundleLoader, bundles, frameworkStarted, osgi, readUris, runtime, runtimeBundle, targetResourceLocator, urls, wdConfigs, workingDir
-
Constructor Summary
ConstructorDescriptionDeprecated.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 void
Deprecated.Should be called by subclasses after one or more inline deployments are made inside a test method.void
deployContrib
(String uri) Deprecated.Deploy a contribution specified as a "bundleName:path" uriprotected void
deployContrib
(URL url) Deprecated.static URL
getResource
(String name) Deprecated.protected OSGiRuntimeService
handleNewRuntime
(OSGiRuntimeService aRuntime) Deprecated.protected static boolean
Deprecated.protected URL
lookupBundleUrl
(String bundle) Deprecated.Resolves an URL for bundle deployment code.void
Deprecated.Remove the latest deployed components usingpushInlineDeployments(String...)
.void
popInlineDeployments
(int index) Deprecated.protected void
Deprecated.Called after framework was started (at the end of setUp).void
pushInlineDeployments
(String... deploymentUris) Deprecated.Hot deploy the given components (identified by an URI).protected void
Deprecated.Should be called by subclasses to remove any inline deployments made in the current test method.void
restart()
Deprecated.Restarts the runtime and preserve homes directory.protected void
setUp()
Deprecated.Implementors should override this method to setup tests and not thestartRuntime()
method.void
start()
Deprecated.void
Deprecated.void
stop()
Deprecated.void
Deprecated.protected void
tearDown()
Deprecated.Implementors should override this method to implement any specific test tear down and not thestopRuntime()
methodvoid
undeployContrib
(String uri) Deprecated.Methods inherited from class org.nuxeo.runtime.test.RuntimeHarnessImpl
addWorkingDirectoryConfigurator, deployBundle, deployContrib, deployFolder, deployPartial, deployPartialComponent, deployTestContrib, deployTestContrib, fireFrameworkStarted, getClassLoaderFiles, getContext, getOSGiAdapter, getProperties, getWorkingDir, initOsgiRuntime, initUrls, introspectClasspath, isAnEmptyTestProperty, isRestart, isStarted, listBundleComponents, lookupBundle, readSymbolicName, undeployContrib, wipeEmptyTestSystemProperties, wipeRuntime
-
Field Details
-
jmcontext
protected org.jmock.Mockery jmcontextDeprecated. -
restart
protected boolean restartDeprecated. -
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
-
restart
Deprecated.Restarts the runtime and preserve homes directory.- Specified by:
restart
in interfaceRuntimeHarness
- Overrides:
restart
in classRuntimeHarnessImpl
- Throws:
Exception
-
start
Deprecated.- Specified by:
start
in interfaceRuntimeHarness
- Overrides:
start
in 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:
stop
in interfaceRuntimeHarness
- Overrides:
stop
in 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