org.jmock.integration.junit4
Class JUnitRuleMockery

java.lang.Object
  extended by org.jmock.Mockery
      extended by org.jmock.integration.junit4.JUnit4Mockery
          extended by org.jmock.integration.junit4.JUnitRuleMockery
All Implemented Interfaces:
SelfDescribing, MethodRule

public class JUnitRuleMockery
extends JUnit4Mockery
implements MethodRule

A JUnitRuleMockery is a JUnit Rule that manages JMock expectations and allowances, and asserts that expectations have been met after each test has finished. To use it, add a field to the test class (note that you don't have to specify @RunWith(JMock.class) any more). For example,

public class ATestWithSatisfiedExpectations {

Author:
smgf

Constructor Summary
JUnitRuleMockery()
           
 
Method Summary
 Statement apply(Statement base, FrameworkMethod method, Object target)
           
 
Methods inherited from class org.jmock.Mockery
addExpectation, assertIsSatisfied, checking, describeTo, mock, mock, sequence, setDefaultResultForType, setExpectationErrorTranslator, setImposteriser, setNamingScheme, setThreadingPolicy, states
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JUnitRuleMockery

public JUnitRuleMockery()
Method Detail

apply

public Statement apply(Statement base,
                       FrameworkMethod method,
                       Object target)
Specified by:
apply in interface MethodRule