Package | Description |
---|---|
org.hamcrest | |
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.internal | |
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 | Interface and Description |
---|---|
interface |
Matcher<T>
A matcher over acceptable values.
|
Modifier and Type | Class and Description |
---|---|
class |
BaseMatcher<T>
BaseClass for all Matcher implementations.
|
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 | Method and Description |
---|---|
Description |
BaseDescription.appendDescriptionOf(SelfDescribing value) |
Description |
Description.appendDescriptionOf(SelfDescribing value)
Appends the description of a
SelfDescribing value to this description. |
Description |
Description.NullDescription.appendDescriptionOf(SelfDescribing value) |
static java.lang.String |
StringDescription.asString(SelfDescribing selfDescribing)
Alias for
StringDescription.toString(SelfDescribing) . |
static java.lang.String |
StringDescription.toString(SelfDescribing selfDescribing)
Return the description of a
SelfDescribing object as a String. |
Modifier and Type | Method and Description |
---|---|
Description |
BaseDescription.appendList(java.lang.String start,
java.lang.String separator,
java.lang.String end,
java.lang.Iterable<? extends SelfDescribing> values) |
Description |
Description.appendList(java.lang.String start,
java.lang.String separator,
java.lang.String end,
java.lang.Iterable<? extends SelfDescribing> values)
Appends a list of
SelfDescribing objects
to the description. |
Description |
Description.NullDescription.appendList(java.lang.String start,
java.lang.String separator,
java.lang.String end,
java.lang.Iterable<? extends SelfDescribing> values) |
Modifier and Type | Class and 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> |
Modifier and Type | Class and Description |
---|---|
class |
ArrayAsIterableMatcher<E> |
class |
HasItemInArray<T>
Matches if an array contains an item satisfying a nested matcher.
|
class |
IsArray<T>
Matcher for array whose elements satisfy a sequence of matchers.
|
class |
IsArrayContainingInAnyOrder<E>
Deprecated.
As of release 2.1, replaced by
ArrayMatching . |
class |
IsArrayContainingInOrder<E>
Deprecated.
As of release 2.1, replaced by
ArrayMatching . |
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 |
IsIterableContainingInRelativeOrder<E> |
class |
IsIterableWithSize<E> |
class |
IsMapContaining<K,V> |
class |
IsMapWithSize<K,V>
Matches if map size satisfies a nested matcher.
|
Modifier and Type | Class and 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>
Deprecated.
As of release 2.1, replaced by
IsIterableContaining . |
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 |
IsIterableContaining<T> |
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 specific substring.
|
class |
StringEndsWith
Tests if the argument is a string that ends with a specific substring.
|
class |
StringRegularExpression |
class |
StringStartsWith
Tests if the argument is a string that starts with a specific substring.
|
class |
SubstringMatcher |
Modifier and Type | Class and Description |
---|---|
class |
SelfDescribingValue<T> |
Modifier and Type | Method and Description |
---|---|
SelfDescribing |
SelfDescribingValueIterator.next() |
Modifier and Type | Class and Description |
---|---|
class |
BigDecimalCloseTo |
class |
IsCloseTo
Is the value a number equal to a value within some range of
acceptable error?
|
class |
IsNaN
Is the value a number actually not a number (NaN)?
|
Modifier and Type | Class and Description |
---|---|
class |
HasEqualValues<T> |
class |
HasToString<T> |
class |
IsCompatibleType<T> |
class |
IsEventFrom
Tests if the value is an event announced by a specific object.
|
Modifier and Type | Class and Description |
---|---|
class |
CharSequenceLength |
class |
IsBlankString
Matches blank Strings (and null).
|
class |
IsEmptyString
Matches empty Strings (and null).
|
class |
IsEqualCompressingWhiteSpace
Tests if a string is equal to another string, compressing any changes in whitespace.
|
class |
IsEqualIgnoringCase
Tests if a string is equal to another string, regardless of the case.
|
class |
MatchesPattern |
class |
StringContainsInOrder |
Modifier and Type | Class and Description |
---|---|
class |
HasXPath
Applies a Matcher to a given XML Node in an existing XML Node tree, specified by an XPath expression.
|