public class ProcessEngineRule extends org.junit.rules.TestWatcher implements ProcessEngineServices
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.TestWatcherprotected void initializeProcessEngine()
protected void initializeServices()
protected void clearServiceReferences()
public void finished(org.junit.runner.Description description)
finished in class org.junit.rules.TestWatcherpublic void setCurrentTime(Date currentTime)
public String getConfigurationResource()
public void setConfigurationResource(String configurationResource)
public ProcessEngine getProcessEngine()
public void setProcessEngine(ProcessEngine processEngine)
public RepositoryService getRepositoryService()
ProcessEngineServicesRepositoryService.getRepositoryService in interface ProcessEngineServicesRepositoryService object.public void setRepositoryService(RepositoryService repositoryService)
public RuntimeService getRuntimeService()
ProcessEngineServicesRuntimeService.getRuntimeService in interface ProcessEngineServicesRuntimeService object.public void setRuntimeService(RuntimeService runtimeService)
public TaskService getTaskService()
ProcessEngineServicesTaskService.getTaskService in interface ProcessEngineServicesTaskService object.public void setTaskService(TaskService taskService)
public HistoryService getHistoryService()
ProcessEngineServicesHistoryService.getHistoryService in interface ProcessEngineServicesHistoryService object.public void setHistoryService(HistoryService historyService)
public void setHistoricDataService(HistoryService historicService)
historicService - the historiy service instancesetHistoryService(HistoryService)public IdentityService getIdentityService()
ProcessEngineServicesIdentityService.getIdentityService in interface ProcessEngineServicesIdentityService object.public void setIdentityService(IdentityService identityService)
public ManagementService getManagementService()
ProcessEngineServicesManagementService.getManagementService in interface ProcessEngineServicesManagementService object.public AuthorizationService getAuthorizationService()
ProcessEngineServicesAuthorizationService.getAuthorizationService in interface ProcessEngineServicesAuthorizationService object.public void setAuthorizationService(AuthorizationService authorizationService)
public CaseService getCaseService()
ProcessEngineServicesCaseService.getCaseService in interface ProcessEngineServicesCaseService object.public void setCaseService(CaseService caseService)
public FormService getFormService()
ProcessEngineServicesFormService.getFormService in interface ProcessEngineServicesFormService object.public void setFormService(FormService formService)
public void setManagementService(ManagementService managementService)
public FilterService getFilterService()
ProcessEngineServicesFilterService.getFilterService in interface ProcessEngineServicesFilterService object.public void setFilterService(FilterService filterService)
public void manageDeployment(Deployment deployment)
Copyright © 2018. All rights reserved.