Class TestHelper

java.lang.Object
org.eximeebpms.bpm.engine.impl.test.TestHelper

public abstract class TestHelper extends Object
Author:
Tom Baeyens
  • Field Details Link icon

    • EMPTY_LINE Link icon

      public static final String EMPTY_LINE
      See Also:
    • TABLENAMES_EXCLUDED_FROM_DB_CLEAN_CHECK Link icon

      public static final List<String> TABLENAMES_EXCLUDED_FROM_DB_CLEAN_CHECK
    • RESOURCE_SUFFIXES Link icon

      public static final List<String> RESOURCE_SUFFIXES
  • Constructor Details Link icon

    • TestHelper Link icon

      public TestHelper()
  • Method Details Link icon

    • assertProcessEnded Link icon

      @Deprecated public static void assertProcessEnded(ProcessEngine processEngine, String processInstanceId)
      Deprecated.
      use ProcessEngineAssert instead.
    • annotationDeploymentSetUp Link icon

      public static String annotationDeploymentSetUp(ProcessEngine processEngine, Class<?> testClass, String methodName, Deployment deploymentAnnotation, Class<?>... parameterTypes)
    • annotationDeploymentSetUp Link icon

      public static String annotationDeploymentSetUp(ProcessEngine processEngine, String[] resources, Class<?> testClass, String methodName)
    • annotationDeploymentSetUp Link icon

      public static String annotationDeploymentSetUp(ProcessEngine processEngine, String[] resources, Class<?> testClass, boolean onMethod, String methodName)
    • annotationDeploymentSetUp Link icon

      public static String annotationDeploymentSetUp(ProcessEngine processEngine, Class<?> testClass, String methodName, Class<?>... parameterTypes)
    • annotationDeploymentTearDown Link icon

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

      public static void deleteDeployment(ProcessEngine processEngine, String deploymentId)
    • getBpmnProcessDefinitionResource Link icon

      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.
    • annotationRequiredHistoryLevelCheck Link icon

      public static boolean annotationRequiredHistoryLevelCheck(ProcessEngine processEngine, RequiredHistoryLevel annotation, Class<?> testClass, String methodName)
    • annotationRequiredHistoryLevelCheck Link icon

      public static boolean annotationRequiredHistoryLevelCheck(ProcessEngine processEngine, Class<?> testClass, String methodName, Class<?>... parameterTypes)
    • annotationRequiredDatabaseCheck Link icon

      public static boolean annotationRequiredDatabaseCheck(ProcessEngine processEngine, RequiredDatabase annotation, Class<?> testClass, String methodName, Class<?>... parameterTypes)
    • annotationRequiredDatabaseCheck Link icon

      public static boolean annotationRequiredDatabaseCheck(ProcessEngine processEngine, Class<?> testClass, String methodName, Class<?>... parameterTypes)
    • getMethod Link icon

      protected static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) throws SecurityException, NoSuchMethodException
      Throws:
      SecurityException
      NoSuchMethodException
    • assertAndEnsureCleanDbAndCache Link icon

      public static void assertAndEnsureCleanDbAndCache(ProcessEngine processEngine)
      Ensures that the deployment cache and database is clean after a test. If not the cache and database will be cleared.
      Parameters:
      processEngine - the ProcessEngine to test
      Throws:
      AssertionError - if the deployment cache or database was not clean
    • assertAndEnsureCleanDbAndCache Link icon

      public static String assertAndEnsureCleanDbAndCache(ProcessEngine processEngine, boolean fail)
      Ensures that the deployment cache and database is clean after a test. If not the cache and database will be cleared.
      Parameters:
      processEngine - the ProcessEngine to test
      fail - if true the method will throw an AssertionError if the deployment cache or database is not clean
      Throws:
      AssertionError - if the deployment cache or database was not clean
    • fail Link icon

      protected static void fail(String message)
    • assertAndEnsureCleanDeploymentCache Link icon

      public static void assertAndEnsureCleanDeploymentCache(ProcessEngine processEngine)
      Ensures that the deployment cache is empty after a test. If not the cache will be cleared.
      Parameters:
      processEngine - the ProcessEngine to test
      Throws:
      AssertionError - if the deployment cache was not clean
    • assertAndEnsureCleanDeploymentCache Link icon

      public static String assertAndEnsureCleanDeploymentCache(ProcessEngine processEngine, boolean fail)
      Ensures that the deployment cache is empty after a test. If not the cache will be cleared.
      Parameters:
      processEngine - the ProcessEngine to test
      fail - if true the method will throw an AssertionError if 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 Link icon

      public static String assertAndEnsureNoProcessApplicationsRegistered(ProcessEngine processEngine)
    • waitForJobExecutorToProcessAllJobs Link icon

      public static void waitForJobExecutorToProcessAllJobs(ProcessEngineConfigurationImpl processEngineConfiguration, long maxMillisToWait, long intervalMillis)
    • areJobsAvailable Link icon

      public static boolean areJobsAvailable(ProcessEngineConfigurationImpl processEngineConfiguration)
    • resetIdGenerator Link icon

      public static void resetIdGenerator(ProcessEngineConfigurationImpl processEngineConfiguration)
    • getProcessEngine Link icon

      public static ProcessEngine getProcessEngine(String configurationResource)
    • closeProcessEngines Link icon

      public static void closeProcessEngines()
    • createSchema Link icon

      public static void createSchema(ProcessEngineConfigurationImpl processEngineConfiguration)
    • dropSchema Link icon

      public static void dropSchema(ProcessEngineConfigurationImpl processEngineConfiguration)
    • createOrUpdateHistoryLevel Link icon

      public static void createOrUpdateHistoryLevel(ProcessEngineConfigurationImpl processEngineConfiguration)
    • deleteHistoryLevel Link icon

      public static void deleteHistoryLevel(ProcessEngineConfigurationImpl processEngineConfiguration)
    • clearUserOperationLog Link icon

      public static void clearUserOperationLog(ProcessEngineConfigurationImpl processEngineConfiguration)
    • deleteInstallationId Link icon

      public static void deleteInstallationId(ProcessEngineConfigurationImpl processEngineConfiguration)
    • defaultManualActivation Link icon

      public static Object defaultManualActivation()