Logo Search packages:      
Sourcecode: jmock2 version File versions  Download package

org::jmock::Mockery Class Reference

Inheritance diagram for org::jmock::Mockery:

org::jmock::integration::junit3::JUnit3Mockery org::jmock::integration::junit4::JUnit4Mockery

List of all members.

Detailed Description

A Mockery represents the context, or neighbourhood, of the object(s) under test.

The neighbouring objects in that context are mocked out. The test specifies the expected interactions between the object(s) under test and its neighbours and the Mockery checks those expectations while the test is running.



named by Ivan Moore.

Definition at line 43 of file Mockery.java.

Public Member Functions

void addExpectation (Expectation expectation)
void assertIsSatisfied ()
void checking (ExpectationBuilder expectations)
void describeTo (Description description)
Sequence sequence (String name)
void setDefaultResultForType (Class<?> type, Object result)
void setExpectationErrorTranslator (ExpectationErrorTranslator expectationErrorTranslator)
void setImposteriser (Imposteriser imposteriser)
void setNamingScheme (MockObjectNamingScheme namingScheme)
States states (String name)

Package Functions

public< T > T mock (Class< T > typeToMock, String name)
public< T > T mock (Class< T > typeToMock)

Private Member Functions

Object dispatch (Invocation invocation) throws Throwable
ExpectationError fillInDetails (ExpectationError e)

Private Attributes

List< InvocationactualInvocations = new ArrayList<Invocation>()
ReturnDefaultValueAction defaultAction = new ReturnDefaultValueAction(imposteriser)
InvocationDispatcher dispatcher = new InvocationDispatcher()
ExpectationErrorTranslator expectationErrorTranslator = IdentityExpectationErrorTranslator.INSTANCE
Throwable firstError = null
Imposteriser imposteriser = JavaReflectionImposteriser.INSTANCE
Set< String > mockNames = new HashSet<String>()
MockObjectNamingScheme namingScheme = CamelCaseNamingScheme.INSTANCE


class  MockObject

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index