org.unitils
Class UnitilsInvocationTestBase

java.lang.Object
  extended by org.unitils.UnitilsInvocationTestBase

public abstract class UnitilsInvocationTestBase
extends Object

Base class for the invocation listener tests.

Author:
Filip Neven, Tim Ducheyne

Field Summary
protected  TestExecutor testExecutor
           
protected  TracingTestListener.TestFramework testFramework
           
protected  TracingTestListener tracingTestListener
           
 
Constructor Summary
UnitilsInvocationTestBase(TracingTestListener.TestFramework testFramework, TestExecutor testExecutor)
           
 
Method Summary
protected  void assertInvocation(TracingTestListener.Invocation invocation, Class<?> testClass, TracingTestListener.TestFramework... testFrameworks)
           
 void assertInvocationOrder(Class<?> testClass1, Class<?> testClass2)
           
protected  void assertNoMoreInvocations()
           
 void cleanUp()
           
 void init()
          Sets up the test installing the tracing test listener that will record all method invocations during the test.
protected  boolean isApplicableFor(TracingTestListener.TestFramework[] testFrameworks)
           
static void restoreOrginalTestListener()
           
static void storeOriginalTestListener()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tracingTestListener

protected TracingTestListener tracingTestListener

testFramework

protected TracingTestListener.TestFramework testFramework

testExecutor

protected TestExecutor testExecutor
Constructor Detail

UnitilsInvocationTestBase

public UnitilsInvocationTestBase(TracingTestListener.TestFramework testFramework,
                                 TestExecutor testExecutor)
Method Detail

storeOriginalTestListener

public static void storeOriginalTestListener()

restoreOrginalTestListener

public static void restoreOrginalTestListener()

init

public void init()
          throws Exception
Sets up the test installing the tracing test listener that will record all method invocations during the test. The current test listeners are stored so that they can be restored during the class tear down. Also re-initializes the base-classes so that, for example, beforeAll() will be called another time.

Throws:
Exception

cleanUp

public void cleanUp()
             throws Exception
Throws:
Exception

assertInvocationOrder

public void assertInvocationOrder(Class<?> testClass1,
                                  Class<?> testClass2)
                           throws Exception
Throws:
Exception

assertInvocation

protected void assertInvocation(TracingTestListener.Invocation invocation,
                                Class<?> testClass,
                                TracingTestListener.TestFramework... testFrameworks)

assertNoMoreInvocations

protected void assertNoMoreInvocations()

isApplicableFor

protected boolean isApplicableFor(TracingTestListener.TestFramework[] testFrameworks)


Copyright © 2011. All Rights Reserved.