org.jmock.integration.junit4
Class JMockTestClassMethodsRunner
java.lang.Object
org.junit.runner.Runner
org.junit.internal.runners.TestClassMethodsRunner
org.jmock.integration.junit4.JMockTestClassMethodsRunner
- All Implemented Interfaces:
- Filterable, Sortable
public class JMockTestClassMethodsRunner
- extends org.junit.internal.runners.TestClassMethodsRunner
A JUnit 4 Runner that automatically verifies jMock expectations after the test
has run.
Use by passing JMock.class to the @RunWith annotation like this:
@RunWith(JMock.class)
public class SomeMockObjectTests {
Mockery context = new JUnit4Mockery();
...
}
Note: the Mockery must be held in an instance variable of the class.
- Author:
- nat
| Methods inherited from class org.junit.internal.runners.TestClassMethodsRunner |
createTest, filter, getDescription, getName, getTestClass, invokeTestMethod, methodDescription, run, sort, testName |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JMockTestClassMethodsRunner
public JMockTestClassMethodsRunner(Class<?> testClass)
throws org.junit.internal.runners.InitializationError
- Throws:
org.junit.internal.runners.InitializationError
createMethodRunner
protected org.junit.internal.runners.TestMethodRunner createMethodRunner(Object test,
Method method,
RunNotifier notifier)
- Overrides:
createMethodRunner in class org.junit.internal.runners.TestClassMethodsRunner
mockeryOfTest
protected Mockery mockeryOfTest(Object test)
findMockeryField
protected Field findMockeryField(Class testClass)
throws org.junit.internal.runners.InitializationError
- Throws:
org.junit.internal.runners.InitializationError