Package org.hibernate.testing.junit4
Class CustomParameterized
- java.lang.Object
-
- org.junit.runner.Runner
-
- org.junit.runners.ParentRunner<org.junit.runner.Runner>
-
- org.junit.runners.Suite
-
- org.hibernate.testing.junit4.CustomParameterized
-
- All Implemented Interfaces:
org.junit.runner.Describable,org.junit.runner.manipulation.Filterable,org.junit.runner.manipulation.Orderable,org.junit.runner.manipulation.Sortable
public class CustomParameterized extends org.junit.runners.SuiteAllows theCustomRunnerfeatures in parameterized tests. This is mostly copy-paste fromParameterizedsince the methods could not be overridden. The staticBeforeClassandAfterClassmethods will be executed only once before and after all tests (since these should prepare static members). Hibernate-specificBeforeClassOnceandAfterClassOncewill be executed before and after each set of tests with given parameters. Class can override the parameters list (annotated byParameterized.Parametersby defining static method of the same name in inheriting class (this works although usually static methods cannot override each other in Java). When there are multiple methods providing the parameters list, the used parameters list is a cross product of all the options, concatenating the argument list according toCustomParameterized.Ordervalues. Contrary toParameterized, non-static parameters methods are allowed, but the test class needs to have parameterless constructor, and therefore useParameterized.Parameterfor setting these parameters. This allow type-safe overriding of the method; note that only the base method needs theParameterized.Parametersannotation, overriding methods are invoked automatically.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCustomParameterized.Order
-
Constructor Summary
Constructors Constructor Description CustomParameterized(Class<?> klass)Only called reflectively.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<org.junit.runner.Runner>getChildren()-
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, classRules, collectInitializationErrors, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, isIgnored, order, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses, withInterruptIsolation
-
-
-
-
Method Detail
-
getChildren
protected List<org.junit.runner.Runner> getChildren()
- Overrides:
getChildrenin classorg.junit.runners.Suite
-
-