Package org.hibernate.testing.junit4
Class Helper
- java.lang.Object
-
- org.hibernate.testing.junit4.Helper
-
public final class Helper extends java.lang.ObjectCentralized utility functionality
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringVALIDATE_FAILURE_EXPECTED
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <S extends java.lang.annotation.Annotation,P extends java.lang.annotation.Annotation>
java.util.List<S>collectAnnotations(java.lang.Class<S> singularAnnotationClass, java.lang.Class<P> pluralAnnotationClass, org.junit.runners.model.FrameworkMethod frameworkMethod, org.junit.runners.model.TestClass testClass)static voidcreateH2Schema(java.lang.String schemaName, java.util.Map settings)Create additional H2 schema.static voidcreateH2Schema(java.lang.String schemaName, org.hibernate.cfg.Configuration cfg)static java.lang.StringextractIgnoreMessage(FailureExpected failureExpected, org.junit.runners.model.FrameworkMethod frameworkMethod)static java.lang.StringextractMessage(FailureExpected failureExpected)static java.lang.StringextractMethodName(java.lang.reflect.Method method)Extract a nice method name representation for displaystatic java.lang.StringextractTestName(org.junit.runners.model.FrameworkMethod frameworkMethod)Extract a nice test name representation for displaystatic booleanisNotEmpty(java.lang.String string)Standard string content checking.static <T extends java.lang.annotation.Annotation>
TlocateAnnotation(java.lang.Class<T> annotationClass, org.junit.runners.model.FrameworkMethod frameworkMethod, org.junit.runners.model.TestClass testClass)
-
-
-
Field Detail
-
VALIDATE_FAILURE_EXPECTED
public static final java.lang.String VALIDATE_FAILURE_EXPECTED
- See Also:
- Constant Field Values
-
-
Method Detail
-
isNotEmpty
public static boolean isNotEmpty(java.lang.String string)
Standard string content checking.- Parameters:
string- The string to check- Returns:
- Are its content empty or the reference null?
-
extractTestName
public static java.lang.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 java.lang.String extractMethodName(java.lang.reflect.Method method)
Extract a nice method name representation for display- Parameters:
method- The method.- Returns:
- The display representation
-
locateAnnotation
public static <T extends java.lang.annotation.Annotation> T locateAnnotation(java.lang.Class<T> annotationClass, org.junit.runners.model.FrameworkMethod frameworkMethod, org.junit.runners.model.TestClass testClass)
-
collectAnnotations
public static <S extends java.lang.annotation.Annotation,P extends java.lang.annotation.Annotation> java.util.List<S> collectAnnotations(java.lang.Class<S> singularAnnotationClass, java.lang.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.
-
extractMessage
public static java.lang.String extractMessage(FailureExpected failureExpected)
-
extractIgnoreMessage
public static java.lang.String extractIgnoreMessage(FailureExpected failureExpected, org.junit.runners.model.FrameworkMethod frameworkMethod)
-
createH2Schema
public static void createH2Schema(java.lang.String schemaName, org.hibernate.cfg.Configuration cfg)- See Also:
createH2Schema(String, Map)
-
createH2Schema
public static void createH2Schema(java.lang.String schemaName, java.util.Map settings)Create additional H2 schema.- Parameters:
schemaName- New schema name.settings- Current settings.
-
-