|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
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(String name)
|
Method Summary | |
---|---|
void |
addWorkingDirectoryConfigurator(WorkingDirectoryConfigurator config)
|
void |
deploy(String contrib)
Deprecated. use deployContrib() instead |
void |
deployBundle(String bundle)
Deploys a whole OSGI bundle. |
void |
deployContrib(String contrib)
Deprecated. use the less ambiguous deployContrib(BundleFile,String) |
void |
deployContrib(String bundle,
String contrib)
Deploys a contribution from a given bundle. |
void |
deployFolder(File folder,
ClassLoader loader)
|
RuntimeContext |
deployTestContrib(String bundle,
String contrib)
Deploy an XML contribution from outside a bundle. |
RuntimeContext |
deployTestContrib(String bundle,
URL contrib)
|
void |
fireFrameworkStarted()
Fire the event FrameworkEvent.STARTED . |
RuntimeContext |
getContext()
Runtime context for deployment |
OSGiAdapter |
getOSGiAdapter()
OSGI bridge |
Properties |
getProperties()
Framework properties for variable injections |
static URL |
getResource(String resource)
|
File |
getWorkingDir()
Gets the framework working directory. |
boolean |
isStarted()
|
BundleFile |
lookupBundle(String bundleName)
|
void |
setUp()
|
void |
start()
|
void |
stop()
|
void |
tearDown()
|
void |
undeploy(String contrib)
Deprecated. use undeployContrib(String, String) instead |
void |
undeployContrib(String contrib)
Deprecated. use undeployContrib(String, String) instead |
void |
undeployContrib(String bundle,
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(String name)
Method Detail |
---|
public void addWorkingDirectoryConfigurator(WorkingDirectoryConfigurator config)
addWorkingDirectoryConfigurator
in interface RuntimeHarness
public File getWorkingDir()
RuntimeHarness
getWorkingDir
in interface RuntimeHarness
public void start() throws Exception
start
in interface RuntimeHarness
Exception
public void setUp() throws Exception
setUp
in class junit.framework.TestCase
Exception
public void fireFrameworkStarted() throws Exception
FrameworkEvent.STARTED
.
fireFrameworkStarted
in interface RuntimeHarness
Exception
public void tearDown() throws Exception
tearDown
in class junit.framework.TestCase
Exception
public void stop() throws Exception
stop
in interface RuntimeHarness
Exception
public boolean isStarted()
isStarted
in interface RuntimeHarness
public static URL getResource(String resource)
@Deprecated public void deploy(String contrib)
deployContrib()
instead
deploy
in interface RuntimeHarness
@Deprecated public void deployContrib(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(String bundle, String contrib) throws 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.
Exception
public RuntimeContext deployTestContrib(String bundle, String contrib) throws 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
Exception
public RuntimeContext deployTestContrib(String bundle, URL contrib) throws Exception
deployTestContrib
in interface RuntimeHarness
Exception
@Deprecated public void undeploy(String contrib)
undeployContrib(String, String)
instead
undeploy
in interface RuntimeHarness
@Deprecated public void undeployContrib(String contrib)
undeployContrib(String, String)
instead
undeployContrib
in interface RuntimeHarness
public void undeployContrib(String bundle, String contrib) throws 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
Exception
public void deployBundle(String bundle) throws 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
Exception
public BundleFile lookupBundle(String bundleName) throws Exception
Exception
public void deployFolder(File folder, ClassLoader loader) throws Exception
deployFolder
in interface RuntimeHarness
Exception
public Properties getProperties()
RuntimeHarness
getProperties
in interface RuntimeHarness
public RuntimeContext getContext()
RuntimeHarness
getContext
in interface RuntimeHarness
public OSGiAdapter getOSGiAdapter()
RuntimeHarness
getOSGiAdapter
in interface RuntimeHarness
|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |