|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
net.sourceforge.xconf.toolbox.mockcontrol.MockTestCase
public abstract class MockTestCase
A convenient base class for JUnit tests that require mock objects.
This class wraps a MockObjectFactory
instance and allows you to easily keep track of MockControls
for mock objects without needing to create a test variable for each control.
MockObjectFactory| Constructor Summary | |
|---|---|
MockTestCase()
JUnit TestCase constructor. |
|
MockTestCase(String name)
JUnit TestCase constructor. |
|
| Method Summary | |
|---|---|
void |
clear()
Clear all created MockControls and mock objects. |
org.easymock.MockControl |
control(Object mockObject)
Returns the MockControl instance associated with
the given mock object. |
Object |
createMock(Class clazz)
Creates a default mock object for the given class. |
Object |
createNiceMock(Class clazz)
Creates a nice mock object for the given class. |
Object |
createStrictMock(Class clazz)
Creates a strict mock object for the given class. |
void |
replay()
Invokes replay() on all MockControls created by this test. |
void |
reset()
Invokes reset() on all MockControls created by this test. |
void |
verify()
Invokes verify() on all MockControls created by this test. |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString |
| Methods inherited from class junit.framework.Assert |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MockTestCase()
public MockTestCase(String name)
| Method Detail |
|---|
public Object createMock(Class clazz)
MockControl for this mock object by passing the
returned object to the control(Object) method.
MockObjectFactory.createMock(Class)public Object createNiceMock(Class clazz)
MockControl for this mock object by passing the
returned object to the control(Object) method.
MockObjectFactory.createNiceMock(Class)public Object createStrictMock(Class clazz)
MockControl for this mock object by passing the
returned object to the control(Object) method.
MockObjectFactory.createStrictMock(Class)public org.easymock.MockControl control(Object mockObject)
MockControl instance associated with
the given mock object. This mock object must have been created
by one of the mock object creation methods above.
MockObjectFactory.control(Object)public void reset()
MockControls created by this test.
MockObjectFactory.reset()public void replay()
MockControls created by this test.
MockObjectFactory.replay()public void verify()
MockControls created by this test.
MockObjectFactory.verify()public void clear()
MockControls and mock objects.
MockObjectFactory.clear()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||