com.hammingweight.hammock
Interface IHammockExceptionErrors

All Known Implementing Classes:
AMockObject, ATestDoubleHandler, Hammock, Hamspy, InvocationMatcher, InvocationVerifier, MethodHandler, MethodInvocation, MockAuthenticator, MockBinaryMessage, MockChoice, MockClientSession, MockCommandListener, MockCommConnection, MockConnection, MockContact, MockContactList, MockContentConnection, MockContentHandler, MockContentHandlerServer, MockControl, MockControllable, MockDatagram, MockDataInput, MockDataOutput, MockEvent, MockEventList, MockFileConnection, MockFileSystemListener, MockFramePositioningControl, MockGUIControl, MockHeaderSet, MockHttpConnection, MockHttpsConnection, MockInputConnection, MockItemCommandListener, MockItemStateListener, MockKvmSerializable, MockLocationListener, MockMarshal, MockMessage, MockMessageConnection, MockMessageListener, MockMetaDataControl, MockMethod, MockMIDIControl, MockMultipartMessage, MockOperation, MockOutputConnection, MockPIMItem, MockPIMList, MockPitchControl, MockPlayer, MockPlayerListener, MockProximityListener, MockRateControl, MockRecordControl, MockRequestListener, MockResponseListener, MockSecureConnection, MockSecurityInfo, MockServerSocketConnection, MockServiceConnection, MockSessionNotifier, MockSocketConnection, MockSourceStream, MockStopTimeControl, MockStreamConnection, MockStreamConnectionNotifier, MockTempoControl, MockTextMessage, MockTimeBase, MockToDo, MockToDoList, MockToneControl, MockUDPDatagramConnection, MockVideoControl, MockVolumeControl

public interface IHammockExceptionErrors

This interface contains text messages describing the most common problems when invoking methods on a test double or verifying that a mock object was invoked as expected.

Since:
Hammock 1.0
Author:
C.A. Meijer

Field Summary
static java.lang.String ARGUMENT_MATCHER_ALREADY_SET
          An argument matcher can only be set once for a particular argument for a method.
static java.lang.String CANT_SET_VOID_RETURN_VALUE
          If a method is of type void, it doesn't make sense to set a value that should be returned when the method is invoked.
static java.lang.String CLASS_IS_NOT_THROWABLE
          An argument passed as an exception is not a subclass of Throwable.
static java.lang.String DOES_NOT_SUBCLASS_MOCK_OBJECT
          The Hammock framework requires that some methods can only be invoked on objects that implement the IMockObject interface.
static java.lang.String HANDLER_NOT_SET
          It is a mistake to invoke a method on an instance of AMockObject if no invocation handler has been set.
static java.lang.String INCORRECT_MOCK_OBJECT
          An expectation was set that some method would be invoked on a mock object where the method is not applicable for the mock object's class.
static java.lang.String INCORRECT_RETURN_CLASS
          When setting the return value for a mocked method, the return value must be an instance of the class that is returned by the method.
static java.lang.String INCORRECT_THROWABLE_CLASS
          When setting an exception to be thrown by a mock object, the exception must be in accordance with the method's signature.
static java.lang.String METHOD_CANNOT_BE_EVALUATED
          A message stating that an invocation handler cannot evaluate some method invoked on a test double.
static java.lang.String METHOD_INVOKED_OUT_OF_SEQUENCE
          For a strict mock object, methods must be invoked in the same order as specified in the expectations.
static java.lang.String METHOD_INVOKED_TOO_MANY_TIMES
          When verifying the behaviour of an object under test, it must invoke mock objects a certain number of times to satisfy the expectations.
static java.lang.String METHOD_INVOKED_UNEXPECTED_NUMBER_OF_TIMES
          When verifying the behaviour of an object under test, it must invoke mock objects a certain number of times to satisfy the expectations.
static java.lang.String NO_RETURN_VALUE
          If a method on a mock object is expected to return a primitive value, it is a mistake if the method tries to return null.
static java.lang.String NO_RETURN_VALUE_SET
          For a non-void method, one must specify a return value when setting an expectation that a method will be invoked.
static java.lang.String NUM_INVOCATIONS_ALREADY_SET
          The expected number of invocations can only be set once for a handler.
static java.lang.String RETURN_VALUE_ALREADY_SET
          A return value for a method handler can only be set once, it does not make sense to specify two or more values that should be returned when the method is invoked.
static java.lang.String WRONG_ARGUMENT_CLASS
          When setting an expectation for a method invocation, the class of the arguments must agree with the method's signature.
static java.lang.String WRONG_NUMBER_OF_ARGS
          When setting an expectation for a method invocation, the number of arguments specified in the expectation must agree with the number of arguments in the method's signature.
 

Field Detail

METHOD_CANNOT_BE_EVALUATED

static final java.lang.String METHOD_CANNOT_BE_EVALUATED
A message stating that an invocation handler cannot evaluate some method invoked on a test double.

See Also:
Constant Field Values

CLASS_IS_NOT_THROWABLE

static final java.lang.String CLASS_IS_NOT_THROWABLE
An argument passed as an exception is not a subclass of Throwable.

See Also:
Constant Field Values

DOES_NOT_SUBCLASS_MOCK_OBJECT

static final java.lang.String DOES_NOT_SUBCLASS_MOCK_OBJECT
The Hammock framework requires that some methods can only be invoked on objects that implement the IMockObject interface.

See Also:
Constant Field Values

HANDLER_NOT_SET

static final java.lang.String HANDLER_NOT_SET
It is a mistake to invoke a method on an instance of AMockObject if no invocation handler has been set.

See Also:
Constant Field Values

NO_RETURN_VALUE

static final java.lang.String NO_RETURN_VALUE
If a method on a mock object is expected to return a primitive value, it is a mistake if the method tries to return null.

See Also:
Constant Field Values

RETURN_VALUE_ALREADY_SET

static final java.lang.String RETURN_VALUE_ALREADY_SET
A return value for a method handler can only be set once, it does not make sense to specify two or more values that should be returned when the method is invoked.

See Also:
Constant Field Values

CANT_SET_VOID_RETURN_VALUE

static final java.lang.String CANT_SET_VOID_RETURN_VALUE
If a method is of type void, it doesn't make sense to set a value that should be returned when the method is invoked.

See Also:
Constant Field Values

INCORRECT_RETURN_CLASS

static final java.lang.String INCORRECT_RETURN_CLASS
When setting the return value for a mocked method, the return value must be an instance of the class that is returned by the method.

See Also:
Constant Field Values

INCORRECT_THROWABLE_CLASS

static final java.lang.String INCORRECT_THROWABLE_CLASS
When setting an exception to be thrown by a mock object, the exception must be in accordance with the method's signature.

See Also:
Constant Field Values

WRONG_NUMBER_OF_ARGS

static final java.lang.String WRONG_NUMBER_OF_ARGS
When setting an expectation for a method invocation, the number of arguments specified in the expectation must agree with the number of arguments in the method's signature.

See Also:
Constant Field Values

WRONG_ARGUMENT_CLASS

static final java.lang.String WRONG_ARGUMENT_CLASS
When setting an expectation for a method invocation, the class of the arguments must agree with the method's signature.

See Also:
Constant Field Values

NO_RETURN_VALUE_SET

static final java.lang.String NO_RETURN_VALUE_SET
For a non-void method, one must specify a return value when setting an expectation that a method will be invoked.

See Also:
Constant Field Values

METHOD_INVOKED_UNEXPECTED_NUMBER_OF_TIMES

static final java.lang.String METHOD_INVOKED_UNEXPECTED_NUMBER_OF_TIMES
When verifying the behaviour of an object under test, it must invoke mock objects a certain number of times to satisfy the expectations.

See Also:
Constant Field Values

METHOD_INVOKED_TOO_MANY_TIMES

static final java.lang.String METHOD_INVOKED_TOO_MANY_TIMES
When verifying the behaviour of an object under test, it must invoke mock objects a certain number of times to satisfy the expectations.

Since:
Hammock 2.0
See Also:
Constant Field Values

METHOD_INVOKED_OUT_OF_SEQUENCE

static final java.lang.String METHOD_INVOKED_OUT_OF_SEQUENCE
For a strict mock object, methods must be invoked in the same order as specified in the expectations.

See Also:
Constant Field Values

INCORRECT_MOCK_OBJECT

static final java.lang.String INCORRECT_MOCK_OBJECT
An expectation was set that some method would be invoked on a mock object where the method is not applicable for the mock object's class.

See Also:
Constant Field Values

NUM_INVOCATIONS_ALREADY_SET

static final java.lang.String NUM_INVOCATIONS_ALREADY_SET
The expected number of invocations can only be set once for a handler.

See Also:
Constant Field Values

ARGUMENT_MATCHER_ALREADY_SET

static final java.lang.String ARGUMENT_MATCHER_ALREADY_SET
An argument matcher can only be set once for a particular argument for a method.

Since:
Hammock 1.4
See Also:
Constant Field Values