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.StringdeploymentIdFromDeploymentAnnotationprotected java.util.List<java.lang.String>deploymentIdsForAutoCleanupprotected DynamicBpmnServicedynamicBpmnServiceprotected java.lang.Throwableexceptionprotected HistoryServicehistoryServiceprotected ManagementServicemanagementServiceprotected ProcessEngineprocessEngineprotected ProcessEngineConfigurationImplprocessEngineConfigurationprotected RepositoryServicerepositoryServiceprotected RuntimeServiceruntimeServiceprotected TaskServicetaskService-
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 voidassertAndEnsureCleanDb()Each test is assumed to clean up all DB content it entered.protected voidassertHistoricActivitiesDeleteReason(ProcessInstance processInstance, java.lang.String expectedDeleteReason, java.lang.String... activityIds)protected voidassertHistoricTasksDeleteReason(ProcessInstance processInstance, java.lang.String expectedDeleteReason, java.lang.String... taskNames)voidassertProcessEnded(java.lang.String processInstanceId)protected voidcloseDownProcessEngine()org.activiti.bpmn.model.BpmnModelcreateOneTaskTestProcess()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 aBpmnModelversion of the same process back.org.activiti.bpmn.model.BpmnModelcreateTwoTasksTestProcess()java.lang.StringdeployOneTaskTestProcess()Creates and deploys the one task process.java.lang.StringdeployTwoTasksTestProcess()voidexecuteJobExecutorForTime(long maxMillisToWait, long intervalMillis)protected abstract voidinitializeProcessEngine()protected voidinitializeServices()voidrunBare()protected voidsetUp()protected voidvalidateHistoryData()voidwaitForJobExecutorOnCondition(long maxMillisToWait, long intervalMillis, java.util.concurrent.Callable<java.lang.Boolean> condition)voidwaitForJobExecutorToProcessAllJobs(long maxMillisToWait, long intervalMillis)voidwaitForJobExecutorToProcessAllJobsAndExecutableTimerJobs(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:
setUpin 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:
runBarein classjunit.framework.TestCase- Throws:
java.lang.Throwable
-
validateHistoryData
protected void validateHistoryData()
-
assertAndEnsureCleanDb
protected void assertAndEnsureCleanDb() throws java.lang.ThrowableEach 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 aBpmnModelversion 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)
-
-