Class Helper


  • public final class Helper
    extends Object
    Centralized utility functionality
    • Method Detail

      • isNotEmpty

        public static boolean isNotEmpty​(String string)
        Standard string content checking.
        Parameters:
        string - The string to check
        Returns:
        Are its content empty or the reference null?
      • extractTestName

        public static String extractTestName​(org.junit.runners.model.FrameworkMethod frameworkMethod)
        Extract a nice test name representation for display
        Parameters:
        frameworkMethod - The test method.
        Returns:
        The display representation
      • extractMethodName

        public static String extractMethodName​(Method method)
        Extract a nice method name representation for display
        Parameters:
        method - The method.
        Returns:
        The display representation
      • locateAnnotation

        public static <T extends Annotation> T locateAnnotation​(Class<T> annotationClass,
                                                                org.junit.runners.model.FrameworkMethod frameworkMethod,
                                                                org.junit.runners.model.TestClass testClass)
      • collectAnnotations

        public static <S extends Annotation,​P extends AnnotationList<S> collectAnnotations​(Class<S> singularAnnotationClass,
                                                                                                   Class<P> pluralAnnotationClass,
                                                                                                   org.junit.runners.model.FrameworkMethod frameworkMethod,
                                                                                                   org.junit.runners.model.TestClass testClass)
        Type Parameters:
        S - Singular annotation type.
        P - Plural annotation type.
        Parameters:
        singularAnnotationClass - Singular annotation class (e.g. SkipForDialect).
        pluralAnnotationClass - Plural annotation class (e.g. SkipForDialects), assuming that the only declared method is an array of singular annotations.
        frameworkMethod - Test method.
        testClass - Test class.
        Returns:
        Collection of all singular annotations or an empty list.
      • extractIgnoreMessage

        public static String extractIgnoreMessage​(FailureExpected failureExpected,
                                                  org.junit.runners.model.FrameworkMethod frameworkMethod)
      • createH2Schema

        public static void createH2Schema​(String schemaName,
                                          Map settings)
        Create additional H2 schema.
        Parameters:
        schemaName - New schema name.
        settings - Current settings.