Package org.nuxeo.runtime.test.runner
Class HotDeployer
- java.lang.Object
-
- org.nuxeo.runtime.test.runner.HotDeployer
-
public class HotDeployer extends Object
A dynamic component deployer which enable tests to deploy new contributions after the test was started (i.e. from inside the test method) The deployer is reloading all the components and reinject the test members.- Author:
- bogdan
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHotDeployer.ActionHandlerDeploy actions are usually used by features to customize the deployment of the runtime feature (which is using the DeaultDeployAction)protected classHotDeployer.DefaultDeployHandlerThis action has no next action and will deploy the contributions and then reload the component manager
-
Field Summary
Fields Modifier and Type Field Description static StringDEPLOY_ACTIONprotected RuntimeHarnessharnessprotected HotDeployer.ActionHandlerheadstatic StringRELOAD_ACTIONstatic StringRESET_ACTIONstatic StringRESTART_ACTIONprotected FeaturesRunnerrunnerprotected static StringUNDEPLOY_ACTION
-
Constructor Summary
Constructors Constructor Description HotDeployer(FeaturesRunner runner, RuntimeHarness harness)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HotDeployeraddHandler(HotDeployer.ActionHandler action)Add a custom deploy action that wraps the default action.voiddeploy(String... contribs)Deploy the given list of contributions.voidreinject()voidreload()Reloads the components and preserve the current registry state.booleanremoveHandler(HotDeployer.ActionHandler handler)Remove the given handler if already registeredvoidreset()Restart the components and revert to the initial registry snapshot if any.voidrestart()Restart the components and preserve the current registry state.voidundeploy(String... contribs)
-
-
-
Field Detail
-
DEPLOY_ACTION
public static final String DEPLOY_ACTION
- See Also:
- Constant Field Values
-
UNDEPLOY_ACTION
protected static final String UNDEPLOY_ACTION
- See Also:
- Constant Field Values
-
RESTART_ACTION
public static final String RESTART_ACTION
- See Also:
- Constant Field Values
-
RESET_ACTION
public static final String RESET_ACTION
- See Also:
- Constant Field Values
-
RELOAD_ACTION
public static final String RELOAD_ACTION
- See Also:
- Constant Field Values
-
runner
protected FeaturesRunner runner
-
harness
protected RuntimeHarness harness
-
head
protected HotDeployer.ActionHandler head
-
-
Constructor Detail
-
HotDeployer
public HotDeployer(FeaturesRunner runner, RuntimeHarness harness)
-
-
Method Detail
-
addHandler
public HotDeployer addHandler(HotDeployer.ActionHandler action)
Add a custom deploy action that wraps the default action. You should call next.exec(...) in your action code to call the next action
-
removeHandler
public boolean removeHandler(HotDeployer.ActionHandler handler)
Remove the given handler if already registered
-
deploy
public void deploy(String... contribs) throws Exception
Deploy the given list of contributions. The format is bundleId[:componentPath]. If no component path is specified then the bundle identified by the bundleId part will be deployed. If a componentPath is givenRuntimeHarness.deployContrib(String,String)will be used to deploy the contribution.- Throws:
Exception
-
restart
public void restart() throws ExceptionRestart the components and preserve the current registry state.- Throws:
Exception
-
reset
public void reset() throws ExceptionRestart the components and revert to the initial registry snapshot if any.- Throws:
Exception
-
reload
public void reload() throws ExceptionReloads the components and preserve the current registry state. This action performs a standby/resume onComponentManager.- Throws:
Exception- Since:
- 10.2
-
reinject
public void reinject()
-
-