org.camunda.bpm.engine.impl.test
Class TestHelper

java.lang.Object
  extended by org.camunda.bpm.engine.impl.test.TestHelper

public abstract class TestHelper
extends Object

Author:
Tom Baeyens

Field Summary
static String EMPTY_LINE
           
static List<String> RESOURCE_SUFFIXES
           
static List<String> TABLENAMES_EXCLUDED_FROM_DB_CLEAN_CHECK
           
 
Constructor Summary
TestHelper()
           
 
Method Summary
static String annotationDeploymentSetUp(ProcessEngine processEngine, Class<?> testClass, String methodName)
           
static String annotationDeploymentSetUp(ProcessEngine processEngine, Class<?> testClass, String methodName, Deployment deploymentAnnotation)
           
static void annotationDeploymentTearDown(ProcessEngine processEngine, String deploymentId, Class<?> testClass, String methodName)
           
static boolean areJobsAvailable(ProcessEngineConfigurationImpl processEngineConfiguration)
           
static void assertAndEnsureCleanDb(ProcessEngine processEngine)
          Each test is assumed to clean up all DB content it entered.
static void assertProcessEnded(ProcessEngine processEngine, String processInstanceId)
          Deprecated. 
static void clearOpLog(ProcessEngineConfigurationImpl processEngineConfiguration)
          Required when user operations are logged that are not directly associated with a single deployment (e.g.
static void closeProcessEngines()
           
static void createOrUpdateHistoryLevel(ProcessEngineConfigurationImpl processEngineConfiguration)
           
static void createSchema(ProcessEngineConfigurationImpl processEngineConfiguration)
           
static void deleteHistoryLevel(ProcessEngineConfigurationImpl processEngineConfiguration)
           
static void dropSchema(ProcessEngineConfigurationImpl processEngineConfiguration)
           
static String getBpmnProcessDefinitionResource(Class<?> type, String name)
          get a resource location by convention based on a class (type) and a relative resource name.
static ProcessEngine getProcessEngine(String configurationResource)
           
static void waitForJobExecutorToProcessAllJobs(ProcessEngineConfigurationImpl processEngineConfiguration, long maxMillisToWait, long intervalMillis)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_LINE

public static final String EMPTY_LINE
See Also:
Constant Field Values

TABLENAMES_EXCLUDED_FROM_DB_CLEAN_CHECK

public static final List<String> TABLENAMES_EXCLUDED_FROM_DB_CLEAN_CHECK

RESOURCE_SUFFIXES

public static final List<String> RESOURCE_SUFFIXES
Constructor Detail

TestHelper

public TestHelper()
Method Detail

assertProcessEnded

@Deprecated
public static void assertProcessEnded(ProcessEngine processEngine,
                                                 String processInstanceId)
Deprecated. 

use ProcessEngineAssert instead.


annotationDeploymentSetUp

public static String annotationDeploymentSetUp(ProcessEngine processEngine,
                                               Class<?> testClass,
                                               String methodName,
                                               Deployment deploymentAnnotation)

annotationDeploymentSetUp

public static String annotationDeploymentSetUp(ProcessEngine processEngine,
                                               Class<?> testClass,
                                               String methodName)

annotationDeploymentTearDown

public static void annotationDeploymentTearDown(ProcessEngine processEngine,
                                                String deploymentId,
                                                Class<?> testClass,
                                                String methodName)

getBpmnProcessDefinitionResource

public static String getBpmnProcessDefinitionResource(Class<?> type,
                                                      String name)
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.


assertAndEnsureCleanDb

public static void assertAndEnsureCleanDb(ProcessEngine processEngine)
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.


waitForJobExecutorToProcessAllJobs

public static void waitForJobExecutorToProcessAllJobs(ProcessEngineConfigurationImpl processEngineConfiguration,
                                                      long maxMillisToWait,
                                                      long intervalMillis)

areJobsAvailable

public static boolean areJobsAvailable(ProcessEngineConfigurationImpl processEngineConfiguration)

getProcessEngine

public static ProcessEngine getProcessEngine(String configurationResource)

closeProcessEngines

public static void closeProcessEngines()

createSchema

public static void createSchema(ProcessEngineConfigurationImpl processEngineConfiguration)

dropSchema

public static void dropSchema(ProcessEngineConfigurationImpl processEngineConfiguration)

createOrUpdateHistoryLevel

public static void createOrUpdateHistoryLevel(ProcessEngineConfigurationImpl processEngineConfiguration)

deleteHistoryLevel

public static void deleteHistoryLevel(ProcessEngineConfigurationImpl processEngineConfiguration)

clearOpLog

public static void clearOpLog(ProcessEngineConfigurationImpl processEngineConfiguration)
Required when user operations are logged that are not directly associated with a single deployment (e.g. runtimeService.suspendProcessDefinitionByKey(..) with cascade to process instances) and therefore cannot be cleaned up automatically during undeployment.



Copyright © 2015 camunda services GmbH. All rights reserved.