org.unitils
Class TracingTestListener

java.lang.Object
  extended by org.unitils.core.TestListener
      extended by org.unitils.TracingTestListener

public class TracingTestListener
extends TestListener

Test listener that records all method invocations.

Author:
Tim Ducheyne, Filip Neven

Nested Class Summary
static class TracingTestListener.Call
           
static interface TracingTestListener.Invocation
           
static class TracingTestListener.InvocationSource
           
static class TracingTestListener.ListenerInvocation
           
static class TracingTestListener.TestFramework
           
static class TracingTestListener.TestInvocation
           
 
Constructor Summary
TracingTestListener()
           
TracingTestListener(TestListener delegate)
           
 
Method Summary
 void afterCreateTestObject(Object testObject)
           
 void afterTestMethod(Object testObject, Method testMethod, Throwable throwable)
           
 void afterTestTearDown(Object testObject, Method testMethod)
           
 void beforeTestClass(Class<?> testClass)
           
 void beforeTestMethod(Object testObject, Method testMethod)
           
 void beforeTestSetUp(Object testObject, Method testMethod)
           
 void expectExceptionInMethod(TracingTestListener.Invocation exceptionMethod, boolean throwAssertionFailedError)
           
 List<TracingTestListener.Call> getCallList()
           
 String getCallListAsString()
           
 Throwable getCurrentThrowable()
           
 void registerListenerInvocation(TracingTestListener.ListenerInvocation listenerInvocation, Class<?> testClass, Object test, Method testMethod, Throwable throwable)
           
 void registerTestInvocation(TracingTestListener.TestInvocation invocation, Class<?> testClass, String methodName)
           
 boolean shouldInvokeTestMethod(Object testObject, Method testMethod)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TracingTestListener

public TracingTestListener(TestListener delegate)

TracingTestListener

public TracingTestListener()
Method Detail

getCallList

public List<TracingTestListener.Call> getCallList()

getCallListAsString

public String getCallListAsString()

expectExceptionInMethod

public void expectExceptionInMethod(TracingTestListener.Invocation exceptionMethod,
                                    boolean throwAssertionFailedError)

registerTestInvocation

public void registerTestInvocation(TracingTestListener.TestInvocation invocation,
                                   Class<?> testClass,
                                   String methodName)

registerListenerInvocation

public void registerListenerInvocation(TracingTestListener.ListenerInvocation listenerInvocation,
                                       Class<?> testClass,
                                       Object test,
                                       Method testMethod,
                                       Throwable throwable)

beforeTestClass

public void beforeTestClass(Class<?> testClass)
Overrides:
beforeTestClass in class TestListener

afterCreateTestObject

public void afterCreateTestObject(Object testObject)
Overrides:
afterCreateTestObject in class TestListener

beforeTestSetUp

public void beforeTestSetUp(Object testObject,
                            Method testMethod)
Overrides:
beforeTestSetUp in class TestListener

beforeTestMethod

public void beforeTestMethod(Object testObject,
                             Method testMethod)
Overrides:
beforeTestMethod in class TestListener

afterTestMethod

public void afterTestMethod(Object testObject,
                            Method testMethod,
                            Throwable throwable)
Overrides:
afterTestMethod in class TestListener

afterTestTearDown

public void afterTestTearDown(Object testObject,
                              Method testMethod)
Overrides:
afterTestTearDown in class TestListener

shouldInvokeTestMethod

public boolean shouldInvokeTestMethod(Object testObject,
                                      Method testMethod)
Overrides:
shouldInvokeTestMethod in class TestListener

getCurrentThrowable

public Throwable getCurrentThrowable()


Copyright © 2014. All Rights Reserved.