All Downloads are FREE. Search and download functionalities are using the official Maven repository.

public.javadoc.org.spincast.testing.junitrunner.SpincastJUnitRunner.html Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version






SpincastJUnitRunner (org.spincast:spincast-framework 1.0.0 API)












org.spincast.testing.junitrunner

Class SpincastJUnitRunner

  • java.lang.Object
    • org.junit.runner.Runner
      • org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
        • org.junit.runners.BlockJUnit4ClassRunner
          • org.spincast.testing.junitrunner.SpincastJUnitRunner
  • All Implemented Interfaces:
    org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable


    public class SpincastJUnitRunner
    extends org.junit.runners.BlockJUnit4ClassRunner
    Spincast JUnit Runner.

    Only creates one instance of the test class for all the tests.

    If the class is annotated with BeforeAfterClassMethodsProvider, then a beforeClass() and afterClass() methods will be called.

    You can use the ExpectingBeforeClassException annotation on the test class to indicate that an exception is expected from the beforeClass() method.

    If you try to debug a test that only fails sometimes (those are the worst!), you can use the Repeat annotation on the test or on its test class. This allows you to run the test or the whole test class multiple times.

    • Field Detail

      • logger

        protected final org.slf4j.Logger logger
      • SPINCAST_TEST_NAME_BEFORE_CLASS_ANNOTATIONS_VALIDATION

        public static final String SPINCAST_TEST_NAME_BEFORE_CLASS_ANNOTATIONS_VALIDATION
        See Also:
        Constant Field Values
      • SPINCAST_TEST_NAME_AFTER_CLASS_ANNOTATIONS_VALIDATION

        public static final String SPINCAST_TEST_NAME_AFTER_CLASS_ANNOTATIONS_VALIDATION
        See Also:
        Constant Field Values
      • SPINCAST_TEST_NAME_BEFORE_CLASS_METHOD_VALIDATION

        public static final String SPINCAST_TEST_NAME_BEFORE_CLASS_METHOD_VALIDATION
        See Also:
        Constant Field Values
      • SPINCAST_TEST_NAME_AFTER_CLASS_METHOD_VALIDATION

        public static final String SPINCAST_TEST_NAME_AFTER_CLASS_METHOD_VALIDATION
        See Also:
        Constant Field Values
      • SPINCAST_TEST_NAME_NO_TESTS_AND_NO_EXPECTION_EXCEPTION_ANNOTATION

        public static final String SPINCAST_TEST_NAME_NO_TESTS_AND_NO_EXPECTION_EXCEPTION_ANNOTATION
      • SPINCAST_TEST_NAME_AFTER_CLASS_LOOPS_EXCEPTION

        public static final String SPINCAST_TEST_NAME_AFTER_CLASS_LOOPS_EXCEPTION
        See Also:
        Constant Field Values
    • Constructor Detail

      • SpincastJUnitRunner

        public SpincastJUnitRunner(Class<?> klass)
                            throws org.junit.runners.model.InitializationError
        Throws:
        org.junit.runners.model.InitializationError
    • Method Detail

      • getRunNotifier

        protected org.junit.runner.notification.RunNotifier getRunNotifier()
      • setIgnoreRemainingTests

        protected void setIgnoreRemainingTests()
      • isIgnoreRemainingTests

        protected boolean isIgnoreRemainingTests()
      • setExceptionInBeforeClass

        protected void setExceptionInBeforeClass()
      • isExceptionInBeforeClass

        protected boolean isExceptionInBeforeClass()
      • getCurrentClassLoopPosition

        protected int getCurrentClassLoopPosition()
      • setCurrentClassLoopPosition

        protected void setCurrentClassLoopPosition(int currentClassLoopPosition)
      • createTest

        public Object createTest()
                          throws Exception
        JUnit calls that method to create an instance of the test class for each individual test. We change this behavior and always return the *same* instance of the test class: 'testClassInstance'.
        Overrides:
        createTest in class org.junit.runners.BlockJUnit4ClassRunner
        Throws:
        Exception
      • getTestClassInstance

        protected Object getTestClassInstance()
      • getName

        protected String getName()
        Test class display name.
        Overrides:
        getName in class org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
      • computeTestMethods

        protected final List<org.junit.runners.model.FrameworkMethod> computeTestMethods()
        Overrides:
        computeTestMethods in class org.junit.runners.BlockJUnit4ClassRunner
      • run

        public void run(org.junit.runner.notification.RunNotifier notifier)
        Runs the test class.
        Overrides:
        run in class org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
      • runChild

        protected void runChild(org.junit.runners.model.FrameworkMethod method,
                                org.junit.runner.notification.RunNotifier notifier)
        Runs a specific test
        Overrides:
        runChild in class org.junit.runners.BlockJUnit4ClassRunner
      • addTestFailureListener

        protected void addTestFailureListener(org.junit.runner.notification.RunNotifier notifier)
      • logTestFailure

        protected void logTestFailure(org.junit.runner.notification.Failure failure)
      • runPreClassLoopsSpincastTests

        protected void runPreClassLoopsSpincastTests()
      • validateNoBeforeClassAnnotations

        protected void validateNoBeforeClassAnnotations()
      • validateNoAfterClassAnnotations

        protected void validateNoAfterClassAnnotations()
      • validateNoTestsAndNoExpectingBeforeClassExceptionAnnotation

        protected void validateNoTestsAndNoExpectingBeforeClassExceptionAnnotation()
      • spincastTestError

        protected void spincastTestError(String testName,
                                         String errorMessage)
      • spincastTestError

        protected void spincastTestError(String testName,
                                         Throwable exception)
      • isExpectingBeforeClassException

        public boolean isExpectingBeforeClassException()
      • getTestClassLoopsNbr

        protected int getTestClassLoopsNbr()
      • getMethodLoopsNbr

        protected int getMethodLoopsNbr(Method method)
      • getLoopsNbr

        protected int getLoopsNbr(Repeat repeatAnnotation)
      • getMethodLoopsSleep

        protected int getMethodLoopsSleep(Method method)
      • getTestClassLoopsSleep

        protected int getTestClassLoopsSleep()
      • getLoopsSleep

        protected int getLoopsSleep(Repeat repeatAnnotation)

Copyright © 2019. All rights reserved.





© 2015 - 2024 Weber Informatics LLC | Privacy Policy