Class PowerMockJUnit4RunListener
java.lang.Object
org.junit.runner.notification.RunListener
org.powermock.modules.junit4.common.internal.impl.PowerMockJUnit4RunListener
public class PowerMockJUnit4RunListener
extends org.junit.runner.notification.RunListener
-
Nested Class Summary
Nested classes/interfaces inherited from class org.junit.runner.notification.RunListener
org.junit.runner.notification.RunListener.ThreadSafe
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private int
private int
private final ClassLoader
private final PowerMockTestNotifier
-
Constructor Summary
ConstructorsConstructorDescriptionPowerMockJUnit4RunListener
(ClassLoader mockClassLoader, PowerMockTestNotifier powerMockTestNotifier) -
Method Summary
Modifier and TypeMethodDescriptionint
int
private void
void
testFailure
(org.junit.runner.notification.Failure failure) void
testFinished
(org.junit.runner.Description description1) Performs clean up after each test.void
testIgnored
(org.junit.runner.Description description) Methods inherited from class org.junit.runner.notification.RunListener
testAssumptionFailure, testRunFinished, testRunStarted, testStarted, testSuiteFinished, testSuiteStarted
-
Field Details
-
mockClassLoader
-
failureCount
private int failureCount -
ignoreCount
private int ignoreCount -
currentTestSuccessful
private boolean currentTestSuccessful -
powerMockTestNotifier
-
-
Constructor Details
-
PowerMockJUnit4RunListener
public PowerMockJUnit4RunListener(ClassLoader mockClassLoader, PowerMockTestNotifier powerMockTestNotifier)
-
-
Method Details
-
testFinished
Performs clean up after each test. TheMockRepository.clear()
methods has to be called by the correct class loader for the state to be cleared. Therefore it is invoked using reflection when the class is loaded from the correct class loader.- Overrides:
testFinished
in classorg.junit.runner.notification.RunListener
- Throws:
Exception
-
getFailureCount
public int getFailureCount()- Returns:
- The number of failed tests.
-
getIgnoreCount
public int getIgnoreCount()- Returns:
- The number of successful tests.
-
testFailure
- Overrides:
testFailure
in classorg.junit.runner.notification.RunListener
- Throws:
Exception
-
testIgnored
- Overrides:
testIgnored
in classorg.junit.runner.notification.RunListener
- Throws:
Exception
-
notifyListenersOfTestResult
private void notifyListenersOfTestResult()
-