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 of PowerMockTestListener will also be informed. It is stateful and (hopefully) thread-safe.
See Also:
  • Field Details

    • suiteClass

      private Class<?> suiteClass
    • motherThread

      private final Thread motherThread
    • junitRunNotifier

      private final org.junit.runner.notification.RunNotifier junitRunNotifier
    • powerMockTestNotifier

      private final PowerMockTestNotifier powerMockTestNotifier
    • testMethods

      private final Method[] testMethods
    • pendingTestInstancesOnMotherThread

      private final LinkedList<Object> pendingTestInstancesOnMotherThread
    • notificationBuilder

      private final ThreadLocal<NotificationBuilder> notificationBuilder
  • Constructor Details

    • PowerMockRunNotifier

      PowerMockRunNotifier(org.junit.runner.notification.RunNotifier junitRunNotifier, PowerMockTestNotifier powerMockTestNotifier, Method[] testMethods)
  • Method Details

    • getSuiteClass

      Class<?> getSuiteClass()
    • suiteClassInitiated

      public void suiteClassInitiated(Class<?> testClass)
      Specified by:
      suiteClassInitiated in interface GlobalNotificationBuildSupport.Callback
    • testInstanceCreated

      public void testInstanceCreated(Object testInstance)
      Specified by:
      testInstanceCreated in interface GlobalNotificationBuildSupport.Callback
    • addListener

      public void addListener(org.junit.runner.notification.RunListener listener)
      Overrides:
      addListener in class org.junit.runner.notification.RunNotifier
    • removeListener

      public void removeListener(org.junit.runner.notification.RunListener listener)
      Overrides:
      removeListener in class org.junit.runner.notification.RunNotifier
    • fireTestRunStarted

      public void fireTestRunStarted(org.junit.runner.Description description)
      Overrides:
      fireTestRunStarted in class org.junit.runner.notification.RunNotifier
    • fireTestRunFinished

      public void fireTestRunFinished(org.junit.runner.Result result)
      Overrides:
      fireTestRunFinished in class org.junit.runner.notification.RunNotifier
    • fireTestStarted

      public void fireTestStarted(org.junit.runner.Description description) throws org.junit.runner.notification.StoppedByUserException
      Overrides:
      fireTestStarted in class org.junit.runner.notification.RunNotifier
      Throws:
      org.junit.runner.notification.StoppedByUserException
    • fireTestFailure

      public void fireTestFailure(org.junit.runner.notification.Failure failure)
      Overrides:
      fireTestFailure in class org.junit.runner.notification.RunNotifier
    • fireTestAssumptionFailed

      public void fireTestAssumptionFailed(org.junit.runner.notification.Failure failure)
      Overrides:
      fireTestAssumptionFailed in class org.junit.runner.notification.RunNotifier
    • fireTestIgnored

      public void fireTestIgnored(org.junit.runner.Description description)
      Overrides:
      fireTestIgnored in class org.junit.runner.notification.RunNotifier
    • fireTestFinished

      public void fireTestFinished(org.junit.runner.Description description)
      Overrides:
      fireTestFinished in class org.junit.runner.notification.RunNotifier
    • pleaseStop

      public void pleaseStop()
      Overrides:
      pleaseStop in class org.junit.runner.notification.RunNotifier
    • addFirstListener

      public void addFirstListener(org.junit.runner.notification.RunListener listener)
      Overrides:
      addFirstListener in class org.junit.runner.notification.RunNotifier
    • invoke

      private void invoke(String methodName, Object... args)