public class FlowableIdmRule extends Object implements org.junit.rules.TestRule
Usage:
public class YourTest {
@Rule
public FlowableIdmRule flowableIdmRule = new FlowableIdmRule();
...
}
The IdmEngine and the services will be made available to the test class through the getters of the FlowableRule. The idmEngine will be initialized by default with the flowable.idm.cfg.xml resource
on the classpath. To specify a different configuration file, pass the resource location in the appropriate constructor. Process engines will be cached statically.
Right before the first time the setUp is called for a given configuration resource, the process engine will be constructed.
You can declare a deployment with the FormDeploymentAnnotation annotation. This base class will make sure that this deployment gets deployed before the setUp and
cascade deleted after the tearDown.
The Flowable also lets you set the current time used by the process engine. This can be handy to control the exact time that is used by the engine in
order to verify e.g. e.g. due dates of timers. Or start, end and duration times in the history service. In the tearDown, the internal clock will automatically be reset to use the current system
time rather then the time that was set during a test method.
| Modifier and Type | Field and Description |
|---|---|
protected String |
configurationResource |
protected String |
deploymentId |
protected IdmIdentityService |
identityService |
protected IdmEngine |
idmEngine |
protected IdmEngineConfiguration |
idmEngineConfiguration |
| Constructor and Description |
|---|
FlowableIdmRule() |
FlowableIdmRule(IdmEngine idmEngine) |
FlowableIdmRule(String configurationResource) |
| Modifier and Type | Method and Description |
|---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description)
Implementation based on
TestWatcher. |
protected void |
configureIdmEngine() |
protected void |
failed(Throwable e,
org.junit.runner.Description description)
Invoked when a test fails
|
String |
getConfigurationResource() |
IdmIdentityService |
getIdentityService() |
IdmEngine |
getIdmEngine() |
protected void |
initializeIdmEngine() |
protected void |
initializeServices() |
void |
setConfigurationResource(String configurationResource) |
void |
setIdentityService(IdmIdentityService identityService) |
void |
setIdmEngine(IdmEngine idmEngine) |
void |
setIdmEngineConfiguration(IdmEngineConfiguration idmEngineConfiguration) |
protected void |
skipped(org.junit.internal.AssumptionViolatedException e,
org.junit.runner.Description description)
Invoked when a test is skipped due to a failed assumption.
|
protected void |
starting(org.junit.runner.Description description) |
protected void |
succeeded(org.junit.runner.Description description)
Invoked when a test succeeds
|
protected String configurationResource
protected String deploymentId
protected IdmEngineConfiguration idmEngineConfiguration
protected IdmEngine idmEngine
protected IdmIdentityService identityService
public FlowableIdmRule()
public FlowableIdmRule(String configurationResource)
public FlowableIdmRule(IdmEngine idmEngine)
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description)
TestWatcher.apply in interface org.junit.rules.TestRuleprotected void succeeded(org.junit.runner.Description description)
protected void failed(Throwable e, org.junit.runner.Description description)
protected void skipped(org.junit.internal.AssumptionViolatedException e,
org.junit.runner.Description description)
protected void starting(org.junit.runner.Description description)
protected void initializeIdmEngine()
protected void initializeServices()
protected void configureIdmEngine()
public String getConfigurationResource()
public void setConfigurationResource(String configurationResource)
public IdmEngine getIdmEngine()
public void setIdmEngine(IdmEngine idmEngine)
public IdmIdentityService getIdentityService()
public void setIdentityService(IdmIdentityService identityService)
public void setIdmEngineConfiguration(IdmEngineConfiguration idmEngineConfiguration)
Copyright © 2019 Flowable. All rights reserved.