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
-
-
Field Summary
Fields Modifier and Type Field Description private booleancurrentTestSuccessfulprivate intfailureCountprivate intignoreCountprivate java.lang.ClassLoadermockClassLoaderprivate PowerMockTestNotifierpowerMockTestNotifier
-
Constructor Summary
Constructors Constructor Description PowerMockJUnit4RunListener(java.lang.ClassLoader mockClassLoader, PowerMockTestNotifier powerMockTestNotifier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetFailureCount()intgetIgnoreCount()private voidnotifyListenersOfTestResult()voidtestFailure(org.junit.runner.notification.Failure failure)voidtestFinished(org.junit.runner.Description description1)Performs clean up after each test.voidtestIgnored(org.junit.runner.Description description)
-
-
-
Field Detail
-
mockClassLoader
private final java.lang.ClassLoader mockClassLoader
-
failureCount
private int failureCount
-
ignoreCount
private int ignoreCount
-
currentTestSuccessful
private boolean currentTestSuccessful
-
powerMockTestNotifier
private final PowerMockTestNotifier powerMockTestNotifier
-
-
Constructor Detail
-
PowerMockJUnit4RunListener
public PowerMockJUnit4RunListener(java.lang.ClassLoader mockClassLoader, PowerMockTestNotifier powerMockTestNotifier)
-
-
Method Detail
-
testFinished
public void testFinished(org.junit.runner.Description description1) throws java.lang.ExceptionPerforms 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:
testFinishedin classorg.junit.runner.notification.RunListener- Throws:
java.lang.Exception
-
getFailureCount
public int getFailureCount()
- Returns:
- The number of failed tests.
-
getIgnoreCount
public int getIgnoreCount()
- Returns:
- The number of successful tests.
-
testFailure
public void testFailure(org.junit.runner.notification.Failure failure) throws java.lang.Exception- Overrides:
testFailurein classorg.junit.runner.notification.RunListener- Throws:
java.lang.Exception
-
testIgnored
public void testIgnored(org.junit.runner.Description description) throws java.lang.Exception- Overrides:
testIgnoredin classorg.junit.runner.notification.RunListener- Throws:
java.lang.Exception
-
notifyListenersOfTestResult
private void notifyListenersOfTestResult()
-
-