Class BlockJUnit4ClassRunnerWithParameters

    • Field Detail

      • parameters

        private final java.lang.Object[] parameters
      • name

        private final java.lang.String name
    • Method Detail

      • createTest

        public java.lang.Object createTest()
                                    throws java.lang.Exception
        Description copied from class: BlockJUnit4ClassRunner
        Returns a new fixture for running a test. Default implementation executes the test class's no-argument constructor (validation should have ensured one exists).
        Overrides:
        createTest in class BlockJUnit4ClassRunner
        Throws:
        java.lang.Exception
      • createTestUsingConstructorInjection

        private java.lang.Object createTestUsingConstructorInjection()
                                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createTestUsingFieldInjection

        private java.lang.Object createTestUsingFieldInjection()
                                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • validateConstructor

        protected void validateConstructor​(java.util.List<java.lang.Throwable> errors)
        Description copied from class: BlockJUnit4ClassRunner
        Adds to errors if the test class has more than one constructor, or if the constructor takes parameters. Override if a subclass requires different validation rules.
        Overrides:
        validateConstructor in class BlockJUnit4ClassRunner
      • classBlock

        protected Statement classBlock​(RunNotifier notifier)
        Description copied from class: ParentRunner
        Constructs a Statement to run all of the tests in the test class. Override to add pre-/post-processing. Here is an outline of the implementation:
        1. Determine the children to be run using ParentRunner.getChildren() (subject to any imposed filter and sort).
        2. If there are any children remaining after filtering and ignoring, construct a statement that will:
          1. Apply all ClassRules on the test-class and superclasses.
          2. Run all non-overridden @BeforeClass methods on the test-class and superclasses; if any throws an Exception, stop execution and pass the exception on.
          3. Run all remaining tests on the test-class.
          4. Run all non-overridden @AfterClass methods on the test-class and superclasses: exceptions thrown by previous steps are combined, if necessary, with exceptions from AfterClass methods into a MultipleFailureException.
        Overrides:
        classBlock in class ParentRunner<FrameworkMethod>
        Returns:
        Statement
      • getRunnerAnnotations

        protected java.lang.annotation.Annotation[] getRunnerAnnotations()
        Overrides:
        getRunnerAnnotations in class ParentRunner<FrameworkMethod>
        Returns:
        the annotations that should be attached to this runner's description.
      • getAnnotatedFieldsByParameter

        private java.util.List<FrameworkField> getAnnotatedFieldsByParameter()
      • fieldsAreAnnotated

        private boolean fieldsAreAnnotated()