public class NXRuntimeTestCase extends Object implements RuntimeHarness
 The runtime service itself is conveniently available as the
 runtime instance variable in derived classes.
| Constructor and Description | 
|---|
| NXRuntimeTestCase() | 
| NXRuntimeTestCase(String name) | 
| Modifier and Type | Method and Description | 
|---|---|
| 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. | 
| List<String> | getClassLoaderFiles() | 
| 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 | isRestart() | 
| boolean | isStarted() | 
| BundleFile | lookupBundle(String bundleName) | 
| void | restart()Restarts the runtime and preserve homes directory. | 
| 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. | 
public NXRuntimeTestCase()
public NXRuntimeTestCase(String name)
public boolean isRestart()
isRestart in interface RuntimeHarnesspublic void addWorkingDirectoryConfigurator(WorkingDirectoryConfigurator config)
addWorkingDirectoryConfigurator in interface RuntimeHarnesspublic File getWorkingDir()
RuntimeHarnessgetWorkingDir in interface RuntimeHarnesspublic void restart()
             throws Exception
restart in interface RuntimeHarnessExceptionpublic void start()
           throws Exception
start in interface RuntimeHarnessExceptionpublic void fireFrameworkStarted()
                          throws Exception
FrameworkEvent.STARTED.fireFrameworkStarted in interface RuntimeHarnessExceptionpublic void stop()
          throws Exception
stop in interface RuntimeHarnessExceptionpublic boolean isStarted()
isStarted in interface RuntimeHarness@Deprecated public void deploy(String contrib)
deployContrib() insteaddeploy 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 RuntimeHarnesscontrib - 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 RuntimeHarnessbundle - the name of the bundle to peek the contrib incontrib - the path to contrib in the bundle.Exceptionpublic 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 RuntimeHarnessbundle - the bundle that becomes the contribution ownercontrib - the contribution to deploy as part of the given bundleExceptionpublic RuntimeContext deployTestContrib(String bundle, URL contrib) throws Exception
deployTestContrib in interface RuntimeHarnessException@Deprecated public void undeploy(String contrib)
undeployContrib(String, String) insteadundeploy in interface RuntimeHarness@Deprecated public void undeployContrib(String contrib)
undeployContrib(String, String) insteadundeployContrib in interface RuntimeHarnesspublic 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 RuntimeHarnessbundle - the bundlecontrib - the contributionExceptionpublic 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 RuntimeHarnessbundle - the symbolic nameExceptionpublic BundleFile lookupBundle(String bundleName) throws Exception
Exceptionpublic void deployFolder(File folder, ClassLoader loader) throws Exception
deployFolder in interface RuntimeHarnessExceptionpublic Properties getProperties()
RuntimeHarnessgetProperties in interface RuntimeHarnesspublic RuntimeContext getContext()
RuntimeHarnessgetContext in interface RuntimeHarnesspublic OSGiAdapter getOSGiAdapter()
RuntimeHarnessgetOSGiAdapter in interface RuntimeHarnesspublic List<String> getClassLoaderFiles() throws URISyntaxException
getClassLoaderFiles in interface RuntimeHarnessURISyntaxExceptionCopyright © 2014 Nuxeo SA. All rights reserved.