Class PowerMockRunNotifier
- java.lang.Object
-
- org.junit.runner.notification.RunNotifier
-
- org.powermock.modules.junit4.internal.impl.PowerMockRunNotifier
-
- All Implemented Interfaces:
GlobalNotificationBuildSupport.Callback
class PowerMockRunNotifier extends org.junit.runner.notification.RunNotifier implements GlobalNotificationBuildSupport.Callback
Wraps JUnit's RunNotifier to make sure that the PowerMock-specific instances ofPowerMockTestListener
will also be informed. It is stateful and (hopefully) thread-safe.- See Also:
PowerMockTestListener
-
-
Field Summary
Fields Modifier and Type Field Description private org.junit.runner.notification.RunNotifier
junitRunNotifier
private java.lang.Thread
motherThread
private java.lang.ThreadLocal<NotificationBuilder>
notificationBuilder
private java.util.LinkedList<java.lang.Object>
pendingTestInstancesOnMotherThread
private PowerMockTestNotifier
powerMockTestNotifier
private java.lang.Class<?>
suiteClass
private java.lang.reflect.Method[]
testMethods
-
Constructor Summary
Constructors Constructor Description PowerMockRunNotifier(org.junit.runner.notification.RunNotifier junitRunNotifier, PowerMockTestNotifier powerMockTestNotifier, java.lang.reflect.Method[] testMethods)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFirstListener(org.junit.runner.notification.RunListener listener)
void
addListener(org.junit.runner.notification.RunListener listener)
void
fireTestAssumptionFailed(org.junit.runner.notification.Failure failure)
void
fireTestFailure(org.junit.runner.notification.Failure failure)
void
fireTestFinished(org.junit.runner.Description description)
void
fireTestIgnored(org.junit.runner.Description description)
void
fireTestRunFinished(org.junit.runner.Result result)
void
fireTestRunStarted(org.junit.runner.Description description)
void
fireTestStarted(org.junit.runner.Description description)
(package private) java.lang.Class<?>
getSuiteClass()
private void
invoke(java.lang.String methodName, java.lang.Object... args)
void
pleaseStop()
void
removeListener(org.junit.runner.notification.RunListener listener)
void
suiteClassInitiated(java.lang.Class<?> testClass)
void
testInstanceCreated(java.lang.Object testInstance)
-
-
-
Field Detail
-
suiteClass
private java.lang.Class<?> suiteClass
-
motherThread
private final java.lang.Thread motherThread
-
junitRunNotifier
private final org.junit.runner.notification.RunNotifier junitRunNotifier
-
powerMockTestNotifier
private final PowerMockTestNotifier powerMockTestNotifier
-
testMethods
private final java.lang.reflect.Method[] testMethods
-
pendingTestInstancesOnMotherThread
private final java.util.LinkedList<java.lang.Object> pendingTestInstancesOnMotherThread
-
notificationBuilder
private final java.lang.ThreadLocal<NotificationBuilder> notificationBuilder
-
-
Constructor Detail
-
PowerMockRunNotifier
PowerMockRunNotifier(org.junit.runner.notification.RunNotifier junitRunNotifier, PowerMockTestNotifier powerMockTestNotifier, java.lang.reflect.Method[] testMethods)
-
-
Method Detail
-
getSuiteClass
java.lang.Class<?> getSuiteClass()
-
suiteClassInitiated
public void suiteClassInitiated(java.lang.Class<?> testClass)
- Specified by:
suiteClassInitiated
in interfaceGlobalNotificationBuildSupport.Callback
-
testInstanceCreated
public void testInstanceCreated(java.lang.Object testInstance)
- Specified by:
testInstanceCreated
in interfaceGlobalNotificationBuildSupport.Callback
-
addListener
public void addListener(org.junit.runner.notification.RunListener listener)
- Overrides:
addListener
in classorg.junit.runner.notification.RunNotifier
-
removeListener
public void removeListener(org.junit.runner.notification.RunListener listener)
- Overrides:
removeListener
in classorg.junit.runner.notification.RunNotifier
-
fireTestRunStarted
public void fireTestRunStarted(org.junit.runner.Description description)
- Overrides:
fireTestRunStarted
in classorg.junit.runner.notification.RunNotifier
-
fireTestRunFinished
public void fireTestRunFinished(org.junit.runner.Result result)
- Overrides:
fireTestRunFinished
in classorg.junit.runner.notification.RunNotifier
-
fireTestStarted
public void fireTestStarted(org.junit.runner.Description description) throws org.junit.runner.notification.StoppedByUserException
- Overrides:
fireTestStarted
in classorg.junit.runner.notification.RunNotifier
- Throws:
org.junit.runner.notification.StoppedByUserException
-
fireTestFailure
public void fireTestFailure(org.junit.runner.notification.Failure failure)
- Overrides:
fireTestFailure
in classorg.junit.runner.notification.RunNotifier
-
fireTestAssumptionFailed
public void fireTestAssumptionFailed(org.junit.runner.notification.Failure failure)
- Overrides:
fireTestAssumptionFailed
in classorg.junit.runner.notification.RunNotifier
-
fireTestIgnored
public void fireTestIgnored(org.junit.runner.Description description)
- Overrides:
fireTestIgnored
in classorg.junit.runner.notification.RunNotifier
-
fireTestFinished
public void fireTestFinished(org.junit.runner.Description description)
- Overrides:
fireTestFinished
in classorg.junit.runner.notification.RunNotifier
-
pleaseStop
public void pleaseStop()
- Overrides:
pleaseStop
in classorg.junit.runner.notification.RunNotifier
-
addFirstListener
public void addFirstListener(org.junit.runner.notification.RunListener listener)
- Overrides:
addFirstListener
in classorg.junit.runner.notification.RunNotifier
-
invoke
private void invoke(java.lang.String methodName, java.lang.Object... args)
-
-