public class UnitilsJUnit4TestClassRunner extends org.junit.internal.runners.JUnit4ClassRunner implements TestRunnerAccessor
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]| Modifier and Type | Class and Description |
|---|---|
protected class |
UnitilsJUnit4TestClassRunner.TestListenerInvokingMethodRoadie
Custom method roadie that invokes the unitils test listener methods at the apropriate moments.
|
| Constructor and Description |
|---|
UnitilsJUnit4TestClassRunner(Class<?> testClass)
Creates a test runner that runs all test methods in the given class.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.junit.internal.runners.MethodRoadie |
createMethodRoadie(Object testObject,
Method testMethod,
org.junit.internal.runners.TestMethod jUnitTestMethod,
org.junit.runner.notification.RunNotifier notifier,
org.junit.runner.Description description)
Returns the JUnit 4 MethodRoadie object that is used to execute the test method
|
void |
executeTestMethod(Object testObject,
Method method)
This method allows access to the test invocation, from within the modules (who get a reference to the runner
via the context).
|
protected TestListener |
getTestListener() |
protected Unitils |
getUnitils()
Returns the default singleton instance of Unitils
|
protected void |
invokeTestMethod(Method method,
org.junit.runner.notification.RunNotifier notifier)
Overridden JUnit4 method to be able to create a CustomMethodRoadie that will invoke the
unitils test listener methods at the appropriate moments.
|
void |
run(org.junit.runner.notification.RunNotifier notifier) |
public UnitilsJUnit4TestClassRunner(Class<?> testClass) throws org.junit.internal.runners.InitializationError
testClass - the class, not nullorg.junit.internal.runners.InitializationErrorpublic void run(org.junit.runner.notification.RunNotifier notifier)
run in class org.junit.internal.runners.JUnit4ClassRunnerprotected void invokeTestMethod(Method method, org.junit.runner.notification.RunNotifier notifier)
invokeTestMethod in class org.junit.internal.runners.JUnit4ClassRunnerprotected org.junit.internal.runners.MethodRoadie createMethodRoadie(Object testObject, Method testMethod, org.junit.internal.runners.TestMethod jUnitTestMethod, org.junit.runner.notification.RunNotifier notifier, org.junit.runner.Description description)
testObject - The test instance, not nulltestMethod - The test method, not nulljUnitTestMethod - The JUnit test methodnotifier - The run listener, not nulldescription - A test descriptionpublic void executeTestMethod(Object testObject, Method method)
executeTestMethod in interface TestRunnerAccessortestObject - method - protected TestListener getTestListener()
protected Unitils getUnitils()
Copyright © 2016. All Rights Reserved.