|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.Assert junit.framework.TestCase org.jmock.core.VerifyingTestCase org.jmock.core.MockObjectSupportTestCase org.jmock.MockObjectTestCase org.nuxeo.runtime.test.NXRuntimeTestCase
public class NXRuntimeTestCase
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.
Field Summary |
---|
Fields inherited from class org.jmock.core.MockObjectSupportTestCase |
---|
ANYTHING, NOT_NULL, NULL |
Constructor Summary | |
---|---|
NXRuntimeTestCase()
|
|
NXRuntimeTestCase(java.lang.String name)
|
Method Summary | |
---|---|
void |
addWorkingDirectoryConfigurator(WorkingDirectoryConfigurator config)
|
void |
deploy(java.lang.String contrib)
Deprecated. use deployContrib() instead |
void |
deployBundle(java.lang.String bundle)
Deploys a whole OSGI bundle. |
void |
deployContrib(java.lang.String contrib)
Deprecated. use the less ambiguous deployContrib(BundleFile,String) |
void |
deployContrib(java.lang.String bundle,
java.lang.String contrib)
Deploys a contribution from a given bundle. |
void |
deployFolder(java.io.File folder,
java.lang.ClassLoader loader)
|
RuntimeContext |
deployTestContrib(java.lang.String bundle,
java.lang.String contrib)
Deploy an XML contribution from outside a bundle. |
RuntimeContext |
deployTestContrib(java.lang.String bundle,
java.net.URL contrib)
|
void |
fireFrameworkStarted()
Fire the event FrameworkEvent.STARTED . |
static java.net.URL |
getResource(java.lang.String resource)
|
java.io.File |
getWorkingDir()
Gets the framework working directory. |
boolean |
isStarted()
|
void |
setUp()
|
void |
start()
|
void |
stop()
|
void |
tearDown()
|
void |
undeploy(java.lang.String contrib)
Deprecated. use undeployContrib(String, String) instead |
void |
undeployContrib(java.lang.String contrib)
Deprecated. use undeployContrib(String, String) instead |
void |
undeployContrib(java.lang.String bundle,
java.lang.String contrib)
Undeploys a contribution from a given bundle. |
Methods inherited from class org.jmock.MockObjectTestCase |
---|
atLeastOnce, atMostOnce, defaultMockNameForType, doAll, doAll, doAll, doAll, exactly, mock, mock, never, never, newDummy, newDummy, newDummy, once, onConsecutiveCalls, onConsecutiveCalls, onConsecutiveCalls, onConsecutiveCalls, returnIterator, returnIterator, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, returnValue, throwException |
Methods inherited from class org.jmock.core.MockObjectSupportTestCase |
---|
and, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, arrayContaining, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, collectionContaining, collectionContaining, compatibleType, contains, endsWith, eq, eq, eq, eq, eq, eq, eq, eq, eq, eq, hasProperty, hasProperty, isA, isIn, isIn, mapContaining, mapContaining, mapWithKey, mapWithKey, mapWithValue, mapWithValue, not, or, same, startsWith, stringContains, toString |
Methods inherited from class org.jmock.core.VerifyingTestCase |
---|
registerToVerify, runBare, unregisterToVerify, verify |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, getName, run, run, 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, format |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NXRuntimeTestCase()
public NXRuntimeTestCase(java.lang.String name)
Method Detail |
---|
public void addWorkingDirectoryConfigurator(WorkingDirectoryConfigurator config)
addWorkingDirectoryConfigurator
in interface RuntimeHarness
public java.io.File getWorkingDir()
RuntimeHarness
getWorkingDir
in interface RuntimeHarness
public void start() throws java.lang.Exception
start
in interface RuntimeHarness
java.lang.Exception
public void setUp() throws java.lang.Exception
setUp
in class junit.framework.TestCase
java.lang.Exception
public void fireFrameworkStarted() throws java.lang.Exception
FrameworkEvent.STARTED
.
fireFrameworkStarted
in interface RuntimeHarness
java.lang.Exception
public void tearDown() throws java.lang.Exception
tearDown
in class junit.framework.TestCase
java.lang.Exception
public void stop() throws java.lang.Exception
stop
in interface RuntimeHarness
java.lang.Exception
public boolean isStarted()
isStarted
in interface RuntimeHarness
public static java.net.URL getResource(java.lang.String resource)
@Deprecated public void deploy(java.lang.String contrib)
deployContrib()
instead
deploy
in interface RuntimeHarness
@Deprecated public void deployContrib(java.lang.String contrib)
deployContrib(BundleFile,String)
The first contribution file found by the class loader will be used. You have no guarantee in case of name collisions.
deployContrib
in interface RuntimeHarness
contrib
- the relative path to the contribution filepublic void deployContrib(java.lang.String bundle, java.lang.String contrib) throws java.lang.Exception
The path will be relative to the bundle root. Example:
deployContrib("org.nuxeo.ecm.core", "OSGI-INF/CoreExtensions.xml")
For compatibility reasons the name of the bundle may be a jar name, but this use is discouraged and deprecated.
deployContrib
in interface RuntimeHarness
bundle
- the name of the bundle to peek the contrib incontrib
- the path to contrib in the bundle.
java.lang.Exception
public RuntimeContext deployTestContrib(java.lang.String bundle, java.lang.String contrib) throws java.lang.Exception
This should be used by tests wiling to deploy test contribution as part of a real bundle.
The bundle owner is important since the contribution may depend on resources deployed in that bundle.
Note that the owner bundle MUST be an already deployed bundle.
deployTestContrib
in interface RuntimeHarness
bundle
- the bundle that becomes the contribution ownercontrib
- the contribution to deploy as part of the given bundle
java.lang.Exception
public RuntimeContext deployTestContrib(java.lang.String bundle, java.net.URL contrib) throws java.lang.Exception
deployTestContrib
in interface RuntimeHarness
java.lang.Exception
@Deprecated public void undeploy(java.lang.String contrib)
undeployContrib(String, String)
instead
undeploy
in interface RuntimeHarness
@Deprecated public void undeployContrib(java.lang.String contrib)
undeployContrib(String, String)
instead
undeployContrib
in interface RuntimeHarness
public void undeployContrib(java.lang.String bundle, java.lang.String contrib) throws java.lang.Exception
The path will be relative to the bundle root. Example:
undeployContrib("org.nuxeo.ecm.core", "OSGI-INF/CoreExtensions.xml")
undeployContrib
in interface RuntimeHarness
bundle
- the bundlecontrib
- the contribution
java.lang.Exception
public void deployBundle(java.lang.String bundle) throws java.lang.Exception
The lookup is first done on symbolic name, as set in
MANIFEST.MF
and then falls back to the bundle url (e.g.,
nuxeo-platform-search-api
) for backwards compatibility.
deployBundle
in interface RuntimeHarness
bundle
- the symbolic name
java.lang.Exception
public void deployFolder(java.io.File folder, java.lang.ClassLoader loader) throws java.lang.Exception
deployFolder
in interface RuntimeHarness
java.lang.Exception
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |