|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.beesting.util.MockingTest
public abstract class MockingTest
Abstract parent test class that takes care of setting up some easymock stuff.
| Constructor Summary | |
|---|---|
MockingTest()
|
|
| Method Summary | ||
|---|---|---|
protected void |
clear()
Clear the mock cache. |
|
protected
|
createMock(java.lang.Class<T> clazz)
Creates an EasyMock mock, and adds it to the cache so that we can easily replay and verify all mocks simultaneously. |
|
protected
|
createNiceMock(java.lang.Class<T> clazz)
Creates a "nice" EasyMock mock and adds it to the cache. |
|
protected java.lang.Object |
getValue(java.lang.Object instance,
java.lang.String field)
Helper method to get a value from an instance which doesn't have a getter for the field. |
|
protected void |
replayAll()
Replay all mocks in the class. |
|
static void |
setValue(java.lang.Object instance,
java.lang.String field,
java.lang.Object value)
Helper method to set a value on an instance which doesn't have a setter for the field. |
|
void |
tearDown()
Clears the mock cache after each method. |
|
protected void |
verifyAll()
Verify all mocks in the cache. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MockingTest()
| Method Detail |
|---|
public void tearDown()
protected <T> T createMock(java.lang.Class<T> clazz)
T - The type of the mock that should be returned.clazz - The class or interface to create a mock of.
protected <T> T createNiceMock(java.lang.Class<T> clazz)
T - the type of the mock that should be returned.clazz - The class of interface to create a mock of.
protected void verifyAll()
protected void replayAll()
protected void clear()
public static void setValue(java.lang.Object instance,
java.lang.String field,
java.lang.Object value)
throws java.lang.NoSuchFieldException,
java.lang.IllegalAccessException
instance - the instance to set the value on.field - The field to set the value on.value - The value to set on the field of the instance.
java.lang.NoSuchFieldException - If the field could not be found in the class of the instance
or any of its superclasses.
java.lang.IllegalAccessException - If the field could not be set.
protected java.lang.Object getValue(java.lang.Object instance,
java.lang.String field)
throws java.lang.NoSuchFieldException,
java.lang.IllegalAccessException
instance - The instance to get the value of.field - The field to get the value from.
java.lang.NoSuchFieldException - If the field could not be found in the class of the instance
or any of its superclasses.
java.lang.IllegalAccessException - If the field could not be get.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||