Class ProcessEngineRule
- All Implemented Interfaces:
- ProcessEngineServices,- org.junit.rules.TestRule
- Direct Known Subclasses:
- UpgradeTestRule
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. If you add a deployment programmatically in your
 test, you have to make it known to the processEngineRule by calling
 manageDeployment(org.camunda.bpm.engine.repository.Deployment)
 to have it cleaned up automatically.
 
 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., 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 ;-)
 
 If you need the history service for your tests then you can specify the
 required history level of the test method or class, using the
 RequiredHistoryLevel annotation. If the current history level of the
 process engine is lower than the specified one then the test is skipped.
 
- Author:
- Tom Baeyens
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected AuthorizationServiceprotected CaseServiceprotected Stringprotected Stringprotected DecisionServiceprotected Stringprotected booleanprotected ExternalTaskServiceprotected FilterServiceprotected FormServiceprotected HistoryServiceprotected IdentityServiceprotected ManagementServiceprotected ProcessEngineprotected ProcessEngineConfigurationImplprotected RepositoryServiceprotected RuntimeServiceprotected TaskService
- 
Constructor SummaryConstructorsConstructorDescriptionProcessEngineRule(boolean ensureCleanAfterTest) ProcessEngineRule(String configurationResource) ProcessEngineRule(String configurationResource, boolean ensureCleanAfterTest) ProcessEngineRule(ProcessEngine processEngine) ProcessEngineRule(ProcessEngine processEngine, boolean ensureCleanAfterTest) 
- 
Method SummaryModifier and TypeMethodDescriptionorg.junit.runners.model.Statementapply(org.junit.runners.model.Statement base, org.junit.runner.Description description) protected voidvoidfinished(org.junit.runner.Description description) Returns the process engine'sAuthorizationService.Returns the engine'sCaseService.Returns the engine'sDecisionService.Returns the engine'sExternalTaskService.Returns the engine'sFilterService.Returns the process engine'sFormService.Returns the process engine'sHistoryService.Returns the process engine'sIdentityService.Returns the process engine'sManagementService.Returns the process engine'sRepositoryService.Returns the process engine'sRuntimeService.Returns the process engine'sTaskService.protected voidprotected voidvoidmanageDeployment(Deployment deployment) voidsetAuthorizationService(AuthorizationService authorizationService) voidsetCaseService(CaseService caseService) voidsetConfigurationResource(String configurationResource) voidsetCurrentTime(Date currentTime) voidsetDecisionService(DecisionService decisionService) voidsetExternalTaskService(ExternalTaskService externalTaskService) voidsetFilterService(FilterService filterService) voidsetFormService(FormService formService) voidsetHistoricDataService(HistoryService historicService) voidsetHistoryService(HistoryService historyService) voidsetIdentityService(IdentityService identityService) voidsetManagementService(ManagementService managementService) voidsetProcessEngine(ProcessEngine processEngine) voidsetProcessEngineConfiguration(ProcessEngineConfigurationImpl processEngineConfiguration) voidsetRepositoryService(RepositoryService repositoryService) voidsetRuntimeService(RuntimeService runtimeService) voidsetTaskService(TaskService taskService) voidstarting(org.junit.runner.Description description) Methods inherited from class org.junit.rules.TestWatcherfailed, skipped, skipped, succeeded
- 
Field Details- 
configurationResource
- 
configurationResourceCompat
- 
deploymentId
- 
additionalDeployments
- 
ensureCleanAfterTestprotected boolean ensureCleanAfterTest
- 
processEngine
- 
processEngineConfiguration
- 
repositoryService
- 
runtimeService
- 
taskService
- 
historyService
- 
identityService
- 
managementService
- 
formService
- 
filterService
- 
authorizationService
- 
caseService
- 
externalTaskService
- 
decisionService
 
- 
- 
Constructor Details- 
ProcessEngineRulepublic ProcessEngineRule()
- 
ProcessEngineRulepublic ProcessEngineRule(boolean ensureCleanAfterTest) 
- 
ProcessEngineRule
- 
ProcessEngineRule
- 
ProcessEngineRule
- 
ProcessEngineRule
 
- 
- 
Method Details- 
startingpublic void starting(org.junit.runner.Description description) - Overrides:
- startingin class- org.junit.rules.TestWatcher
 
- 
applypublic org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description) - Specified by:
- applyin interface- org.junit.rules.TestRule
- Overrides:
- applyin class- org.junit.rules.TestWatcher
 
- 
initializeProcessEngineprotected void initializeProcessEngine()
- 
initializeServicesprotected void initializeServices()
- 
clearServiceReferencesprotected void clearServiceReferences()
- 
finishedpublic void finished(org.junit.runner.Description description) - Overrides:
- finishedin class- org.junit.rules.TestWatcher
 
- 
setCurrentTime
- 
getConfigurationResource
- 
setConfigurationResource
- 
getProcessEngine
- 
setProcessEngine
- 
getProcessEngineConfiguration
- 
setProcessEngineConfigurationpublic void setProcessEngineConfiguration(ProcessEngineConfigurationImpl processEngineConfiguration) 
- 
getRepositoryServiceDescription copied from interface:ProcessEngineServicesReturns the process engine'sRepositoryService.- Specified by:
- getRepositoryServicein interface- ProcessEngineServices
- Returns:
- the RepositoryServiceobject.
 
- 
setRepositoryService
- 
getRuntimeServiceDescription copied from interface:ProcessEngineServicesReturns the process engine'sRuntimeService.- Specified by:
- getRuntimeServicein interface- ProcessEngineServices
- Returns:
- the RuntimeServiceobject.
 
- 
setRuntimeService
- 
getTaskServiceDescription copied from interface:ProcessEngineServicesReturns the process engine'sTaskService.- Specified by:
- getTaskServicein interface- ProcessEngineServices
- Returns:
- the TaskServiceobject.
 
- 
setTaskService
- 
getHistoryServiceDescription copied from interface:ProcessEngineServicesReturns the process engine'sHistoryService.- Specified by:
- getHistoryServicein interface- ProcessEngineServices
- Returns:
- the HistoryServiceobject.
 
- 
setHistoryService
- 
setHistoricDataService- Parameters:
- historicService- the historiy service instance
- See Also:
 
- 
getIdentityServiceDescription copied from interface:ProcessEngineServicesReturns the process engine'sIdentityService.- Specified by:
- getIdentityServicein interface- ProcessEngineServices
- Returns:
- the IdentityServiceobject.
 
- 
setIdentityService
- 
getManagementServiceDescription copied from interface:ProcessEngineServicesReturns the process engine'sManagementService.- Specified by:
- getManagementServicein interface- ProcessEngineServices
- Returns:
- the ManagementServiceobject.
 
- 
getAuthorizationServiceDescription copied from interface:ProcessEngineServicesReturns the process engine'sAuthorizationService.- Specified by:
- getAuthorizationServicein interface- ProcessEngineServices
- Returns:
- the AuthorizationServiceobject.
 
- 
setAuthorizationService
- 
getCaseServiceDescription copied from interface:ProcessEngineServicesReturns the engine'sCaseService.- Specified by:
- getCaseServicein interface- ProcessEngineServices
- Returns:
- the CaseServiceobject.
 
- 
setCaseService
- 
getFormServiceDescription copied from interface:ProcessEngineServicesReturns the process engine'sFormService.- Specified by:
- getFormServicein interface- ProcessEngineServices
- Returns:
- the FormServiceobject.
 
- 
setFormService
- 
setManagementService
- 
getFilterServiceDescription copied from interface:ProcessEngineServicesReturns the engine'sFilterService.- Specified by:
- getFilterServicein interface- ProcessEngineServices
- Returns:
- the FilterServiceobject.
 
- 
setFilterService
- 
getExternalTaskServiceDescription copied from interface:ProcessEngineServicesReturns the engine'sExternalTaskService.- Specified by:
- getExternalTaskServicein interface- ProcessEngineServices
- Returns:
- the ExternalTaskServiceobject.
 
- 
setExternalTaskService
- 
getDecisionServiceDescription copied from interface:ProcessEngineServicesReturns the engine'sDecisionService.- Specified by:
- getDecisionServicein interface- ProcessEngineServices
- Returns:
- the DecisionServiceobject.
 
- 
setDecisionService
- 
manageDeployment
 
-