org.powermock.core.spi
Interface PowerMockTestListener

All Known Subinterfaces:
AnnotationEnablerListener
All Known Implementing Classes:
AbstractPowerMockTestListenerBase, FieldDefaulter

public interface PowerMockTestListener

This interface should be implemented by all PowerMock test listeners. The listener will be notified on the events present in this interface. Please note that a listener cannot hold state.


Method Summary
 void afterTestMethod(java.lang.Object testInstance, java.lang.reflect.Method method, java.lang.Object[] arguments, TestMethodResult testResult)
          Invoked after each test method
 void afterTestSuiteEnded(java.lang.Class<?> testClass, java.lang.reflect.Method[] methods, TestSuiteResult testResult)
          Invoked after a test suite has ended.
 void beforeTestMethod(java.lang.Object testInstance, java.lang.reflect.Method method, java.lang.Object[] arguments)
          Invoked before each test method.
 void beforeTestSuiteStarted(java.lang.Class<?> testClass, java.lang.reflect.Method[] testMethods)
          Invoked once before the test run has started.
 

Method Detail

beforeTestSuiteStarted

void beforeTestSuiteStarted(java.lang.Class<?> testClass,
                            java.lang.reflect.Method[] testMethods)
                            throws java.lang.Exception
Invoked once before the test run has started.

Parameters:
testClass - The type of the test to be executed.
testMethods - The test methods that will be executed during the test.
Throws:
java.lang.Exception - If something unexpected occurs.

beforeTestMethod

void beforeTestMethod(java.lang.Object testInstance,
                      java.lang.reflect.Method method,
                      java.lang.Object[] arguments)
                      throws java.lang.Exception
Invoked before each test method.

Parameters:
testInstance - The test case instance.
method - The test method that is currently executed.
arguments - The arguments passed to the test method if any. May be an empty array but never null.
Throws:
java.lang.Exception - If something unexpected occurs.

afterTestMethod

void afterTestMethod(java.lang.Object testInstance,
                     java.lang.reflect.Method method,
                     java.lang.Object[] arguments,
                     TestMethodResult testResult)
                     throws java.lang.Exception
Invoked after each test method. * @param testInstance The test case instance.

Parameters:
method - The test method that is currently executed.
arguments - The arguments passed to the test method if any. May be an empty array but never null.
testResult - The outcome of the test method.
Throws:
java.lang.Exception - If something unexpected occurs.

afterTestSuiteEnded

void afterTestSuiteEnded(java.lang.Class<?> testClass,
                         java.lang.reflect.Method[] methods,
                         TestSuiteResult testResult)
                         throws java.lang.Exception
Invoked after a test suite has ended.

Parameters:
testClass - The type of the test to be executed.
methods - The test methods that were executed during the test.
testResult - The outcome of the test suite.
Throws:
java.lang.Exception - If something unexpected occurs.


Copyright © 2007-2012. All Rights Reserved.