public class ProcessEngineRule
extends org.junit.rules.TestWatcher
Usage:
public class YourTest { @Rule public ProcessEngineRule processEngineRule = new ProcessEngineRule(); ... }
The ProcessEngine and the services will be made available to the test class
through the getters of the processEngineRule.
The processEngine will be initialized by default with the camunda.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 Deployment
annotation.
This base class will make sure that this deployment gets deployed before the
setUp and cascade deleted
after the tearDown.
The processEngineRule 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. In other words, you don't have to clean up your own time messing mess ;-)
Modifier and Type | Field and Description |
---|---|
protected List<String> |
additionalDeployments |
protected AuthorizationService |
authorizationService |
protected CaseService |
caseService |
protected String |
configurationResource |
protected String |
configurationResourceCompat |
protected String |
deploymentId |
protected boolean |
ensureCleanAfterTest |
protected FilterService |
filterService |
protected FormService |
formService |
protected HistoryService |
historyService |
protected IdentityService |
identityService |
protected ManagementService |
managementService |
protected ProcessEngine |
processEngine |
protected RepositoryService |
repositoryService |
protected RuntimeService |
runtimeService |
protected TaskService |
taskService |
Constructor and Description |
---|
ProcessEngineRule() |
ProcessEngineRule(boolean ensureCleanAfterTest) |
ProcessEngineRule(ProcessEngine processEngine) |
ProcessEngineRule(ProcessEngine processEngine,
boolean ensureCleanAfterTest) |
ProcessEngineRule(String configurationResource) |
ProcessEngineRule(String configurationResource,
boolean ensureCleanAfterTest) |
protected String configurationResource
protected String configurationResourceCompat
protected String deploymentId
protected boolean ensureCleanAfterTest
protected ProcessEngine processEngine
protected RepositoryService repositoryService
protected RuntimeService runtimeService
protected TaskService taskService
protected HistoryService historyService
protected IdentityService identityService
protected ManagementService managementService
protected FormService formService
protected FilterService filterService
protected AuthorizationService authorizationService
protected CaseService caseService
public ProcessEngineRule()
public ProcessEngineRule(boolean ensureCleanAfterTest)
public ProcessEngineRule(String configurationResource)
public ProcessEngineRule(String configurationResource, boolean ensureCleanAfterTest)
public ProcessEngineRule(ProcessEngine processEngine)
public ProcessEngineRule(ProcessEngine processEngine, boolean ensureCleanAfterTest)
public void starting(org.junit.runner.Description description)
starting
in class org.junit.rules.TestWatcher
protected void initializeProcessEngine()
protected void initializeServices()
protected void clearServiceReferences()
public void finished(org.junit.runner.Description description)
finished
in class org.junit.rules.TestWatcher
public void setCurrentTime(Date currentTime)
public String getConfigurationResource()
public void setConfigurationResource(String configurationResource)
public ProcessEngine getProcessEngine()
public void setProcessEngine(ProcessEngine processEngine)
public RepositoryService getRepositoryService()
public void setRepositoryService(RepositoryService repositoryService)
public RuntimeService getRuntimeService()
public void setRuntimeService(RuntimeService runtimeService)
public TaskService getTaskService()
public void setTaskService(TaskService taskService)
public HistoryService getHistoryService()
public void setHistoricDataService(HistoryService historicDataService)
public IdentityService getIdentityService()
public void setIdentityService(IdentityService identityService)
public ManagementService getManagementService()
public FormService getFormService()
public void setManagementService(ManagementService managementService)
public FilterService getFilterService()
public void setFilterService(FilterService filterService)
public void manageDeployment(Deployment deployment)
Copyright © 2018. All rights reserved.