Class NotificationBuilder
- java.lang.Object
-
- org.powermock.modules.junit4.internal.impl.NotificationBuilder
-
class NotificationBuilder extends java.lang.Object
Stateful class that, from information from JUnit and test-classes, can build and send notifications to PowerMockTestNotifier.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
NotificationBuilder.DetectedTestRunBehaviour
private class
NotificationBuilder.OngoingTestRun
-
Field Summary
Fields Modifier and Type Field Description private NotificationBuilder.DetectedTestRunBehaviour
behaviour
private org.junit.runner.Description
currentDescription
private java.lang.Object
currentTestInstance
private java.lang.reflect.Method
latestMethod
private java.lang.Object
latestTestInstance
private static java.util.regex.Pattern
methodDisplayNameRgx
private java.util.Map<java.lang.Object,java.util.List<java.lang.reflect.Method>>
methodsPerInstance
private java.util.Map<org.junit.runner.Description,NotificationBuilder.OngoingTestRun>
ongoingTestRuns
private java.util.List<?>
pendingTestInstances
private PowerMockTestNotifier
powerMockTestNotifier
private java.lang.String
testClassName
private java.lang.reflect.Method[]
testMethods
private static java.lang.Object[]
unsupportedMethodArgs
-
Constructor Summary
Constructors Constructor Description NotificationBuilder(java.lang.reflect.Method[] testMethods, PowerMockTestNotifier notifier, java.util.List<?> pendingTestInstances)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
assumptionFailed(org.junit.runner.Description d)
private java.lang.reflect.Method
determineTestMethod(org.junit.runner.Description d)
(package private) void
failure(org.junit.runner.notification.Failure f)
private boolean
notify(org.junit.runner.Description d, Result result)
private java.lang.reflect.Method
reloadMethod(java.lang.Class<?> testClass, java.lang.reflect.Method m)
private java.lang.Class<?>
reloadParamType(java.lang.Class<?> testClass, java.lang.Class<?> typeToReload)
(package private) void
testFinished(org.junit.runner.Description d)
(package private) void
testIgnored(org.junit.runner.Description d)
(package private) void
testInstanceCreated(java.lang.Object newTestInstance)
(package private) void
testStartHasBeenFired(org.junit.runner.Description d)
(package private) void
testSuiteStarted(java.lang.Class<?> testClass)
-
-
-
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
-
powerMockTestNotifier
private final PowerMockTestNotifier powerMockTestNotifier
-
behaviour
private NotificationBuilder.DetectedTestRunBehaviour behaviour
-
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
-
ongoingTestRuns
private final java.util.Map<org.junit.runner.Description,NotificationBuilder.OngoingTestRun> ongoingTestRuns
-
-
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
-
-