|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
Packages that use Matcher | |
---|---|
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 | Provides JUnit core classes and annotations. |
org.junit.experimental.results | |
org.junit.internal | |
org.junit.internal.matchers | |
org.junit.matchers | Provides useful additional Matcher s for use with
the Assert.assertThat(Object, org.hamcrest.Matcher)
statement |
org.junit.rules |
Uses of Matcher in org.hamcrest |
---|
Classes in org.hamcrest that implement Matcher | |
---|---|
class |
BaseMatcher<T>
BaseClass for all Matcher implementations. |
Methods in org.hamcrest that return Matcher | ||
---|---|---|
static
|
CoreMatchers.allOf(Iterable<Matcher<? extends T>> matchers)
Evaluates to true only if ALL of the passed in matchers evaluate to true. |
|
static
|
CoreMatchers.allOf(Matcher<? extends T>... matchers)
Evaluates to true only if ALL of the passed in matchers evaluate to true. |
|
static
|
CoreMatchers.any(Class<T> type)
This matcher always evaluates to true. |
|
static
|
CoreMatchers.anyOf(Iterable<Matcher<? extends T>> matchers)
Evaluates to true if ANY of the passed in matchers evaluate to true. |
|
static
|
CoreMatchers.anyOf(Matcher<? extends T>... matchers)
Evaluates to true if ANY of the passed in matchers evaluate to true. |
|
static
|
CoreMatchers.anything()
This matcher always evaluates to true. |
|
static
|
CoreMatchers.anything(String description)
This matcher always evaluates to true. |
|
static
|
CoreMatchers.describedAs(String description,
Matcher<T> matcher,
Object... values)
Wraps an existing matcher and overrides the description when it fails. |
|
static
|
CoreMatchers.equalTo(T operand)
Is the value equal to another value, as tested by the Object.equals(java.lang.Object) invokedMethod? |
|
static Matcher<Object> |
CoreMatchers.instanceOf(Class<?> type)
Is the value an instance of a particular type? |
|
static Matcher<Object> |
CoreMatchers.is(Class<?> type)
This is a shortcut to the frequently used is(instanceOf(SomeClass.class)). |
|
static
|
CoreMatchers.is(Matcher<T> matcher)
Decorates another Matcher, retaining the behavior but allowing tests to be slightly more expressive. |
|
static
|
CoreMatchers.is(T value)
This is a shortcut to the frequently used is(equalTo(x)). |
|
static
|
CoreMatchers.not(Matcher<T> matcher)
Inverts the rule. |
|
static
|
CoreMatchers.not(T value)
This is a shortcut to the frequently used not(equalTo(x)). |
|
static
|
CoreMatchers.notNullValue()
Matches if value is not null. |
|
static
|
CoreMatchers.notNullValue(Class<T> type)
Matches if value is not null. |
|
static
|
CoreMatchers.nullValue()
Matches if value is null. |
|
static
|
CoreMatchers.nullValue(Class<T> type)
Matches if value is null. |
|
static
|
CoreMatchers.sameInstance(T object)
Creates a new instance of IsSame |
Methods in org.hamcrest with parameters of type Matcher | ||
---|---|---|
static
|
CoreMatchers.allOf(Matcher<? extends T>... matchers)
Evaluates to true only if ALL of the passed in matchers evaluate to true. |
|
static
|
CoreMatchers.anyOf(Matcher<? extends T>... matchers)
Evaluates to true if ANY of the passed in matchers evaluate to true. |
|
static
|
CoreMatchers.describedAs(String description,
Matcher<T> matcher,
Object... values)
Wraps an existing matcher and overrides the description when it fails. |
|
static
|
CoreMatchers.is(Matcher<T> matcher)
Decorates another Matcher, retaining the behavior but allowing tests to be slightly more expressive. |
|
static
|
CoreMatchers.not(Matcher<T> matcher)
Inverts the rule. |
Method parameters in org.hamcrest with type arguments of type Matcher | ||
---|---|---|
static
|
CoreMatchers.allOf(Iterable<Matcher<? extends T>> matchers)
Evaluates to true only if ALL of the passed in matchers evaluate to true. |
|
static
|
CoreMatchers.anyOf(Iterable<Matcher<? extends T>> matchers)
Evaluates to true if ANY of the passed in matchers evaluate to true. |
Uses of Matcher in org.hamcrest.core |
---|
Classes in org.hamcrest.core that implement Matcher | |
---|---|
class |
AllOf<T>
Calculates the logical conjunction of two matchers. |
class |
AnyOf<T>
Calculates the logical disjunction of two matchers. |
class |
DescribedAs<T>
Provides a custom description to another matcher. |
class |
Is<T>
Decorates another Matcher, retaining the behavior but allowing tests to be slightly more expressive. |
class |
IsAnything<T>
A matcher that always returns true . |
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? |
Methods in org.hamcrest.core that return Matcher | ||
---|---|---|
static
|
AllOf.allOf(Iterable<Matcher<? extends T>> matchers)
Evaluates to true only if ALL of the passed in matchers evaluate to true. |
|
static
|
AllOf.allOf(Matcher<? extends T>... matchers)
Evaluates to true only if ALL of the passed in matchers evaluate to true. |
|
static
|
IsAnything.any(Class<T> type)
This matcher always evaluates to true. |
|
static
|
AnyOf.anyOf(Iterable<Matcher<? extends T>> matchers)
Evaluates to true if ANY of the passed in matchers evaluate to true. |
|
static
|
AnyOf.anyOf(Matcher<? extends T>... matchers)
Evaluates to true if ANY of the passed in matchers evaluate to true. |
|
static
|
IsAnything.anything()
This matcher always evaluates to true. |
|
static
|
IsAnything.anything(String description)
This matcher always evaluates to true. |
|
static
|
DescribedAs.describedAs(String description,
Matcher<T> matcher,
Object... values)
Wraps an existing matcher and overrides the description when it fails. |
|
static
|
IsEqual.equalTo(T operand)
Is the value equal to another value, as tested by the Object.equals(java.lang.Object) invokedMethod? |
|
static Matcher<Object> |
IsInstanceOf.instanceOf(Class<?> type)
Is the value an instance of a particular type? |
|
static Matcher<Object> |
Is.is(Class<?> type)
This is a shortcut to the frequently used is(instanceOf(SomeClass.class)). |
|
static
|
Is.is(Matcher<T> matcher)
Decorates another Matcher, retaining the behavior but allowing tests to be slightly more expressive. |
|
static
|
Is.is(T value)
This is a shortcut to the frequently used is(equalTo(x)). |
|
static
|
IsNot.not(Matcher<T> matcher)
Inverts the rule. |
|
static
|
IsNot.not(T value)
This is a shortcut to the frequently used not(equalTo(x)). |
|
static
|
IsNull.notNullValue()
Matches if value is not null. |
|
static
|
IsNull.notNullValue(Class<T> type)
Matches if value is not null. |
|
static
|
IsNull.nullValue()
Matches if value is null. |
|
static
|
IsNull.nullValue(Class<T> type)
Matches if value is null. |
|
static
|
IsSame.sameInstance(T object)
Creates a new instance of IsSame |
Methods in org.hamcrest.core with parameters of type Matcher | ||
---|---|---|
static
|
AllOf.allOf(Matcher<? extends T>... matchers)
Evaluates to true only if ALL of the passed in matchers evaluate to true. |
|
static
|
AnyOf.anyOf(Matcher<? extends T>... matchers)
Evaluates to true if ANY of the passed in matchers evaluate to true. |
|
static
|
DescribedAs.describedAs(String description,
Matcher<T> matcher,
Object... values)
Wraps an existing matcher and overrides the description when it fails. |
|
static
|
Is.is(Matcher<T> matcher)
Decorates another Matcher, retaining the behavior but allowing tests to be slightly more expressive. |
|
static
|
IsNot.not(Matcher<T> matcher)
Inverts the rule. |
Method parameters in org.hamcrest.core with type arguments of type Matcher | ||
---|---|---|
static
|
AllOf.allOf(Iterable<Matcher<? extends T>> matchers)
Evaluates to true only if ALL of the passed in matchers evaluate to true. |
|
static
|
AnyOf.anyOf(Iterable<Matcher<? extends T>> matchers)
Evaluates to true if ANY of the passed in matchers evaluate to true. |
Constructors in org.hamcrest.core with parameters of type Matcher | |
---|---|
DescribedAs(String descriptionTemplate,
Matcher<T> matcher,
Object[] values)
|
|
Is(Matcher<T> matcher)
|
|
IsNot(Matcher<T> matcher)
|
Constructor parameters in org.hamcrest.core with type arguments of type Matcher | |
---|---|
AllOf(Iterable<Matcher<? extends T>> matchers)
|
|
AnyOf(Iterable<Matcher<? extends T>> matchers)
|
Uses of Matcher in org.junit |
---|
Methods in org.junit with parameters of type Matcher | ||
---|---|---|
static
|
Assert.assertThat(String reason,
T actual,
Matcher<T> matcher)
Asserts that actual satisfies the condition specified by
matcher . |
|
static
|
Assert.assertThat(T actual,
Matcher<T> matcher)
Asserts that actual satisfies the condition specified by
matcher . |
|
static
|
Assume.assumeThat(T actual,
Matcher<T> matcher)
Call to assume that actual satisfies the condition specified by matcher . |
Uses of Matcher in org.junit.experimental.results |
---|
Methods in org.junit.experimental.results that return Matcher | |
---|---|
static Matcher<PrintableResult> |
ResultMatchers.failureCountIs(int count)
Matches if there are count failures |
static Matcher<PrintableResult> |
ResultMatchers.hasFailureContaining(String string)
Matches if the result has one or more failures, and at least one of them contains string |
static Matcher<Object> |
ResultMatchers.hasSingleFailureContaining(String string)
Matches if the result has exactly one failure, and it contains string |
static Matcher<PrintableResult> |
ResultMatchers.isSuccessful()
Matches if the tests are all successful |
Uses of Matcher in org.junit.internal |
---|
Constructors in org.junit.internal with parameters of type Matcher | |
---|---|
AssumptionViolatedException(Object value,
Matcher<?> matcher)
|
Uses of Matcher in org.junit.internal.matchers |
---|
Classes in org.junit.internal.matchers that implement Matcher | |
---|---|
class |
CombinableMatcher<T>
|
class |
IsCollectionContaining<T>
|
class |
StringContains
Tests if the argument is a string that contains a substring. |
class |
SubstringMatcher
|
class |
TypeSafeMatcher<T>
Convenient base class for Matchers that require a non-null value of a specific type. |
Methods in org.junit.internal.matchers that return Matcher | ||
---|---|---|
static Matcher<String> |
StringContains.containsString(String substring)
|
|
static
|
Each.each(Matcher<T> individual)
|
|
static
|
IsCollectionContaining.hasItem(Matcher<? extends T> elementMatcher)
|
|
static
|
IsCollectionContaining.hasItem(T element)
|
|
static
|
IsCollectionContaining.hasItems(Matcher<? extends T>... elementMatchers)
|
|
static
|
IsCollectionContaining.hasItems(T... elements)
|
Methods in org.junit.internal.matchers with parameters of type Matcher | ||
---|---|---|
CombinableMatcher<T> |
CombinableMatcher.and(Matcher<? extends T> matcher)
|
|
static
|
Each.each(Matcher<T> individual)
|
|
static
|
IsCollectionContaining.hasItem(Matcher<? extends T> elementMatcher)
|
|
static
|
IsCollectionContaining.hasItems(Matcher<? extends T>... elementMatchers)
|
|
CombinableMatcher<T> |
CombinableMatcher.or(Matcher<? extends T> matcher)
|
Constructors in org.junit.internal.matchers with parameters of type Matcher | |
---|---|
CombinableMatcher(Matcher<? extends T> matcher)
|
|
IsCollectionContaining(Matcher<? extends T> elementMatcher)
|
Uses of Matcher in org.junit.matchers |
---|
Methods in org.junit.matchers that return Matcher | ||
---|---|---|
static Matcher<String> |
JUnitMatchers.containsString(String substring)
|
|
static
|
JUnitMatchers.everyItem(Matcher<T> elementMatcher)
|
|
static
|
JUnitMatchers.hasItem(Matcher<? extends T> elementMatcher)
|
|
static
|
JUnitMatchers.hasItem(T element)
|
|
static
|
JUnitMatchers.hasItems(Matcher<? extends T>... elementMatchers)
|
|
static
|
JUnitMatchers.hasItems(T... elements)
|
Methods in org.junit.matchers with parameters of type Matcher | ||
---|---|---|
static
|
JUnitMatchers.both(Matcher<T> matcher)
This is useful for fluently combining matchers that must both pass. |
|
static
|
JUnitMatchers.either(Matcher<T> matcher)
This is useful for fluently combining matchers where either may pass, for example: |
|
static
|
JUnitMatchers.everyItem(Matcher<T> elementMatcher)
|
|
static
|
JUnitMatchers.hasItem(Matcher<? extends T> elementMatcher)
|
|
static
|
JUnitMatchers.hasItems(Matcher<? extends T>... elementMatchers)
|
Uses of Matcher in org.junit.rules |
---|
Methods in org.junit.rules with parameters of type Matcher | ||
---|---|---|
|
ErrorCollector.checkThat(T value,
Matcher<T> matcher)
Adds a failure to the table if matcher does not match value . |
|
void |
ExpectedException.expect(Matcher<?> matcher)
Adds matcher to the list of requirements for any thrown exception. |
|
void |
ExpectedException.expectMessage(Matcher<String> matcher)
Adds matcher to the list of requirements for the message
returned from any thrown exception. |
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |