Package org.camunda.bpm.engine.impl.test
Class TestHelper
java.lang.Object
org.camunda.bpm.engine.impl.test.TestHelper
- Author:
- Tom Baeyens
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringannotationDeploymentSetUp(ProcessEngine processEngine, Class<?> testClass, String methodName, Class<?>... parameterTypes) static StringannotationDeploymentSetUp(ProcessEngine processEngine, Class<?> testClass, String methodName, Deployment deploymentAnnotation, Class<?>... parameterTypes) static StringannotationDeploymentSetUp(ProcessEngine processEngine, String[] resources, Class<?> testClass, boolean onMethod, String methodName) static StringannotationDeploymentSetUp(ProcessEngine processEngine, String[] resources, Class<?> testClass, String methodName) static voidannotationDeploymentTearDown(ProcessEngine processEngine, String deploymentId, Class<?> testClass, String methodName) static booleanannotationRequiredDatabaseCheck(ProcessEngine processEngine, Class<?> testClass, String methodName, Class<?>... parameterTypes) static booleanannotationRequiredDatabaseCheck(ProcessEngine processEngine, RequiredDatabase annotation, Class<?> testClass, String methodName, Class<?>... parameterTypes) static booleanannotationRequiredHistoryLevelCheck(ProcessEngine processEngine, Class<?> testClass, String methodName, Class<?>... parameterTypes) static booleanannotationRequiredHistoryLevelCheck(ProcessEngine processEngine, RequiredHistoryLevel annotation, Class<?> testClass, String methodName) static booleanareJobsAvailable(ProcessEngineConfigurationImpl processEngineConfiguration) static voidassertAndEnsureCleanDbAndCache(ProcessEngine processEngine) Ensures that the deployment cache and database is clean after a test.static StringassertAndEnsureCleanDbAndCache(ProcessEngine processEngine, boolean fail) Ensures that the deployment cache and database is clean after a test.static voidassertAndEnsureCleanDeploymentCache(ProcessEngine processEngine) Ensures that the deployment cache is empty after a test.static StringassertAndEnsureCleanDeploymentCache(ProcessEngine processEngine, boolean fail) Ensures that the deployment cache is empty after a test.static StringassertAndEnsureNoProcessApplicationsRegistered(ProcessEngine processEngine) static voidassertProcessEnded(ProcessEngine processEngine, String processInstanceId) Deprecated.static voidclearUserOperationLog(ProcessEngineConfigurationImpl processEngineConfiguration) static voidstatic voidcreateOrUpdateHistoryLevel(ProcessEngineConfigurationImpl processEngineConfiguration) static voidcreateSchema(ProcessEngineConfigurationImpl processEngineConfiguration) static Objectstatic voiddeleteDeployment(ProcessEngine processEngine, String deploymentId) static voiddeleteHistoryLevel(ProcessEngineConfigurationImpl processEngineConfiguration) static voiddeleteInstallationId(ProcessEngineConfigurationImpl processEngineConfiguration) static voiddropSchema(ProcessEngineConfigurationImpl processEngineConfiguration) protected static voidstatic StringgetBpmnProcessDefinitionResource(Class<?> type, String name) get a resource location by convention based on a class (type) and a relative resource name.protected static Methodstatic ProcessEnginegetProcessEngine(String configurationResource) static voidresetIdGenerator(ProcessEngineConfigurationImpl processEngineConfiguration) static voidwaitForJobExecutorToProcessAllJobs(ProcessEngineConfigurationImpl processEngineConfiguration, long maxMillisToWait, long intervalMillis)
-
Field Details
-
EMPTY_LINE
- See Also:
-
TABLENAMES_EXCLUDED_FROM_DB_CLEAN_CHECK
-
RESOURCE_SUFFIXES
-
-
Constructor Details
-
TestHelper
public TestHelper()
-
-
Method Details
-
assertProcessEnded
@Deprecated public static void assertProcessEnded(ProcessEngine processEngine, String processInstanceId) Deprecated.useProcessEngineAssertinstead. -
annotationDeploymentSetUp
public static String annotationDeploymentSetUp(ProcessEngine processEngine, Class<?> testClass, String methodName, Deployment deploymentAnnotation, Class<?>... parameterTypes) -
annotationDeploymentSetUp
public static String annotationDeploymentSetUp(ProcessEngine processEngine, String[] resources, Class<?> testClass, String methodName) -
annotationDeploymentSetUp
public static String annotationDeploymentSetUp(ProcessEngine processEngine, String[] resources, Class<?> testClass, boolean onMethod, String methodName) -
annotationDeploymentSetUp
public static String annotationDeploymentSetUp(ProcessEngine processEngine, Class<?> testClass, String methodName, Class<?>... parameterTypes) -
annotationDeploymentTearDown
public static void annotationDeploymentTearDown(ProcessEngine processEngine, String deploymentId, Class<?> testClass, String methodName) -
deleteDeployment
-
getBpmnProcessDefinitionResource
get a resource location by convention based on a class (type) and a relative resource name. The return value will be the full classpath location of the type, plus a suffix built from the name parameter:BpmnDeployer.BPMN_RESOURCE_SUFFIXES. The first resource matching a suffix will be returned. -
annotationRequiredHistoryLevelCheck
public static boolean annotationRequiredHistoryLevelCheck(ProcessEngine processEngine, RequiredHistoryLevel annotation, Class<?> testClass, String methodName) -
annotationRequiredHistoryLevelCheck
public static boolean annotationRequiredHistoryLevelCheck(ProcessEngine processEngine, Class<?> testClass, String methodName, Class<?>... parameterTypes) -
annotationRequiredDatabaseCheck
public static boolean annotationRequiredDatabaseCheck(ProcessEngine processEngine, RequiredDatabase annotation, Class<?> testClass, String methodName, Class<?>... parameterTypes) -
annotationRequiredDatabaseCheck
public static boolean annotationRequiredDatabaseCheck(ProcessEngine processEngine, Class<?> testClass, String methodName, Class<?>... parameterTypes) -
getMethod
protected static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) throws SecurityException, NoSuchMethodException -
assertAndEnsureCleanDbAndCache
Ensures that the deployment cache and database is clean after a test. If not the cache and database will be cleared.- Parameters:
processEngine- theProcessEngineto test- Throws:
AssertionError- if the deployment cache or database was not clean
-
assertAndEnsureCleanDbAndCache
Ensures that the deployment cache and database is clean after a test. If not the cache and database will be cleared.- Parameters:
processEngine- theProcessEngineto testfail- if true the method will throw anAssertionErrorif the deployment cache or database is not clean- Throws:
AssertionError- if the deployment cache or database was not clean
-
fail
-
assertAndEnsureCleanDeploymentCache
Ensures that the deployment cache is empty after a test. If not the cache will be cleared.- Parameters:
processEngine- theProcessEngineto test- Throws:
AssertionError- if the deployment cache was not clean
-
assertAndEnsureCleanDeploymentCache
Ensures that the deployment cache is empty after a test. If not the cache will be cleared.- Parameters:
processEngine- theProcessEngineto testfail- if true the method will throw anAssertionErrorif the deployment cache is not clean- Returns:
- the deployment cache summary if fail is set to false or null if deployment cache was clean
- Throws:
AssertionError- if the deployment cache was not clean and fail is set to true
-
assertAndEnsureNoProcessApplicationsRegistered
-
waitForJobExecutorToProcessAllJobs
public static void waitForJobExecutorToProcessAllJobs(ProcessEngineConfigurationImpl processEngineConfiguration, long maxMillisToWait, long intervalMillis) -
areJobsAvailable
-
resetIdGenerator
-
getProcessEngine
-
closeProcessEngines
public static void closeProcessEngines() -
createSchema
-
dropSchema
-
createOrUpdateHistoryLevel
public static void createOrUpdateHistoryLevel(ProcessEngineConfigurationImpl processEngineConfiguration) -
deleteHistoryLevel
-
clearUserOperationLog
-
deleteInstallationId
-
defaultManualActivation
-