Package | Description |
---|---|
org.hamcrest |
The stable API defining Matcher and its associated interfaces and classes.
|
org.hamcrest.beans |
Matchers of Java Bean properties and their values.
|
org.hamcrest.collection |
Matchers of arrays and collections.
|
org.hamcrest.core |
Fundamental matchers of objects and values, and composite matchers.
|
org.hamcrest.number |
Matchers that perform numeric comparisons.
|
org.hamcrest.object |
Matchers that inspect objects and classes.
|
org.hamcrest.text |
Matchers that perform text comparisons.
|
org.hamcrest.xml |
Matchers of XML documents.
|
Modifier and Type | Class | Description |
---|---|---|
class |
CustomMatcher<T> |
Utility class for writing one off matchers.
|
class |
CustomTypeSafeMatcher<T> |
Utility class for writing one off matchers.
|
class |
DiagnosingMatcher<T> |
TODO(ngd): Document.
|
class |
FeatureMatcher<T,U> |
Supporting class for matching a feature of an object.
|
class |
TypeSafeDiagnosingMatcher<T> |
Convenient base class for Matchers that require a non-null value of a specific type
and that will report why the received value has been rejected.
|
class |
TypeSafeMatcher<T> |
Convenient base class for Matchers that require a non-null value of a specific type.
|
Modifier and Type | Class | Description |
---|---|---|
class |
HasProperty<T> |
A Matcher that checks that an object has a JavaBean property
with the specified name.
|
class |
HasPropertyWithValue<T> |
Matcher that asserts that a JavaBean property on an argument passed to the
mock object meets the provided matcher.
|
class |
SamePropertyValuesAs<T> |
|
static class |
SamePropertyValuesAs.PropertyMatcher |
Modifier and Type | Class | Description |
---|---|---|
class |
IsArray<T> |
Matcher for array whose elements satisfy a sequence of matchers.
|
class |
IsArrayContaining<T> |
Matches if an array contains an item satisfying a nested matcher.
|
class |
IsArrayContainingInAnyOrder<E> |
|
class |
IsArrayContainingInOrder<E> |
|
class |
IsArrayWithSize<E> |
Matches if array size satisfies a nested matcher.
|
class |
IsCollectionWithSize<E> |
Matches if collection size satisfies a nested matcher.
|
class |
IsEmptyCollection<E> |
Tests if collection is empty.
|
class |
IsEmptyIterable<E> |
Tests if collection is empty.
|
class |
IsIn<T> |
|
class |
IsIterableContainingInAnyOrder<T> |
|
class |
IsIterableContainingInOrder<E> |
|
class |
IsIterableWithSize<E> |
|
class |
IsMapContaining<K,V> |
Modifier and Type | Class | Description |
---|---|---|
class |
AllOf<T> |
Calculates the logical conjunction of multiple matchers.
|
class |
AnyOf<T> |
Calculates the logical disjunction of multiple matchers.
|
class |
CombinableMatcher<T> |
|
class |
DescribedAs<T> |
Provides a custom description to another matcher.
|
class |
Every<T> |
|
class |
Is<T> |
Decorates another Matcher, retaining the behaviour but allowing tests
to be slightly more expressive.
|
class |
IsAnything<T> |
A matcher that always returns
true . |
class |
IsCollectionContaining<T> |
|
class |
IsEqual<T> |
Is the value equal to another value, as tested by the
Object.equals(java.lang.Object) invokedMethod? |
class |
IsInstanceOf |
Tests whether the value is an instance of a class.
|
class |
IsNot<T> |
Calculates the logical negation of a matcher.
|
class |
IsNull<T> |
Is the value null?
|
class |
IsSame<T> |
Is the value the same object as another value?
|
class |
StringContains |
Tests if the argument is a string that contains a substring.
|
class |
StringEndsWith |
Tests if the argument is a string that contains a substring.
|
class |
StringStartsWith |
Tests if the argument is a string that contains a substring.
|
class |
SubstringMatcher |
Modifier and Type | Class | Description |
---|---|---|
class |
BigDecimalCloseTo |
|
class |
IsCloseTo |
Is the value a number equal to a value within some range of
acceptable error?
|
class |
OrderingComparison<T extends java.lang.Comparable<T>> |
Modifier and Type | Class | Description |
---|---|---|
class |
HasToString<T> |
|
class |
IsCompatibleType<T> |
|
class |
IsEventFrom |
Tests if the value is an event announced by a specific object.
|
Modifier and Type | Class | Description |
---|---|---|
class |
IsEmptyString |
Matches empty Strings (and null).
|
class |
IsEqualIgnoringCase |
Tests if a string is equal to another string, regardless of the case.
|
class |
IsEqualIgnoringWhiteSpace |
Tests if a string is equal to another string, ignoring any changes in whitespace.
|
class |
StringContainsInOrder |
Modifier and Type | Class | Description |
---|---|---|
class |
HasXPath |
Applies a Matcher to a given XML Node in an existing XML Node tree, specified by an XPath expression.
|