org.unitils.easymock
Class EasyMockModule.EasyMockTestListener

java.lang.Object
  extended by org.unitils.core.TestListener
      extended by org.unitils.easymock.EasyMockModule.EasyMockTestListener
Enclosing class:
EasyMockModule

protected class EasyMockModule.EasyMockTestListener
extends TestListener

Test listener that handles the mock creation and injection.


Constructor Summary
protected EasyMockModule.EasyMockTestListener()
           
 
Method Summary
 void afterTestMethod(Object testObject, Method testMethod, Throwable throwable)
          After each test is executed this calls EasyMockModule.verify() to verify the recorded behavior of all created mocks.
 void beforeTestSetUp(Object testObject, Method testMethod)
          Before the test is executed this calls EasyMockModule.createAndInjectRegularMocksIntoTest(Object) to create and inject all mocks on the class.
 
Methods inherited from class org.unitils.core.TestListener
afterCreateTestObject, afterTestTearDown, beforeTestClass, beforeTestMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EasyMockModule.EasyMockTestListener

protected EasyMockModule.EasyMockTestListener()
Method Detail

beforeTestSetUp

public void beforeTestSetUp(Object testObject,
                            Method testMethod)
Before the test is executed this calls EasyMockModule.createAndInjectRegularMocksIntoTest(Object) to create and inject all mocks on the class.

Overrides:
beforeTestSetUp in class TestListener
Parameters:
testObject - The test instance, not null
testMethod - The test method, not null

afterTestMethod

public void afterTestMethod(Object testObject,
                            Method testMethod,
                            Throwable throwable)
After each test is executed this calls EasyMockModule.verify() to verify the recorded behavior of all created mocks.

Overrides:
afterTestMethod in class TestListener
Parameters:
testObject - The test instance, not null
testMethod - The test method, not null
throwable - The throwable thrown during the test or beforeTestMethod, null if none was thrown


Copyright © 2011. All Rights Reserved.