|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjdave.ContainmentSupport
jdave.mock.MockSupport
public class MockSupport
Note, most of these methods are copied from jmock MockObjectTestCase. We do not want to derive from junit's TestCase as MockObjectTestCase does.
| Constructor Summary | |
|---|---|
protected |
MockSupport()
|
| Method Summary | ||
|---|---|---|
void |
checking(org.jmock.internal.ExpectationBuilder expectations)
Specify expectations upon the mock objects in the test. |
|
|
dummy(java.lang.Class<T> typeToMock)
Create a dummy mock object of type T with a name derived from its type. |
|
|
dummy(java.lang.Class<T> typeToMock,
java.lang.String name)
Create a dummy mock object of type T with a name derived from its type. |
|
|
mock(java.lang.Class<T> typeToMock)
Create a mock object of type T with a name derived from its type. |
|
|
mock(java.lang.Class<T> typeToMock,
java.lang.String name)
Create a mock object of type T with an explicit name. |
|
org.jmock.Mockery |
mockery()
|
|
org.jmock.Sequence |
sequence(java.lang.String name)
Returns a new sequence that is used to constrain the order in which expectations can occur. |
|
void |
setDefaultResultForType(java.lang.Class<?> type,
java.lang.Object result)
Sets the result returned for the given type when no return value has been explicitly specified in the expectation. |
|
org.jmock.States |
states(java.lang.String name)
Returns a new state machine that is used to constrain the order in which expectations can occur. |
|
void |
verifyMocks()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected MockSupport()
| Method Detail |
|---|
public org.jmock.Mockery mockery()
public void verifyMocks()
public void setDefaultResultForType(java.lang.Class<?> type,
java.lang.Object result)
type - The type for which to return result.result - The value to return when a method of return type type
is invoked for which an explicit return value has has not been specified.public void checking(org.jmock.internal.ExpectationBuilder expectations)
public <T> T mock(java.lang.Class<T> typeToMock,
java.lang.String name)
typeToMock - The type to be mockedname - The name of the new mock object that is used to identify the mock object
in error messages
public <T> T mock(java.lang.Class<T> typeToMock)
typeToMock - The type to be mocked
public <T> T dummy(java.lang.Class<T> typeToMock,
java.lang.String name)
typeToMock - The type to be mockedname - The name of the new mock object that is used to identify the mock object
in error messages
public <T> T dummy(java.lang.Class<T> typeToMock)
typeToMock - The type to be mocked
public org.jmock.Sequence sequence(java.lang.String name)
name - The name of the sequence.
public org.jmock.States states(java.lang.String name)
name - The name of the state machine.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||