Package org.activiti.engine.impl.test
Class AbstractActivitiTestCase
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- org.activiti.engine.impl.test.AbstractTestCase
-
- org.activiti.engine.impl.test.AbstractActivitiTestCase
-
- All Implemented Interfaces:
junit.framework.Test
- Direct Known Subclasses:
PluggableActivitiTestCase
,ResourceActivitiTestCase
public abstract class AbstractActivitiTestCase extends AbstractTestCase
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
deploymentIdFromDeploymentAnnotation
protected java.util.List<java.lang.String>
deploymentIdsForAutoCleanup
protected DynamicBpmnService
dynamicBpmnService
protected java.lang.Throwable
exception
protected HistoryService
historyService
protected ManagementService
managementService
protected ProcessEngine
processEngine
protected ProcessEngineConfigurationImpl
processEngineConfiguration
protected RepositoryService
repositoryService
protected RuntimeService
runtimeService
protected TaskService
taskService
-
Fields inherited from class org.activiti.engine.impl.test.AbstractTestCase
EMPTY_LINE, isEmptyLinesEnabled, log
-
-
Constructor Summary
Constructors Constructor Description AbstractActivitiTestCase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
assertAndEnsureCleanDb()
Each test is assumed to clean up all DB content it entered.protected void
assertHistoricActivitiesDeleteReason(ProcessInstance processInstance, java.lang.String expectedDeleteReason, java.lang.String... activityIds)
protected void
assertHistoricTasksDeleteReason(ProcessInstance processInstance, java.lang.String expectedDeleteReason, java.lang.String... taskNames)
void
assertProcessEnded(java.lang.String processInstanceId)
protected void
closeDownProcessEngine()
org.activiti.bpmn.model.BpmnModel
createOneTaskTestProcess()
Since the 'one task process' is used everywhere the actual process content doesn't matter, instead of copying around the BPMN 2.0 xml one could use this method which gives aBpmnModel
version of the same process back.org.activiti.bpmn.model.BpmnModel
createTwoTasksTestProcess()
java.lang.String
deployOneTaskTestProcess()
Creates and deploys the one task process.java.lang.String
deployTwoTasksTestProcess()
void
executeJobExecutorForTime(long maxMillisToWait, long intervalMillis)
protected abstract void
initializeProcessEngine()
protected void
initializeServices()
void
runBare()
protected void
setUp()
protected void
validateHistoryData()
void
waitForJobExecutorOnCondition(long maxMillisToWait, long intervalMillis, java.util.concurrent.Callable<java.lang.Boolean> condition)
void
waitForJobExecutorToProcessAllJobs(long maxMillisToWait, long intervalMillis)
void
waitForJobExecutorToProcessAllJobsAndExecutableTimerJobs(long maxMillisToWait, long intervalMillis)
-
Methods inherited from class org.activiti.engine.impl.test.AbstractTestCase
assertTextPresent, assertTextPresentIgnoreCase, runTest
-
Methods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, setName, tearDown, toString
-
-
-
-
Field Detail
-
processEngine
protected ProcessEngine processEngine
-
deploymentIdFromDeploymentAnnotation
protected java.lang.String deploymentIdFromDeploymentAnnotation
-
deploymentIdsForAutoCleanup
protected java.util.List<java.lang.String> deploymentIdsForAutoCleanup
-
exception
protected java.lang.Throwable exception
-
processEngineConfiguration
protected ProcessEngineConfigurationImpl processEngineConfiguration
-
repositoryService
protected RepositoryService repositoryService
-
runtimeService
protected RuntimeService runtimeService
-
taskService
protected TaskService taskService
-
historyService
protected HistoryService historyService
-
managementService
protected ManagementService managementService
-
dynamicBpmnService
protected DynamicBpmnService dynamicBpmnService
-
-
Method Detail
-
setUp
protected void setUp() throws java.lang.Exception
- Overrides:
setUp
in classjunit.framework.TestCase
- Throws:
java.lang.Exception
-
initializeProcessEngine
protected abstract void initializeProcessEngine()
-
closeDownProcessEngine
protected void closeDownProcessEngine()
-
runBare
public void runBare() throws java.lang.Throwable
- Overrides:
runBare
in classjunit.framework.TestCase
- Throws:
java.lang.Throwable
-
validateHistoryData
protected void validateHistoryData()
-
assertAndEnsureCleanDb
protected void assertAndEnsureCleanDb() throws java.lang.Throwable
Each test is assumed to clean up all DB content it entered. After a test method executed, this method scans all tables to see if the DB is completely clean. It throws AssertionFailed in case the DB is not clean. If the DB is not clean, it is cleaned by performing a create a drop.- Throws:
java.lang.Throwable
-
initializeServices
protected void initializeServices()
-
assertProcessEnded
public void assertProcessEnded(java.lang.String processInstanceId)
-
waitForJobExecutorToProcessAllJobs
public void waitForJobExecutorToProcessAllJobs(long maxMillisToWait, long intervalMillis)
-
waitForJobExecutorOnCondition
public void waitForJobExecutorOnCondition(long maxMillisToWait, long intervalMillis, java.util.concurrent.Callable<java.lang.Boolean> condition)
-
executeJobExecutorForTime
public void executeJobExecutorForTime(long maxMillisToWait, long intervalMillis)
-
waitForJobExecutorToProcessAllJobsAndExecutableTimerJobs
public void waitForJobExecutorToProcessAllJobsAndExecutableTimerJobs(long maxMillisToWait, long intervalMillis)
-
createOneTaskTestProcess
public org.activiti.bpmn.model.BpmnModel createOneTaskTestProcess()
Since the 'one task process' is used everywhere the actual process content doesn't matter, instead of copying around the BPMN 2.0 xml one could use this method which gives aBpmnModel
version of the same process back.
-
createTwoTasksTestProcess
public org.activiti.bpmn.model.BpmnModel createTwoTasksTestProcess()
-
deployOneTaskTestProcess
public java.lang.String deployOneTaskTestProcess()
Creates and deploys the one task process. SeecreateOneTaskTestProcess()
.- Returns:
- The process definition id (NOT the process definition key) of deployed one task process.
-
deployTwoTasksTestProcess
public java.lang.String deployTwoTasksTestProcess()
-
assertHistoricTasksDeleteReason
protected void assertHistoricTasksDeleteReason(ProcessInstance processInstance, java.lang.String expectedDeleteReason, java.lang.String... taskNames)
-
assertHistoricActivitiesDeleteReason
protected void assertHistoricActivitiesDeleteReason(ProcessInstance processInstance, java.lang.String expectedDeleteReason, java.lang.String... activityIds)
-
-