Class 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.Suite
    Allows the CustomRunner features in parameterized tests. This is mostly copy-paste from Parameterized since the methods could not be overridden. The static BeforeClass and AfterClass methods will be executed only once before and after all tests (since these should prepare static members). Hibernate-specific BeforeClassOnce and AfterClassOnce will be executed before and after each set of tests with given parameters. Class can override the parameters list (annotated by Parameterized.Parameters by 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 to CustomParameterized.Order values. Contrary to Parameterized, non-static parameters methods are allowed, but the test class needs to have parameterless constructor, and therefore use Parameterized.Parameter for setting these parameters. This allow type-safe overriding of the method; note that only the base method needs the Parameterized.Parameters annotation, overriding methods are invoked automatically.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  CustomParameterized.Order  
      • Nested classes/interfaces inherited from class org.junit.runners.Suite

        org.junit.runners.Suite.SuiteClasses
    • Constructor Summary

      Constructors 
      Constructor Description
      CustomParameterized​(java.lang.Class<?> klass)
      Only called reflectively.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.util.List<org.junit.runner.Runner> getChildren()  
      • Methods inherited from class org.junit.runners.Suite

        describeChild, emptySuite, runChild
      • 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
      • Methods inherited from class org.junit.runner.Runner

        testCount
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CustomParameterized

        public CustomParameterized​(java.lang.Class<?> klass)
                            throws java.lang.Throwable
        Only called reflectively. Do not use programmatically.
        Throws:
        java.lang.Throwable
    • Method Detail

      • getChildren

        protected java.util.List<org.junit.runner.Runner> getChildren()
        Overrides:
        getChildren in class org.junit.runners.Suite