Class DmnTestHelper


  • public abstract class DmnTestHelper
    extends Object
    Author:
    Tijs Rademakers, Joram Barrez
    • Constructor Detail

      • DmnTestHelper

        public DmnTestHelper()
    • Method Detail

      • annotationDeploymentSetUp

        public static String annotationDeploymentSetUp​(DmnEngine dmnEngine,
                                                       Class<?> testClass,
                                                       String methodName)
      • annotationDeploymentTearDown

        public static void annotationDeploymentTearDown​(DmnEngine dmnEngine,
                                                        String deploymentId,
                                                        Class<?> testClass,
                                                        String methodName)
      • getDmnDecisionResource

        public static String getDmnDecisionResource​(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: DmnDeployer.DMN_RESOURCE_SUFFIXES. The first resource matching a suffix will be returned.
      • getDmnEngine

        public static DmnEngine getDmnEngine​(String configurationResource)
      • closeDmnEngines

        public static void closeDmnEngines()
      • assertAndEnsureCleanDb

        public static void assertAndEnsureCleanDb​(DmnEngine dmnEngine)
        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.