Package org.jmock.core

# Class MockObjectSupportTestCase

java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.jmock.core.VerifyingTestCase
org.jmock.core.MockObjectSupportTestCase

All Implemented Interfaces:
  `junit.framework.Test`

Direct Known Subclasses:
  `MockObjectTestCase`

public abstract class MockObjectSupportTestCase extends VerifyingTestCase

Since:
  1.0

## Field Summary

Fields
Modifier and Type
Field
Description
`static final Constraint`
`ANYTHING`
`static final Constraint`
`NOT_NULL`
`static final Constraint`
`NULL`

## Constructor Summary

Constructors
Constructor
Description
`MockObjectSupportTestCase()`
`MockObjectSupportTestCase(String name)`

## Method Summary

Modifier and Type
Method
Description
`And`
`and(Constraint left, Constraint right)`
`IsArrayContaining`
`arrayContaining(boolean element)`
`IsArrayContaining`
`arrayContaining(byte element)`
`IsArrayContaining`
`arrayContaining(char element)`
`IsArrayContaining`
`arrayContaining(double element)`
`IsArrayContaining`
`arrayContaining(float element)`
`IsArrayContaining`
`arrayContaining(int element)`
`IsArrayContaining`
`arrayContaining(long element)`
`IsArrayContaining`
`arrayContaining(short element)`
`IsArrayContaining`
`arrayContaining(Object element)`
`IsArrayContaining`
`arrayContaining(Constraint elementConstraint)`
`void`
`assertThat(boolean actual, Constraint constraint)`
`void`
`assertThat(byte actual, Constraint constraint)`
`void`
`assertThat(char actual, Constraint constraint)`
`void`
`assertThat(double actual, Constraint constraint)`
`void`
`assertThat(float actual, Constraint constraint)`
`void`
`assertThat(int actual, Constraint constraint)`
`void`
`assertThat(long actual, Constraint constraint)`
`void`
`assertThat(short actual, Constraint constraint)`
`void`
`assertThat(Object actual, Constraint constraint)`
`IsCollectionContaining`
`collectionContaining(Object element)`
`IsCollectionContaining`
`collectionContaining(Constraint elementConstraint)`
`IsCompatibleType`
`compatibleType(Class baseType)`
`StringContains`
`contains(String substring)`
`StringEndsWith`
`endsWith(String substring)`
`IsEqual`
`eq(boolean operand)`
`IsEqual`
`eq(byte operand)`
`IsEqual`
`eq(char operand)`
`IsEqual`
`eq(double operand)`
`IsCloseTo`
`eq(double operand, double error)`
`IsEqual`
`eq(float operand)`
`IsEqual`
`eq(int operand)`
`IsEqual`
`eq(long operand)`
`IsEqual`
`eq(short operand)`
`IsEqual`
`eq(Object operand)`
`HasProperty`
`hasProperty(String propertyName)`
`HasPropertyWithValue`
`hasProperty(String propertyName, Constraint expectation)`
`IsInstanceOf`
`isA(Class operandClass)`
`IsIn`
`isIn(Object[] array)`
`IsIn`
`isIn(Collection collection)`
`IsMapContaining`
`mapContaining(Object key, Object value)`
`IsMapContaining`
`mapContaining(Constraint keyConstraint, Constraint valueConstraint)`
`IsMapContaining`
`mapWithKey(Object key)`
`IsMapContaining`
`mapWithKey(Constraint keyConstraint)`
`IsMapContaining`
`mapWithValue(Object value)`
`IsMapContaining`
`mapWithValue(Constraint valueConstraint)`
`Object`
`newDummy(Class dummyType)`
Deprecated.
Use MockObjectTestCase.newDummy instead
`Object`
`newDummy(Class dummyType, String name)`
Deprecated.
Use MockObjectTestCase.newDummy instead
`Object`
`newDummy(String name)`
Deprecated.
Use MockObjectTestCase.newDummy instead
`IsNot`
`not(Constraint c)`
`Or`
`or(Constraint left, Constraint right)`
`IsSame`
`same(Object operand)`
`StringStartsWith`
`startsWith(String substring)`
`StringContains`
`stringContains(String substring)`
`HasToString`
`toString(Constraint toStringConstraint)`

### Methods inherited from class org.jmock.core.VerifyingTestCase

`registerToVerify, runBare, unregisterToVerify, verify`

### Methods inherited from class junit.framework.TestCase

`countTestCases, createResult, getName, run, run, 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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### ANYTHING

public static final Constraint ANYTHING

### NULL

public static final Constraint NULL

### NOT_NULL

public static final Constraint NOT_NULL

## Constructor Details

### MockObjectSupportTestCase

public MockObjectSupportTestCase()

### MockObjectSupportTestCase

public MockObjectSupportTestCase(String name)

## Method Details

### eq

public IsEqual eq(Object operand)

### eq

public IsEqual eq(boolean operand)

### eq

public IsEqual eq(byte operand)

### eq

public IsEqual eq(short operand)

### eq

public IsEqual eq(char operand)

### eq

public IsEqual eq(int operand)

### eq

public IsEqual eq(long operand)

### eq

public IsEqual eq(float operand)

### eq

public IsEqual eq(double operand)

### eq

public IsCloseTo eq(double operand, double error)

### same

public IsSame same(Object operand)

### isA

public IsInstanceOf isA(Class operandClass)

### stringContains

public StringContains stringContains(String substring)

### contains

public StringContains contains(String substring)

Since:
  1.1.0

### startsWith

public StringStartsWith startsWith(String substring)

Since:
  1.1.0

### endsWith

public StringEndsWith endsWith(String substring)

Since:
  1.1.0

### not

public IsNot not(Constraint c)

### and

public And and(Constraint left, Constraint right)

### or

public Or or(Constraint left, Constraint right)

### newDummy

public Object newDummy(Class dummyType)
Deprecated.
Use MockObjectTestCase.newDummy instead

### newDummy

public Object newDummy(Class dummyType, String name)
Deprecated.
Use MockObjectTestCase.newDummy instead

### newDummy

public Object newDummy(String name)
Deprecated.
Use MockObjectTestCase.newDummy instead

### assertThat

public void assertThat(Object actual, Constraint constraint)

Since:
  1.0.1

### assertThat

public void assertThat(boolean actual, Constraint constraint)

### assertThat

public void assertThat(byte actual, Constraint constraint)

### assertThat

public void assertThat(short actual, Constraint constraint)

### assertThat

public void assertThat(char actual, Constraint constraint)

### assertThat

public void assertThat(int actual, Constraint constraint)

### assertThat

public void assertThat(long actual, Constraint constraint)

### assertThat

public void assertThat(float actual, Constraint constraint)

### assertThat

public void assertThat(double actual, Constraint constraint)

### hasProperty

public HasPropertyWithValue hasProperty(String propertyName, Constraint expectation)

Since:
  1.1.0

### hasProperty

public HasProperty hasProperty(String propertyName)

Since:
  1.1.0

### toString

public HasToString toString(Constraint toStringConstraint)

Since:
  1.1.0

### compatibleType

public IsCompatibleType compatibleType(Class baseType)

Since:
  1.1.0

### isIn

public IsIn isIn(Collection collection)

Since:
  1.1.0

### isIn

public IsIn isIn(Object[] array)

Since:
  1.1.0

### collectionContaining

public IsCollectionContaining collectionContaining(Constraint elementConstraint)

Since:
  1.1.0

### collectionContaining

public IsCollectionContaining collectionContaining(Object element)

Since:
  1.1.0

### arrayContaining

public IsArrayContaining arrayContaining(Constraint elementConstraint)

Since:
  1.1.0

### arrayContaining

public IsArrayContaining arrayContaining(Object element)

Since:
  1.1.0

### arrayContaining

public IsArrayContaining arrayContaining(boolean element)

Since:
  1.1.0

### arrayContaining

public IsArrayContaining arrayContaining(byte element)

Since:
  1.1.0

### arrayContaining

public IsArrayContaining arrayContaining(short element)

Since:
  1.1.0

### arrayContaining

public IsArrayContaining arrayContaining(char element)

Since:
  1.1.0

### arrayContaining

public IsArrayContaining arrayContaining(int element)

Since:
  1.1.0

### arrayContaining

public IsArrayContaining arrayContaining(long element)

Since:
  1.1.0

### arrayContaining

public IsArrayContaining arrayContaining(float element)

Since:
  1.1.0

### arrayContaining

public IsArrayContaining arrayContaining(double element)

Since:
  1.1.0

### mapContaining

public IsMapContaining mapContaining(Constraint keyConstraint, Constraint valueConstraint)

Since:
  1.1.0

### mapContaining

public IsMapContaining mapContaining(Object key, Object value)

Since:
  1.1.0

### mapWithKey

public IsMapContaining mapWithKey(Object key)

Since:
  1.1.0

### mapWithKey

public IsMapContaining mapWithKey(Constraint keyConstraint)

Since:
  1.1.0

### mapWithValue

public IsMapContaining mapWithValue(Object value)

Since:
  1.1.0

### mapWithValue

public IsMapContaining mapWithValue(Constraint valueConstraint)

Since:
  1.1.0