Class NotificationBuilder


  • class NotificationBuilder
    extends java.lang.Object
    Stateful class that, from information from JUnit and test-classes, can build and send notifications to PowerMockTestNotifier.
    • Field Detail

      • methodDisplayNameRgx

        private static final java.util.regex.Pattern methodDisplayNameRgx
      • testMethods

        private final java.lang.reflect.Method[] testMethods
      • pendingTestInstances

        private final java.util.List<?> pendingTestInstances
      • currentDescription

        private org.junit.runner.Description currentDescription
      • currentTestInstance

        private java.lang.Object currentTestInstance
      • testClassName

        private java.lang.String testClassName
      • latestTestInstance

        private java.lang.Object latestTestInstance
      • latestMethod

        private java.lang.reflect.Method latestMethod
      • unsupportedMethodArgs

        private static final java.lang.Object[] unsupportedMethodArgs
      • methodsPerInstance

        private final java.util.Map<java.lang.Object,​java.util.List<java.lang.reflect.Method>> methodsPerInstance
    • Constructor Detail

      • NotificationBuilder

        public NotificationBuilder​(java.lang.reflect.Method[] testMethods,
                                   PowerMockTestNotifier notifier,
                                   java.util.List<?> pendingTestInstances)
    • Method Detail

      • determineTestMethod

        private java.lang.reflect.Method determineTestMethod​(org.junit.runner.Description d)
      • reloadParamType

        private java.lang.Class<?> reloadParamType​(java.lang.Class<?> testClass,
                                                   java.lang.Class<?> typeToReload)
      • reloadMethod

        private java.lang.reflect.Method reloadMethod​(java.lang.Class<?> testClass,
                                                      java.lang.reflect.Method m)
      • testSuiteStarted

        void testSuiteStarted​(java.lang.Class<?> testClass)
      • testStartHasBeenFired

        void testStartHasBeenFired​(org.junit.runner.Description d)
      • testInstanceCreated

        void testInstanceCreated​(java.lang.Object newTestInstance)
      • testIgnored

        void testIgnored​(org.junit.runner.Description d)
      • assumptionFailed

        void assumptionFailed​(org.junit.runner.Description d)
      • failure

        void failure​(org.junit.runner.notification.Failure f)
      • testFinished

        void testFinished​(org.junit.runner.Description d)
      • notify

        private boolean notify​(org.junit.runner.Description d,
                               Result result)
        Returns:
        true if notification concerns an ongoing testrun; otherwise false when there is no test launched for the specified description