| org.unitils.UnitilsJUnit4TestClassRunner
UnitilsJUnit4TestClassRunner | public class UnitilsJUnit4TestClassRunner extends JUnit4ClassRunner (Code) | | Custom test runner that will Unitils-enable your test. This will make sure that the
core unitils test listener methods are invoked in the expected order. See
TestListener for
more information on the listener invocation order.
NOTE: if a test fails, the error is logged as debug logging. This is a temporary work-around for
a problem with IntelliJ JUnit-4 runner that reports a 'Wrong test finished' error when something went wrong
in the before. [IDEA-12498]
author: Tim Ducheyne author: Filip Neven |
Inner Class :public static class CustomMethodRoadie extends MethodRoadie | |
Method Summary | |
protected void | createShutdownHook() Creates a hook that will call
TestListener.afterAll during the shutdown of the VM. | protected Unitils | getUnitils() This will return the default singleton instance by calling
Unitils.getInstance .
You can override this method to let it create and set your own singleton instance. | protected void | invokeTestMethod(Method method, RunNotifier notifier) Overriden JUnit4 method to be able to create a CustomMethodRoadie that will invoke the
unitils test listener methods at the apropriate moments. | public void | run(RunNotifier notifier) |
UnitilsJUnit4TestClassRunner | public UnitilsJUnit4TestClassRunner(Class> testClass) throws InitializationError(Code) | | Creates a test runner that runs all test methods in the given class.
Parameters: testClass - the class, not null throws: InitializationError - |
createShutdownHook | protected void createShutdownHook()(Code) | | Creates a hook that will call
TestListener.afterAll during the shutdown of the VM.
This seems te be the only way in JUnit4 to this, since there is no way to
able to know when all tests have run.
|
getUnitils | protected Unitils getUnitils()(Code) | | This will return the default singleton instance by calling
Unitils.getInstance .
You can override this method to let it create and set your own singleton instance. For example, you
can let it create an instance of your own Unitils subclass and set it by using
Unitils.setInstance .
the unitils core instance, not null |
invokeTestMethod | protected void invokeTestMethod(Method method, RunNotifier notifier)(Code) | | Overriden JUnit4 method to be able to create a CustomMethodRoadie that will invoke the
unitils test listener methods at the apropriate moments.
|
run | public void run(RunNotifier notifier)(Code) | | |
|
|