Class TestHelper


  • public abstract class TestHelper
    extends java.lang.Object
    • Field Detail

      • TABLENAMES_EXCLUDED_FROM_DB_CLEAN_CHECK

        public static final java.util.List<java.lang.String> TABLENAMES_EXCLUDED_FROM_DB_CLEAN_CHECK
    • Constructor Detail

      • TestHelper

        public TestHelper()
    • Method Detail

      • assertProcessEnded

        public static void assertProcessEnded​(ProcessEngine processEngine,
                                              java.lang.String processInstanceId)
      • annotationDeploymentSetUp

        public static java.lang.String annotationDeploymentSetUp​(ProcessEngine processEngine,
                                                                 java.lang.Class<?> testClass,
                                                                 java.lang.String methodName)
      • annotationDeploymentTearDown

        public static void annotationDeploymentTearDown​(ProcessEngine processEngine,
                                                        java.lang.String deploymentId,
                                                        java.lang.Class<?> testClass,
                                                        java.lang.String methodName)
      • annotationMockSupportSetup

        public static void annotationMockSupportSetup​(java.lang.Class<?> testClass,
                                                      java.lang.String methodName,
                                                      ActivitiMockSupport mockSupport)
      • handleMockServiceTaskAnnotation

        protected static void handleMockServiceTaskAnnotation​(ActivitiMockSupport mockSupport,
                                                              java.lang.reflect.Method method)
      • handleMockServiceTasksAnnotation

        protected static void handleMockServiceTasksAnnotation​(ActivitiMockSupport mockSupport,
                                                               java.lang.reflect.Method method)
      • handleNoOpServiceTasksAnnotation

        protected static void handleNoOpServiceTasksAnnotation​(ActivitiMockSupport mockSupport,
                                                               java.lang.reflect.Method method)
      • annotationMockSupportTeardown

        public static void annotationMockSupportTeardown​(ActivitiMockSupport mockSupport)
      • getBpmnProcessDefinitionResource

        public static java.lang.String getBpmnProcessDefinitionResource​(java.lang.Class<?> type,
                                                                        java.lang.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.
      • getProcessEngine

        public static ProcessEngine getProcessEngine​(java.lang.String configurationResource)
      • closeProcessEngines

        public static void closeProcessEngines()
      • 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.