| Package | Description |
|---|---|
| org.hamcrest |
The stable API defining Matcher and its associated interfaces and classes.
|
| org.hamcrest.core |
Fundamental matchers of objects and values, and composite matchers.
|
| org.junit.internal |
| 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 |
Description.appendDescriptionOf(SelfDescribing value)
Appends the description of a
SelfDescribing value to this description. |
Description |
Description.NullDescription.appendDescriptionOf(SelfDescribing value) |
Description |
BaseDescription.appendDescriptionOf(SelfDescribing value) |
static String |
StringDescription.asString(SelfDescribing selfDescribing)
Alias for
StringDescription.toString(SelfDescribing). |
static String |
StringDescription.toString(SelfDescribing selfDescribing)
Return the description of a
SelfDescribing object as a String. |
| Modifier and Type | Method and Description |
|---|---|
Description |
Description.appendList(String start,
String separator,
String end,
Iterable<? extends SelfDescribing> values)
Appends a list of
SelfDescribing objects
to the description. |
Description |
Description.NullDescription.appendList(String start,
String separator,
String end,
Iterable<? extends SelfDescribing> values) |
Description |
BaseDescription.appendList(String start,
String separator,
String end,
Iterable<? extends SelfDescribing> values) |
| 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> |
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 and Description |
|---|---|
class |
org.junit.internal.AssumptionViolatedException
An exception class used to implement assumptions (state in which a given test
is meaningful and should or should not be executed).
|
Copyright © 2002–2020 JUnit. All rights reserved.