|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
Packages that use Matcher | |
---|---|
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.integration | |
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. |
Uses of Matcher in org.hamcrest |
---|
Classes in org.hamcrest that implement Matcher | |
---|---|
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. |
Methods in org.hamcrest that return Matcher | ||
---|---|---|
static
|
Matchers.allOf(java.lang.Iterable<Matcher<? super T>> matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(java.lang.Iterable<Matcher<? super T>> matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.any(java.lang.Class<T> type)
Creates a matcher that matches when the examined object is an instance of the specified type ,
as determined by calling the Class.isInstance(Object) method on that type, passing the
the examined object. |
|
static
|
CoreMatchers.any(java.lang.Class<T> type)
Creates a matcher that matches when the examined object is an instance of the specified type ,
as determined by calling the Class.isInstance(Object) method on that type, passing the
the examined object. |
|
static Matcher<java.lang.Object> |
Matchers.anything()
Creates a matcher that always matches, regardless of the examined object. |
|
static Matcher<java.lang.Object> |
CoreMatchers.anything()
Creates a matcher that always matches, regardless of the examined object. |
|
static Matcher<java.lang.Object> |
Matchers.anything(java.lang.String description)
Creates a matcher that always matches, regardless of the examined object, but describes itself with the specified String . |
|
static Matcher<java.lang.Object> |
CoreMatchers.anything(java.lang.String description)
Creates a matcher that always matches, regardless of the examined object, but describes itself with the specified String . |
|
static
|
Matchers.arrayContaining(E... items)
Creates a matcher for arrays that matcheswhen each item in the examined array is logically equal to the corresponding item in the specified items. |
|
static
|
Matchers.arrayContaining(java.util.List<Matcher<? super E>> itemMatchers)
Creates a matcher for arrays that matches when each item in the examined array satisfies the corresponding matcher in the specified list of matchers. |
|
static
|
Matchers.arrayContaining(Matcher<? super E>... itemMatchers)
Creates a matcher for arrays that matches when each item in the examined array satisfies the corresponding matcher in the specified matchers. |
|
static
|
Matchers.arrayContainingInAnyOrder(java.util.Collection<Matcher<? super E>> itemMatchers)
Creates an order agnostic matcher for arrays that matches when each item in the examined array satisfies one matcher anywhere in the specified collection of matchers. |
|
static
|
Matchers.arrayContainingInAnyOrder(E... items)
Creates an order agnostic matcher for arrays that matches when each item in the examined array is logically equal to one item anywhere in the specified items. |
|
static
|
Matchers.arrayContainingInAnyOrder(Matcher<? super E>... itemMatchers)
Creates an order agnostic matcher for arrays that matches when each item in the examined array satisfies one matcher anywhere in the specified matchers. |
|
static
|
Matchers.arrayWithSize(int size)
Creates a matcher for arrays that matches when the length of the array
equals the specified size . |
|
static
|
Matchers.arrayWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
Creates a matcher for arrays that matches when the length of the array
satisfies the specified matcher. |
|
static Matcher<java.math.BigDecimal> |
Matchers.closeTo(java.math.BigDecimal operand,
java.math.BigDecimal error)
Creates a matcher of BigDecimal s that matches when an examined BigDecimal is equal
to the specified operand , within a range of +/- error . |
|
static Matcher<java.lang.Double> |
Matchers.closeTo(double operand,
double error)
Creates a matcher of Double s that matches when an examined double is equal
to the specified operand , within a range of +/- error . |
|
static
|
Matchers.comparesEqualTo(T value)
Creates a matcher of Comparable object that matches when the examined object is
equal to the specified value, as reported by the compareTo method of the
examined object. |
|
static
|
Matchers.contains(E... items)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields a series of items, each logically equal to the
corresponding item in the specified items. |
|
static
|
Matchers.contains(java.util.List<Matcher<? super E>> itemMatchers)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields a series of items, each satisfying the corresponding
matcher in the specified list of matchers. |
|
static
|
Matchers.contains(Matcher<? super E>... itemMatchers)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields a series of items, each satisfying the corresponding
matcher in the specified matchers. |
|
static
|
Matchers.contains(Matcher<? super E> itemMatcher)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields a single item that satisfies the specified matcher. |
|
static
|
Matchers.containsInAnyOrder(java.util.Collection<Matcher<? super T>> itemMatchers)
Creates an order agnostic matcher for Iterable s that matches when a single pass over
the examined Iterable yields a series of items, each satisfying one matcher anywhere
in the specified collection of matchers. |
|
static
|
Matchers.containsInAnyOrder(Matcher<? super E> itemMatcher)
Deprecated. use contains(Matcher super E> itemMatcher) instead |
|
static
|
Matchers.containsInAnyOrder(Matcher<? super T>... itemMatchers)
Creates an order agnostic matcher for Iterable s that matches when a single pass over
the examined Iterable yields a series of items, each satisfying one matcher anywhere
in the specified matchers. |
|
static
|
Matchers.containsInAnyOrder(T... items)
Creates an order agnostic matcher for Iterable s that matches when a single pass over
the examined Iterable yields a series of items, each logically equal to one item
anywhere in the specified items. |
|
static Matcher<java.lang.String> |
Matchers.containsString(java.lang.String substring)
Creates a matcher that matches if the examined String contains the specified
String anywhere. |
|
static Matcher<java.lang.String> |
CoreMatchers.containsString(java.lang.String substring)
Creates a matcher that matches if the examined String contains the specified
String anywhere. |
|
static
|
Matchers.describedAs(java.lang.String description,
Matcher<T> matcher,
java.lang.Object... values)
Wraps an existing matcher, overriding its description with that specified. |
|
static
|
CoreMatchers.describedAs(java.lang.String description,
Matcher<T> matcher,
java.lang.Object... values)
Wraps an existing matcher, overriding its description with that specified. |
|
static
|
Matchers.empty()
Creates a matcher for Collection s matching examined collections whose isEmpty
method returns true . |
|
static
|
Matchers.emptyArray()
Creates a matcher for arrays that matches when the length of the array
is zero. |
|
static
|
Matchers.emptyCollectionOf(java.lang.Class<E> type)
Creates a matcher for Collection s matching examined collections whose isEmpty
method returns true . |
|
static
|
Matchers.emptyIterable()
Creates a matcher for Iterable s matching examined iterables that yield no items. |
|
static
|
Matchers.emptyIterableOf(java.lang.Class<E> type)
Creates a matcher for Iterable s matching examined iterables that yield no items. |
|
static Matcher<java.lang.String> |
Matchers.endsWith(java.lang.String suffix)
Creates a matcher that matches if the examined String ends with the specified
String . |
|
static Matcher<java.lang.String> |
CoreMatchers.endsWith(java.lang.String suffix)
Creates a matcher that matches if the examined String ends with the specified
String . |
|
static
|
Matchers.equalTo(T operand)
Creates a matcher that matches when the examined object is logically equal to the specified operand , as determined by calling the Object.equals(java.lang.Object) method on
the examined object. |
|
static
|
CoreMatchers.equalTo(T operand)
Creates a matcher that matches when the examined object is logically equal to the specified operand , as determined by calling the Object.equals(java.lang.Object) method on
the examined object. |
|
static Matcher<java.lang.String> |
Matchers.equalToIgnoringCase(java.lang.String expectedString)
Creates a matcher of String that matches when the examined string is equal to
the specified expectedString, ignoring case. |
|
static Matcher<java.lang.String> |
Matchers.equalToIgnoringWhiteSpace(java.lang.String expectedString)
Creates a matcher of String that matches when the examined string is equal to
the specified expectedString, when whitespace differences are (mostly) ignored. |
|
static Matcher<java.util.EventObject> |
Matchers.eventFrom(java.lang.Class<? extends java.util.EventObject> eventClass,
java.lang.Object source)
Creates a matcher of EventObject that matches any object
derived from eventClass announced by source. |
|
static Matcher<java.util.EventObject> |
Matchers.eventFrom(java.lang.Object source)
Creates a matcher of EventObject that matches any EventObject
announced by source. |
|
static
|
Matchers.everyItem(Matcher<U> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields items that are all matched by the specified
itemMatcher . |
|
static
|
CoreMatchers.everyItem(Matcher<U> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields items that are all matched by the specified
itemMatcher . |
|
static
|
Matchers.greaterThan(T value)
Creates a matcher of Comparable object that matches when the examined object is
greater than the specified value, as reported by the compareTo method of the
examined object. |
|
static
|
Matchers.greaterThanOrEqualTo(T value)
Creates a matcher of Comparable object that matches when the examined object is
greater than or equal to the specified value, as reported by the compareTo method
of the examined object. |
|
static
|
Matchers.hasEntry(K key,
V value)
Creates a matcher for Map s matching when the examined Map contains
at least one entry whose key equals the specified key and whose value equals the
specified value . |
|
static
|
Matchers.hasEntry(Matcher<? super K> keyMatcher,
Matcher<? super V> valueMatcher)
Creates a matcher for Map s matching when the examined Map contains
at least one entry whose key satisfies the specified keyMatcher and whose
value satisfies the specified valueMatcher . |
|
static
|
Matchers.hasItem(Matcher<? super T> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields at least one item that is matched by the specified
itemMatcher . |
|
static
|
CoreMatchers.hasItem(Matcher<? super T> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields at least one item that is matched by the specified
itemMatcher . |
|
static
|
Matchers.hasItem(T item)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields at least one item that is equal to the specified
item . |
|
static
|
CoreMatchers.hasItem(T item)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields at least one item that is equal to the specified
item . |
|
static
|
Matchers.hasItemInArray(Matcher<? super T> elementMatcher)
Creates a matcher for arrays that matches when the examined array contains at least one item that is matched by the specified elementMatcher . |
|
static
|
Matchers.hasItemInArray(T element)
A shortcut to the frequently used hasItemInArray(equalTo(x)) . |
|
static
|
Matchers.hasItems(Matcher<? super T>... itemMatchers)
Creates a matcher for Iterable s that matches when consecutive passes over the
examined Iterable yield at least one item that is matched by the corresponding
matcher from the specified itemMatchers . |
|
static
|
CoreMatchers.hasItems(Matcher<? super T>... itemMatchers)
Creates a matcher for Iterable s that matches when consecutive passes over the
examined Iterable yield at least one item that is matched by the corresponding
matcher from the specified itemMatchers . |
|
static
|
Matchers.hasItems(T... items)
Creates a matcher for Iterable s that matches when consecutive passes over the
examined Iterable yield at least one item that is equal to the corresponding
item from the specified items . |
|
static
|
CoreMatchers.hasItems(T... items)
Creates a matcher for Iterable s that matches when consecutive passes over the
examined Iterable yield at least one item that is equal to the corresponding
item from the specified items . |
|
static
|
Matchers.hasKey(K key)
Creates a matcher for Map s matching when the examined Map contains
at least one key that is equal to the specified key. |
|
static
|
Matchers.hasKey(Matcher<? super K> keyMatcher)
Creates a matcher for Map s matching when the examined Map contains
at least one key that satisfies the specified matcher. |
|
static
|
Matchers.hasProperty(java.lang.String propertyName)
Creates a matcher that matches when the examined object has a JavaBean property with the specified name. |
|
static
|
Matchers.hasProperty(java.lang.String propertyName,
Matcher<?> valueMatcher)
Creates a matcher that matches when the examined object has a JavaBean property with the specified name whose value satisfies the specified matcher. |
|
static
|
Matchers.hasSize(int size)
Creates a matcher for Collection s that matches when the size() method returns
a value equal to the specified size . |
|
static
|
Matchers.hasSize(Matcher<? super java.lang.Integer> sizeMatcher)
Creates a matcher for Collection s that matches when the size() method returns
a value that satisfies the specified matcher. |
|
static
|
Matchers.hasToString(Matcher<? super java.lang.String> toStringMatcher)
Creates a matcher that matches any examined object whose toString method
returns a value that satisfies the specified matcher. |
|
static
|
Matchers.hasToString(java.lang.String expectedToString)
Creates a matcher that matches any examined object whose toString method
returns a value equalTo the specified string. |
|
static
|
Matchers.hasValue(Matcher<? super V> valueMatcher)
Creates a matcher for Map s matching when the examined Map contains
at least one value that satisfies the specified valueMatcher. |
|
static
|
Matchers.hasValue(V value)
Creates a matcher for Map s matching when the examined Map contains
at least one value that is equal to the specified value. |
|
static Matcher<org.w3c.dom.Node> |
Matchers.hasXPath(java.lang.String xPath)
Creates a matcher of Node s that matches when the examined node contains a node
at the specified xPath , with any content. |
|
static Matcher<org.w3c.dom.Node> |
Matchers.hasXPath(java.lang.String xPath,
Matcher<java.lang.String> valueMatcher)
Creates a matcher of Node s that matches when the examined node has a value at the
specified xPath that satisfies the specified valueMatcher . |
|
static Matcher<org.w3c.dom.Node> |
Matchers.hasXPath(java.lang.String xPath,
javax.xml.namespace.NamespaceContext namespaceContext)
Creates a matcher of Node s that matches when the examined node contains a node
at the specified xPath within the specified namespace context, with any content. |
|
static Matcher<org.w3c.dom.Node> |
Matchers.hasXPath(java.lang.String xPath,
javax.xml.namespace.NamespaceContext namespaceContext,
Matcher<java.lang.String> valueMatcher)
Creates a matcher of Node s that matches when the examined node has a value at the
specified xPath , within the specified namespaceContext , that satisfies
the specified valueMatcher . |
|
static
|
Matchers.instanceOf(java.lang.Class<?> type)
Creates a matcher that matches when the examined object is an instance of the specified type ,
as determined by calling the Class.isInstance(Object) method on that type, passing the
the examined object. |
|
static
|
CoreMatchers.instanceOf(java.lang.Class<?> type)
Creates a matcher that matches when the examined object is an instance of the specified type ,
as determined by calling the Class.isInstance(Object) method on that type, passing the
the examined object. |
|
static
|
Matchers.is(java.lang.Class<T> type)
Deprecated. use isA(Class |
|
static
|
CoreMatchers.is(java.lang.Class<T> type)
Deprecated. use isA(Class |
|
static
|
Matchers.is(Matcher<T> matcher)
Decorates another Matcher, retaining its behaviour, but allowing tests to be slightly more expressive. |
|
static
|
CoreMatchers.is(Matcher<T> matcher)
Decorates another Matcher, retaining its behaviour, but allowing tests to be slightly more expressive. |
|
static
|
Matchers.is(T value)
A shortcut to the frequently used is(equalTo(x)) . |
|
static
|
CoreMatchers.is(T value)
A shortcut to the frequently used is(equalTo(x)) . |
|
static
|
Matchers.isA(java.lang.Class<T> type)
A shortcut to the frequently used is(instanceOf(SomeClass.class)) . |
|
static
|
CoreMatchers.isA(java.lang.Class<T> type)
A shortcut to the frequently used is(instanceOf(SomeClass.class)) . |
|
static Matcher<java.lang.String> |
Matchers.isEmptyOrNullString()
Creates a matcher of String that matches when the examined string is null , or
has zero length. |
|
static Matcher<java.lang.String> |
Matchers.isEmptyString()
Creates a matcher of String that matches when the examined string has zero length. |
|
static
|
Matchers.isIn(java.util.Collection<T> collection)
Creates a matcher that matches when the examined object is found within the specified collection. |
|
static
|
Matchers.isIn(T[] param1)
|
|
static
|
Matchers.isOneOf(T... elements)
Creates a matcher that matches when the examined object is equal to one of the specified elements. |
|
static
|
Matchers.iterableWithSize(int size)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields an item count that is equal to the specified
size argument. |
|
static
|
Matchers.iterableWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields an item count that satisfies the specified
matcher. |
|
static
|
Matchers.lessThan(T value)
Creates a matcher of Comparable object that matches when the examined object is
less than the specified value, as reported by the compareTo method of the
examined object. |
|
static
|
Matchers.lessThanOrEqualTo(T value)
Creates a matcher of Comparable object that matches when the examined object is
less than or equal to the specified value, as reported by the compareTo method
of the examined object. |
|
static
|
Matchers.not(Matcher<T> matcher)
Creates a matcher that wraps an existing matcher, but inverts the logic by which it will match. |
|
static
|
CoreMatchers.not(Matcher<T> matcher)
Creates a matcher that wraps an existing matcher, but inverts the logic by which it will match. |
|
static
|
Matchers.not(T value)
A shortcut to the frequently used not(equalTo(x)) . |
|
static
|
CoreMatchers.not(T value)
A shortcut to the frequently used not(equalTo(x)) . |
|
static Matcher<java.lang.Object> |
Matchers.notNullValue()
A shortcut to the frequently used not(nullValue()) . |
|
static Matcher<java.lang.Object> |
CoreMatchers.notNullValue()
A shortcut to the frequently used not(nullValue()) . |
|
static
|
Matchers.notNullValue(java.lang.Class<T> type)
A shortcut to the frequently used not(nullValue(X.class)). |
|
static
|
CoreMatchers.notNullValue(java.lang.Class<T> type)
A shortcut to the frequently used not(nullValue(X.class)). |
|
static Matcher<java.lang.Object> |
Matchers.nullValue()
Creates a matcher that matches if examined object is null . |
|
static Matcher<java.lang.Object> |
CoreMatchers.nullValue()
Creates a matcher that matches if examined object is null . |
|
static
|
Matchers.nullValue(java.lang.Class<T> type)
Creates a matcher that matches if examined object is null . |
|
static
|
CoreMatchers.nullValue(java.lang.Class<T> type)
Creates a matcher that matches if examined object is null . |
|
static
|
Matchers.sameInstance(T target)
Creates a matcher that matches only when the examined object is the same instance as the specified target object. |
|
static
|
CoreMatchers.sameInstance(T target)
Creates a matcher that matches only when the examined object is the same instance as the specified target object. |
|
static
|
Matchers.samePropertyValuesAs(T expectedBean)
Creates a matcher that matches when the examined object has values for all of its JavaBean properties that are equal to the corresponding values of the specified bean. |
|
static Matcher<java.lang.String> |
Matchers.startsWith(java.lang.String prefix)
Creates a matcher that matches if the examined String starts with the specified
String . |
|
static Matcher<java.lang.String> |
CoreMatchers.startsWith(java.lang.String prefix)
Creates a matcher that matches if the examined String starts with the specified
String . |
|
static Matcher<java.lang.String> |
Matchers.stringContainsInOrder(java.lang.Iterable<java.lang.String> substrings)
Creates a matcher of String that matches when the examined string contains all of
the specified substrings, regardless of the order of their appearance. |
|
static
|
Matchers.theInstance(T target)
Creates a matcher that matches only when the examined object is the same instance as the specified target object. |
|
static
|
CoreMatchers.theInstance(T target)
Creates a matcher that matches only when the examined object is the same instance as the specified target object. |
|
static
|
Matchers.typeCompatibleWith(java.lang.Class<T> baseType)
Creates a matcher of Class that matches when the specified baseType is
assignable from the examined class. |
Methods in org.hamcrest with parameters of type Matcher | ||
---|---|---|
static
|
Matchers.allOf(Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.array(Matcher<? super T>... elementMatchers)
Creates a matcher that matches arrays whose elements are satisfied by the specified matchers. |
|
static
|
Matchers.arrayContaining(Matcher<? super E>... itemMatchers)
Creates a matcher for arrays that matches when each item in the examined array satisfies the corresponding matcher in the specified matchers. |
|
static
|
Matchers.arrayContainingInAnyOrder(Matcher<? super E>... itemMatchers)
Creates an order agnostic matcher for arrays that matches when each item in the examined array satisfies one matcher anywhere in the specified matchers. |
|
static
|
Matchers.arrayWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
Creates a matcher for arrays that matches when the length of the array
satisfies the specified matcher. |
|
static
|
MatcherAssert.assertThat(java.lang.String reason,
T actual,
Matcher<? super T> matcher)
|
|
static
|
MatcherAssert.assertThat(T actual,
Matcher<? super T> matcher)
|
|
static
|
Matchers.both(Matcher<? super LHS> matcher)
Creates a matcher that matches when both of the specified matchers match the examined object. |
|
static
|
CoreMatchers.both(Matcher<? super LHS> matcher)
Creates a matcher that matches when both of the specified matchers match the examined object. |
|
static
|
Matchers.contains(Matcher<? super E>... itemMatchers)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields a series of items, each satisfying the corresponding
matcher in the specified matchers. |
|
static
|
Matchers.contains(Matcher<? super E> itemMatcher)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields a single item that satisfies the specified matcher. |
|
static
|
Matchers.containsInAnyOrder(Matcher<? super E> itemMatcher)
Deprecated. use contains(Matcher super E> itemMatcher) instead |
|
static
|
Matchers.containsInAnyOrder(Matcher<? super T>... itemMatchers)
Creates an order agnostic matcher for Iterable s that matches when a single pass over
the examined Iterable yields a series of items, each satisfying one matcher anywhere
in the specified matchers. |
|
static
|
Matchers.describedAs(java.lang.String description,
Matcher<T> matcher,
java.lang.Object... values)
Wraps an existing matcher, overriding its description with that specified. |
|
static
|
CoreMatchers.describedAs(java.lang.String description,
Matcher<T> matcher,
java.lang.Object... values)
Wraps an existing matcher, overriding its description with that specified. |
|
static
|
Matchers.either(Matcher<? super LHS> matcher)
Creates a matcher that matches when either of the specified matchers match the examined object. |
|
static
|
CoreMatchers.either(Matcher<? super LHS> matcher)
Creates a matcher that matches when either of the specified matchers match the examined object. |
|
static
|
Matchers.everyItem(Matcher<U> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields items that are all matched by the specified
itemMatcher . |
|
static
|
CoreMatchers.everyItem(Matcher<U> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields items that are all matched by the specified
itemMatcher . |
|
static
|
Matchers.hasEntry(Matcher<? super K> keyMatcher,
Matcher<? super V> valueMatcher)
Creates a matcher for Map s matching when the examined Map contains
at least one entry whose key satisfies the specified keyMatcher and whose
value satisfies the specified valueMatcher . |
|
static
|
Matchers.hasEntry(Matcher<? super K> keyMatcher,
Matcher<? super V> valueMatcher)
Creates a matcher for Map s matching when the examined Map contains
at least one entry whose key satisfies the specified keyMatcher and whose
value satisfies the specified valueMatcher . |
|
static
|
Matchers.hasItem(Matcher<? super T> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields at least one item that is matched by the specified
itemMatcher . |
|
static
|
CoreMatchers.hasItem(Matcher<? super T> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields at least one item that is matched by the specified
itemMatcher . |
|
static
|
Matchers.hasItemInArray(Matcher<? super T> elementMatcher)
Creates a matcher for arrays that matches when the examined array contains at least one item that is matched by the specified elementMatcher . |
|
static
|
Matchers.hasItems(Matcher<? super T>... itemMatchers)
Creates a matcher for Iterable s that matches when consecutive passes over the
examined Iterable yield at least one item that is matched by the corresponding
matcher from the specified itemMatchers . |
|
static
|
CoreMatchers.hasItems(Matcher<? super T>... itemMatchers)
Creates a matcher for Iterable s that matches when consecutive passes over the
examined Iterable yield at least one item that is matched by the corresponding
matcher from the specified itemMatchers . |
|
static
|
Matchers.hasKey(Matcher<? super K> keyMatcher)
Creates a matcher for Map s matching when the examined Map contains
at least one key that satisfies the specified matcher. |
|
static
|
Matchers.hasProperty(java.lang.String propertyName,
Matcher<?> valueMatcher)
Creates a matcher that matches when the examined object has a JavaBean property with the specified name whose value satisfies the specified matcher. |
|
static
|
Matchers.hasSize(Matcher<? super java.lang.Integer> sizeMatcher)
Creates a matcher for Collection s that matches when the size() method returns
a value that satisfies the specified matcher. |
|
static
|
Matchers.hasToString(Matcher<? super java.lang.String> toStringMatcher)
Creates a matcher that matches any examined object whose toString method
returns a value that satisfies the specified matcher. |
|
static
|
Matchers.hasValue(Matcher<? super V> valueMatcher)
Creates a matcher for Map s matching when the examined Map contains
at least one value that satisfies the specified valueMatcher. |
|
static Matcher<org.w3c.dom.Node> |
Matchers.hasXPath(java.lang.String xPath,
Matcher<java.lang.String> valueMatcher)
Creates a matcher of Node s that matches when the examined node has a value at the
specified xPath that satisfies the specified valueMatcher . |
|
static Matcher<org.w3c.dom.Node> |
Matchers.hasXPath(java.lang.String xPath,
javax.xml.namespace.NamespaceContext namespaceContext,
Matcher<java.lang.String> valueMatcher)
Creates a matcher of Node s that matches when the examined node has a value at the
specified xPath , within the specified namespaceContext , that satisfies
the specified valueMatcher . |
|
static
|
Matchers.is(Matcher<T> matcher)
Decorates another Matcher, retaining its behaviour, but allowing tests to be slightly more expressive. |
|
static
|
CoreMatchers.is(Matcher<T> matcher)
Decorates another Matcher, retaining its behaviour, but allowing tests to be slightly more expressive. |
|
static
|
Matchers.iterableWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields an item count that satisfies the specified
matcher. |
|
boolean |
Condition.matching(Matcher<T> match)
|
|
abstract boolean |
Condition.matching(Matcher<T> match,
java.lang.String message)
|
|
static
|
Matchers.not(Matcher<T> matcher)
Creates a matcher that wraps an existing matcher, but inverts the logic by which it will match. |
|
static
|
CoreMatchers.not(Matcher<T> matcher)
Creates a matcher that wraps an existing matcher, but inverts the logic by which it will match. |
|
static
|
JavaLangMatcherAssert.that(T argument,
Matcher<? super T> matcher)
|
Method parameters in org.hamcrest with type arguments of type Matcher | ||
---|---|---|
static
|
Matchers.allOf(java.lang.Iterable<Matcher<? super T>> matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
CoreMatchers.allOf(java.lang.Iterable<Matcher<? super T>> matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
Matchers.anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CoreMatchers.anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
Matchers.arrayContaining(java.util.List<Matcher<? super E>> itemMatchers)
Creates a matcher for arrays that matches when each item in the examined array satisfies the corresponding matcher in the specified list of matchers. |
|
static
|
Matchers.arrayContainingInAnyOrder(java.util.Collection<Matcher<? super E>> itemMatchers)
Creates an order agnostic matcher for arrays that matches when each item in the examined array satisfies one matcher anywhere in the specified collection of matchers. |
|
static
|
Matchers.contains(java.util.List<Matcher<? super E>> itemMatchers)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields a series of items, each satisfying the corresponding
matcher in the specified list of matchers. |
|
static
|
Matchers.containsInAnyOrder(java.util.Collection<Matcher<? super T>> itemMatchers)
Creates an order agnostic matcher for Iterable s that matches when a single pass over
the examined Iterable yields a series of items, each satisfying one matcher anywhere
in the specified collection of matchers. |
Constructors in org.hamcrest with parameters of type Matcher | |
---|---|
FeatureMatcher(Matcher<? super U> subMatcher,
java.lang.String featureDescription,
java.lang.String featureName)
Constructor |
Uses of Matcher in org.hamcrest.beans |
---|
Classes in org.hamcrest.beans that implement Matcher | |
---|---|
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
|
Methods in org.hamcrest.beans that return Matcher | ||
---|---|---|
static
|
HasProperty.hasProperty(java.lang.String propertyName)
Creates a matcher that matches when the examined object has a JavaBean property with the specified name. |
|
static
|
HasPropertyWithValue.hasProperty(java.lang.String propertyName,
Matcher<?> valueMatcher)
Creates a matcher that matches when the examined object has a JavaBean property with the specified name whose value satisfies the specified matcher. |
|
static
|
SamePropertyValuesAs.samePropertyValuesAs(T expectedBean)
Creates a matcher that matches when the examined object has values for all of its JavaBean properties that are equal to the corresponding values of the specified bean. |
Methods in org.hamcrest.beans with parameters of type Matcher | ||
---|---|---|
static
|
HasPropertyWithValue.hasProperty(java.lang.String propertyName,
Matcher<?> valueMatcher)
Creates a matcher that matches when the examined object has a JavaBean property with the specified name whose value satisfies the specified matcher. |
Constructors in org.hamcrest.beans with parameters of type Matcher | |
---|---|
HasPropertyWithValue(java.lang.String propertyName,
Matcher<?> valueMatcher)
|
Uses of Matcher in org.hamcrest.collection |
---|
Classes in org.hamcrest.collection that implement Matcher | |
---|---|
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>
|
Methods in org.hamcrest.collection that return Matcher | ||
---|---|---|
static
|
IsArrayContainingInOrder.arrayContaining(E... items)
Creates a matcher for arrays that matcheswhen each item in the examined array is logically equal to the corresponding item in the specified items. |
|
static
|
IsArrayContainingInOrder.arrayContaining(java.util.List<Matcher<? super E>> itemMatchers)
Creates a matcher for arrays that matches when each item in the examined array satisfies the corresponding matcher in the specified list of matchers. |
|
static
|
IsArrayContainingInOrder.arrayContaining(Matcher<? super E>... itemMatchers)
Creates a matcher for arrays that matches when each item in the examined array satisfies the corresponding matcher in the specified matchers. |
|
static
|
IsArrayContainingInAnyOrder.arrayContainingInAnyOrder(java.util.Collection<Matcher<? super E>> itemMatchers)
Creates an order agnostic matcher for arrays that matches when each item in the examined array satisfies one matcher anywhere in the specified collection of matchers. |
|
static
|
IsArrayContainingInAnyOrder.arrayContainingInAnyOrder(E... items)
Creates an order agnostic matcher for arrays that matches when each item in the examined array is logically equal to one item anywhere in the specified items. |
|
static
|
IsArrayContainingInAnyOrder.arrayContainingInAnyOrder(Matcher<? super E>... itemMatchers)
Creates an order agnostic matcher for arrays that matches when each item in the examined array satisfies one matcher anywhere in the specified matchers. |
|
static
|
IsArrayWithSize.arrayWithSize(int size)
Creates a matcher for arrays that matches when the length of the array
equals the specified size . |
|
static
|
IsArrayWithSize.arrayWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
Creates a matcher for arrays that matches when the length of the array
satisfies the specified matcher. |
|
static
|
IsIterableContainingInOrder.contains(E... items)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields a series of items, each logically equal to the
corresponding item in the specified items. |
|
static
|
IsIterableContainingInOrder.contains(java.util.List<Matcher<? super E>> itemMatchers)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields a series of items, each satisfying the corresponding
matcher in the specified list of matchers. |
|
static
|
IsIterableContainingInOrder.contains(Matcher<? super E>... itemMatchers)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields a series of items, each satisfying the corresponding
matcher in the specified matchers. |
|
static
|
IsIterableContainingInOrder.contains(Matcher<? super E> itemMatcher)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields a single item that satisfies the specified matcher. |
|
static
|
IsIterableContainingInAnyOrder.containsInAnyOrder(java.util.Collection<Matcher<? super T>> itemMatchers)
Creates an order agnostic matcher for Iterable s that matches when a single pass over
the examined Iterable yields a series of items, each satisfying one matcher anywhere
in the specified collection of matchers. |
|
static
|
IsIterableContainingInAnyOrder.containsInAnyOrder(Matcher<? super E> itemMatcher)
Deprecated. use contains(Matcher super E> itemMatcher) instead |
|
static
|
IsIterableContainingInAnyOrder.containsInAnyOrder(Matcher<? super T>... itemMatchers)
Creates an order agnostic matcher for Iterable s that matches when a single pass over
the examined Iterable yields a series of items, each satisfying one matcher anywhere
in the specified matchers. |
|
static
|
IsIterableContainingInAnyOrder.containsInAnyOrder(T... items)
Creates an order agnostic matcher for Iterable s that matches when a single pass over
the examined Iterable yields a series of items, each logically equal to one item
anywhere in the specified items. |
|
static
|
IsEmptyCollection.empty()
Creates a matcher for Collection s matching examined collections whose isEmpty
method returns true . |
|
static
|
IsArrayWithSize.emptyArray()
Creates a matcher for arrays that matches when the length of the array
is zero. |
|
static
|
IsEmptyCollection.emptyCollectionOf(java.lang.Class<E> type)
Creates a matcher for Collection s matching examined collections whose isEmpty
method returns true . |
|
static
|
IsEmptyIterable.emptyIterable()
Creates a matcher for Iterable s matching examined iterables that yield no items. |
|
static
|
IsEmptyIterable.emptyIterableOf(java.lang.Class<E> type)
Creates a matcher for Iterable s matching examined iterables that yield no items. |
|
static
|
IsMapContaining.hasEntry(K key,
V value)
Creates a matcher for Map s matching when the examined Map contains
at least one entry whose key equals the specified key and whose value equals the
specified value . |
|
static
|
IsMapContaining.hasEntry(Matcher<? super K> keyMatcher,
Matcher<? super V> valueMatcher)
Creates a matcher for Map s matching when the examined Map contains
at least one entry whose key satisfies the specified keyMatcher and whose
value satisfies the specified valueMatcher . |
|
static
|
IsArrayContaining.hasItemInArray(Matcher<? super T> elementMatcher)
Creates a matcher for arrays that matches when the examined array contains at least one item that is matched by the specified elementMatcher . |
|
static
|
IsArrayContaining.hasItemInArray(T element)
A shortcut to the frequently used hasItemInArray(equalTo(x)) . |
|
static
|
IsMapContaining.hasKey(K key)
Creates a matcher for Map s matching when the examined Map contains
at least one key that is equal to the specified key. |
|
static
|
IsMapContaining.hasKey(Matcher<? super K> keyMatcher)
Creates a matcher for Map s matching when the examined Map contains
at least one key that satisfies the specified matcher. |
|
static
|
IsCollectionWithSize.hasSize(int size)
Creates a matcher for Collection s that matches when the size() method returns
a value equal to the specified size . |
|
static
|
IsCollectionWithSize.hasSize(Matcher<? super java.lang.Integer> sizeMatcher)
Creates a matcher for Collection s that matches when the size() method returns
a value that satisfies the specified matcher. |
|
static
|
IsMapContaining.hasValue(Matcher<? super V> valueMatcher)
Creates a matcher for Map s matching when the examined Map contains
at least one value that satisfies the specified valueMatcher. |
|
static
|
IsMapContaining.hasValue(V value)
Creates a matcher for Map s matching when the examined Map contains
at least one value that is equal to the specified value. |
|
static
|
IsIn.isIn(java.util.Collection<T> collection)
Creates a matcher that matches when the examined object is found within the specified collection. |
|
static
|
IsIn.isIn(T[] elements)
Creates a matcher that matches when the examined object is found within the specified array. |
|
static
|
IsIn.isOneOf(T... elements)
Creates a matcher that matches when the examined object is equal to one of the specified elements. |
|
static
|
IsIterableWithSize.iterableWithSize(int size)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields an item count that is equal to the specified
size argument. |
|
static
|
IsIterableWithSize.iterableWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields an item count that satisfies the specified
matcher. |
Methods in org.hamcrest.collection with parameters of type Matcher | ||
---|---|---|
static
|
IsArray.array(Matcher<? super T>... elementMatchers)
Creates a matcher that matches arrays whose elements are satisfied by the specified matchers. |
|
static
|
IsArrayContainingInOrder.arrayContaining(Matcher<? super E>... itemMatchers)
Creates a matcher for arrays that matches when each item in the examined array satisfies the corresponding matcher in the specified matchers. |
|
static
|
IsArrayContainingInAnyOrder.arrayContainingInAnyOrder(Matcher<? super E>... itemMatchers)
Creates an order agnostic matcher for arrays that matches when each item in the examined array satisfies one matcher anywhere in the specified matchers. |
|
static
|
IsArrayWithSize.arrayWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
Creates a matcher for arrays that matches when the length of the array
satisfies the specified matcher. |
|
static
|
IsIterableContainingInOrder.contains(Matcher<? super E>... itemMatchers)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields a series of items, each satisfying the corresponding
matcher in the specified matchers. |
|
static
|
IsIterableContainingInOrder.contains(Matcher<? super E> itemMatcher)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields a single item that satisfies the specified matcher. |
|
static
|
IsIterableContainingInAnyOrder.containsInAnyOrder(Matcher<? super E> itemMatcher)
Deprecated. use contains(Matcher super E> itemMatcher) instead |
|
static
|
IsIterableContainingInAnyOrder.containsInAnyOrder(Matcher<? super T>... itemMatchers)
Creates an order agnostic matcher for Iterable s that matches when a single pass over
the examined Iterable yields a series of items, each satisfying one matcher anywhere
in the specified matchers. |
|
static
|
IsMapContaining.hasEntry(Matcher<? super K> keyMatcher,
Matcher<? super V> valueMatcher)
Creates a matcher for Map s matching when the examined Map contains
at least one entry whose key satisfies the specified keyMatcher and whose
value satisfies the specified valueMatcher . |
|
static
|
IsMapContaining.hasEntry(Matcher<? super K> keyMatcher,
Matcher<? super V> valueMatcher)
Creates a matcher for Map s matching when the examined Map contains
at least one entry whose key satisfies the specified keyMatcher and whose
value satisfies the specified valueMatcher . |
|
static
|
IsArrayContaining.hasItemInArray(Matcher<? super T> elementMatcher)
Creates a matcher for arrays that matches when the examined array contains at least one item that is matched by the specified elementMatcher . |
|
static
|
IsMapContaining.hasKey(Matcher<? super K> keyMatcher)
Creates a matcher for Map s matching when the examined Map contains
at least one key that satisfies the specified matcher. |
|
static
|
IsCollectionWithSize.hasSize(Matcher<? super java.lang.Integer> sizeMatcher)
Creates a matcher for Collection s that matches when the size() method returns
a value that satisfies the specified matcher. |
|
static
|
IsMapContaining.hasValue(Matcher<? super V> valueMatcher)
Creates a matcher for Map s matching when the examined Map contains
at least one value that satisfies the specified valueMatcher. |
|
static
|
IsIterableWithSize.iterableWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields an item count that satisfies the specified
matcher. |
Method parameters in org.hamcrest.collection with type arguments of type Matcher | ||
---|---|---|
static
|
IsArrayContainingInOrder.arrayContaining(java.util.List<Matcher<? super E>> itemMatchers)
Creates a matcher for arrays that matches when each item in the examined array satisfies the corresponding matcher in the specified list of matchers. |
|
static
|
IsArrayContainingInAnyOrder.arrayContainingInAnyOrder(java.util.Collection<Matcher<? super E>> itemMatchers)
Creates an order agnostic matcher for arrays that matches when each item in the examined array satisfies one matcher anywhere in the specified collection of matchers. |
|
static
|
IsIterableContainingInOrder.contains(java.util.List<Matcher<? super E>> itemMatchers)
Creates a matcher for Iterable s that matches when a single pass over the
examined Iterable yields a series of items, each satisfying the corresponding
matcher in the specified list of matchers. |
|
static
|
IsIterableContainingInAnyOrder.containsInAnyOrder(java.util.Collection<Matcher<? super T>> itemMatchers)
Creates an order agnostic matcher for Iterable s that matches when a single pass over
the examined Iterable yields a series of items, each satisfying one matcher anywhere
in the specified collection of matchers. |
Constructors in org.hamcrest.collection with parameters of type Matcher | |
---|---|
IsArray(Matcher<? super T>[] elementMatchers)
|
|
IsArrayContaining(Matcher<? super T> elementMatcher)
|
|
IsArrayWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
|
|
IsCollectionWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
|
|
IsIterableWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
|
|
IsMapContaining(Matcher<? super K> keyMatcher,
Matcher<? super V> valueMatcher)
|
|
IsMapContaining(Matcher<? super K> keyMatcher,
Matcher<? super V> valueMatcher)
|
Constructor parameters in org.hamcrest.collection with type arguments of type Matcher | |
---|---|
IsArrayContainingInAnyOrder(java.util.Collection<Matcher<? super E>> matchers)
|
|
IsArrayContainingInOrder(java.util.List<Matcher<? super E>> matchers)
|
|
IsIterableContainingInAnyOrder(java.util.Collection<Matcher<? super T>> matchers)
|
|
IsIterableContainingInOrder(java.util.List<Matcher<? super E>> matchers)
|
Uses of Matcher in org.hamcrest.core |
---|
Classes in org.hamcrest.core that implement Matcher | |
---|---|
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
|
Methods in org.hamcrest.core that return Matcher | ||
---|---|---|
static
|
AllOf.allOf(java.lang.Iterable<Matcher<? super T>> matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
IsInstanceOf.any(java.lang.Class<T> type)
Creates a matcher that matches when the examined object is an instance of the specified type ,
as determined by calling the Class.isInstance(Object) method on that type, passing the
the examined object. |
|
static Matcher<java.lang.Object> |
IsAnything.anything()
Creates a matcher that always matches, regardless of the examined object. |
|
static Matcher<java.lang.Object> |
IsAnything.anything(java.lang.String description)
Creates a matcher that always matches, regardless of the examined object, but describes itself with the specified String . |
|
static Matcher<java.lang.String> |
StringContains.containsString(java.lang.String substring)
Creates a matcher that matches if the examined String contains the specified
String anywhere. |
|
static
|
DescribedAs.describedAs(java.lang.String description,
Matcher<T> matcher,
java.lang.Object... values)
Wraps an existing matcher, overriding its description with that specified. |
|
static Matcher<java.lang.String> |
StringEndsWith.endsWith(java.lang.String suffix)
Creates a matcher that matches if the examined String ends with the specified
String . |
|
static
|
IsEqual.equalTo(T operand)
Creates a matcher that matches when the examined object is logically equal to the specified operand , as determined by calling the Object.equals(java.lang.Object) method on
the examined object. |
|
static
|
Every.everyItem(Matcher<U> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields items that are all matched by the specified
itemMatcher . |
|
static
|
IsCollectionContaining.hasItem(Matcher<? super T> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields at least one item that is matched by the specified
itemMatcher . |
|
static
|
IsCollectionContaining.hasItem(T item)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields at least one item that is equal to the specified
item . |
|
static
|
IsCollectionContaining.hasItems(Matcher<? super T>... itemMatchers)
Creates a matcher for Iterable s that matches when consecutive passes over the
examined Iterable yield at least one item that is matched by the corresponding
matcher from the specified itemMatchers . |
|
static
|
IsCollectionContaining.hasItems(T... items)
Creates a matcher for Iterable s that matches when consecutive passes over the
examined Iterable yield at least one item that is equal to the corresponding
item from the specified items . |
|
static
|
IsInstanceOf.instanceOf(java.lang.Class<?> type)
Creates a matcher that matches when the examined object is an instance of the specified type ,
as determined by calling the Class.isInstance(Object) method on that type, passing the
the examined object. |
|
static
|
Is.is(java.lang.Class<T> type)
Deprecated. use isA(Class |
|
static
|
Is.is(Matcher<T> matcher)
Decorates another Matcher, retaining its behaviour, but allowing tests to be slightly more expressive. |
|
static
|
Is.is(T value)
A shortcut to the frequently used is(equalTo(x)) . |
|
static
|
Is.isA(java.lang.Class<T> type)
A shortcut to the frequently used is(instanceOf(SomeClass.class)) . |
|
static
|
IsNot.not(Matcher<T> matcher)
Creates a matcher that wraps an existing matcher, but inverts the logic by which it will match. |
|
static
|
IsNot.not(T value)
A shortcut to the frequently used not(equalTo(x)) . |
|
static Matcher<java.lang.Object> |
IsNull.notNullValue()
A shortcut to the frequently used not(nullValue()) . |
|
static
|
IsNull.notNullValue(java.lang.Class<T> type)
A shortcut to the frequently used not(nullValue(X.class)). |
|
static Matcher<java.lang.Object> |
IsNull.nullValue()
Creates a matcher that matches if examined object is null . |
|
static
|
IsNull.nullValue(java.lang.Class<T> type)
Creates a matcher that matches if examined object is null . |
|
static
|
IsSame.sameInstance(T target)
Creates a matcher that matches only when the examined object is the same instance as the specified target object. |
|
static Matcher<java.lang.String> |
StringStartsWith.startsWith(java.lang.String prefix)
Creates a matcher that matches if the examined String starts with the specified
String . |
|
static
|
IsSame.theInstance(T target)
Creates a matcher that matches only when the examined object is the same instance as the specified target object. |
Methods in org.hamcrest.core with parameters of type Matcher | ||
---|---|---|
static
|
AllOf.allOf(Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AllOf.allOf(Matcher<? super T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
CombinableMatcher<T> |
CombinableMatcher.and(Matcher<? super T> other)
|
|
CombinableMatcher<X> |
CombinableMatcher.CombinableBothMatcher.and(Matcher<? super X> other)
|
|
static
|
AnyOf.anyOf(Matcher<? super T>... matchers)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
AnyOf.anyOf(Matcher<T> first,
Matcher<? super T> second,
Matcher<? super T> third,
Matcher<? super T> fourth,
Matcher<? super T> fifth,
Matcher<? super T> sixth)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
|
static
|
CombinableMatcher.both(Matcher<? super LHS> matcher)
Creates a matcher that matches when both of the specified matchers match the examined object. |
|
static
|
DescribedAs.describedAs(java.lang.String description,
Matcher<T> matcher,
java.lang.Object... values)
Wraps an existing matcher, overriding its description with that specified. |
|
static
|
CombinableMatcher.either(Matcher<? super LHS> matcher)
Creates a matcher that matches when either of the specified matchers match the examined object. |
|
static
|
Every.everyItem(Matcher<U> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields items that are all matched by the specified
itemMatcher . |
|
static
|
IsCollectionContaining.hasItem(Matcher<? super T> itemMatcher)
Creates a matcher for Iterable s that only matches when a single pass over the
examined Iterable yields at least one item that is matched by the specified
itemMatcher . |
|
static
|
IsCollectionContaining.hasItems(Matcher<? super T>... itemMatchers)
Creates a matcher for Iterable s that matches when consecutive passes over the
examined Iterable yield at least one item that is matched by the corresponding
matcher from the specified itemMatchers . |
|
static
|
Is.is(Matcher<T> matcher)
Decorates another Matcher, retaining its behaviour, but allowing tests to be slightly more expressive. |
|
static
|
IsNot.not(Matcher<T> matcher)
Creates a matcher that wraps an existing matcher, but inverts the logic by which it will match. |
|
CombinableMatcher<T> |
CombinableMatcher.or(Matcher<? super T> other)
|
|
CombinableMatcher<X> |
CombinableMatcher.CombinableEitherMatcher.or(Matcher<? super X> other)
|
Method parameters in org.hamcrest.core with type arguments of type Matcher | ||
---|---|---|
static
|
AllOf.allOf(java.lang.Iterable<Matcher<? super T>> matchers)
Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
|
static
|
AnyOf.anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
Constructors in org.hamcrest.core with parameters of type Matcher | |
---|---|
CombinableMatcher.CombinableBothMatcher(Matcher<? super X> matcher)
|
|
CombinableMatcher.CombinableEitherMatcher(Matcher<? super X> matcher)
|
|
CombinableMatcher(Matcher<? super T> matcher)
|
|
DescribedAs(java.lang.String descriptionTemplate,
Matcher<T> matcher,
java.lang.Object[] values)
|
|
Every(Matcher<? super T> matcher)
|
|
Is(Matcher<T> matcher)
|
|
IsCollectionContaining(Matcher<? super T> elementMatcher)
|
|
IsNot(Matcher<T> matcher)
|
Constructor parameters in org.hamcrest.core with type arguments of type Matcher | |
---|---|
AllOf(java.lang.Iterable<Matcher<? super T>> matchers)
|
|
AnyOf(java.lang.Iterable<Matcher<? super T>> matchers)
|
Uses of Matcher in org.hamcrest.integration |
---|
Methods in org.hamcrest.integration with parameters of type Matcher | |
---|---|
static org.jmock.core.Constraint |
JMock1Adapter.adapt(Matcher<?> matcher)
Convenience factory method that will adapt a Hamcrest Matcher to act as an
jMock Constraint . |
static org.easymock.IArgumentMatcher |
EasyMock2Adapter.adapt(Matcher<?> matcher)
Convenience factory method that will adapt a Hamcrest Matcher to act as an
EasyMock IArgumentMatcher and
report it to EasyMock so it can be kept track of. |
Constructors in org.hamcrest.integration with parameters of type Matcher | |
---|---|
EasyMock2Adapter(Matcher<?> matcher)
|
|
JMock1Adapter(Matcher<?> matcher)
|
Uses of Matcher in org.hamcrest.number |
---|
Classes in org.hamcrest.number that implement Matcher | |
---|---|
class |
BigDecimalCloseTo
|
class |
IsCloseTo
Is the value a number equal to a value within some range of acceptable error? |
class |
OrderingComparison<T extends Comparable<T>>
|
Methods in org.hamcrest.number that return Matcher | ||
---|---|---|
static Matcher<java.math.BigDecimal> |
BigDecimalCloseTo.closeTo(java.math.BigDecimal operand,
java.math.BigDecimal error)
Creates a matcher of BigDecimal s that matches when an examined BigDecimal is equal
to the specified operand , within a range of +/- error . |
|
static Matcher<java.lang.Double> |
IsCloseTo.closeTo(double operand,
double error)
Creates a matcher of Double s that matches when an examined double is equal
to the specified operand , within a range of +/- error . |
|
static
|
OrderingComparison.comparesEqualTo(T value)
Creates a matcher of Comparable object that matches when the examined object is
equal to the specified value, as reported by the compareTo method of the
examined object. |
|
static
|
OrderingComparison.greaterThan(T value)
Creates a matcher of Comparable object that matches when the examined object is
greater than the specified value, as reported by the compareTo method of the
examined object. |
|
static
|
OrderingComparison.greaterThanOrEqualTo(T value)
Creates a matcher of Comparable object that matches when the examined object is
greater than or equal to the specified value, as reported by the compareTo method
of the examined object. |
|
static
|
OrderingComparison.lessThan(T value)
Creates a matcher of Comparable object that matches when the examined object is
less than the specified value, as reported by the compareTo method of the
examined object. |
|
static
|
OrderingComparison.lessThanOrEqualTo(T value)
Creates a matcher of Comparable object that matches when the examined object is
less than or equal to the specified value, as reported by the compareTo method
of the examined object. |
Uses of Matcher in org.hamcrest.object |
---|
Classes in org.hamcrest.object that implement Matcher | |
---|---|
class |
HasToString<T>
|
class |
IsCompatibleType<T>
|
class |
IsEventFrom
Tests if the value is an event announced by a specific object. |
Methods in org.hamcrest.object that return Matcher | ||
---|---|---|
static Matcher<java.util.EventObject> |
IsEventFrom.eventFrom(java.lang.Class<? extends java.util.EventObject> eventClass,
java.lang.Object source)
Creates a matcher of EventObject that matches any object
derived from eventClass announced by source. |
|
static Matcher<java.util.EventObject> |
IsEventFrom.eventFrom(java.lang.Object source)
Creates a matcher of EventObject that matches any EventObject
announced by source. |
|
static
|
HasToString.hasToString(Matcher<? super java.lang.String> toStringMatcher)
Creates a matcher that matches any examined object whose toString method
returns a value that satisfies the specified matcher. |
|
static
|
HasToString.hasToString(java.lang.String expectedToString)
Creates a matcher that matches any examined object whose toString method
returns a value equalTo the specified string. |
|
static
|
IsCompatibleType.typeCompatibleWith(java.lang.Class<T> baseType)
Creates a matcher of Class that matches when the specified baseType is
assignable from the examined class. |
Methods in org.hamcrest.object with parameters of type Matcher | ||
---|---|---|
static
|
HasToString.hasToString(Matcher<? super java.lang.String> toStringMatcher)
Creates a matcher that matches any examined object whose toString method
returns a value that satisfies the specified matcher. |
Constructors in org.hamcrest.object with parameters of type Matcher | |
---|---|
HasToString(Matcher<? super java.lang.String> toStringMatcher)
|
Uses of Matcher in org.hamcrest.text |
---|
Classes in org.hamcrest.text that implement Matcher | |
---|---|
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
|
Methods in org.hamcrest.text that return Matcher | |
---|---|
static Matcher<java.lang.String> |
IsEqualIgnoringCase.equalToIgnoringCase(java.lang.String expectedString)
Creates a matcher of String that matches when the examined string is equal to
the specified expectedString, ignoring case. |
static Matcher<java.lang.String> |
IsEqualIgnoringWhiteSpace.equalToIgnoringWhiteSpace(java.lang.String expectedString)
Creates a matcher of String that matches when the examined string is equal to
the specified expectedString, when whitespace differences are (mostly) ignored. |
static Matcher<java.lang.String> |
IsEmptyString.isEmptyOrNullString()
Creates a matcher of String that matches when the examined string is null , or
has zero length. |
static Matcher<java.lang.String> |
IsEmptyString.isEmptyString()
Creates a matcher of String that matches when the examined string has zero length. |
static Matcher<java.lang.String> |
StringContainsInOrder.stringContainsInOrder(java.lang.Iterable<java.lang.String> substrings)
Creates a matcher of String that matches when the examined string contains all of
the specified substrings, regardless of the order of their appearance. |
Uses of Matcher in org.hamcrest.xml |
---|
Classes in org.hamcrest.xml that implement Matcher | |
---|---|
class |
HasXPath
Applies a Matcher to a given XML Node in an existing XML Node tree, specified by an XPath expression. |
Methods in org.hamcrest.xml that return Matcher | |
---|---|
static Matcher<org.w3c.dom.Node> |
HasXPath.hasXPath(java.lang.String xPath)
Creates a matcher of Node s that matches when the examined node contains a node
at the specified xPath , with any content. |
static Matcher<org.w3c.dom.Node> |
HasXPath.hasXPath(java.lang.String xPath,
Matcher<java.lang.String> valueMatcher)
Creates a matcher of Node s that matches when the examined node has a value at the
specified xPath that satisfies the specified valueMatcher . |
static Matcher<org.w3c.dom.Node> |
HasXPath.hasXPath(java.lang.String xPath,
javax.xml.namespace.NamespaceContext namespaceContext)
Creates a matcher of Node s that matches when the examined node contains a node
at the specified xPath within the specified namespace context, with any content. |
static Matcher<org.w3c.dom.Node> |
HasXPath.hasXPath(java.lang.String xPath,
javax.xml.namespace.NamespaceContext namespaceContext,
Matcher<java.lang.String> valueMatcher)
Creates a matcher of Node s that matches when the examined node has a value at the
specified xPath , within the specified namespaceContext , that satisfies
the specified valueMatcher . |
Methods in org.hamcrest.xml with parameters of type Matcher | |
---|---|
static Matcher<org.w3c.dom.Node> |
HasXPath.hasXPath(java.lang.String xPath,
Matcher<java.lang.String> valueMatcher)
Creates a matcher of Node s that matches when the examined node has a value at the
specified xPath that satisfies the specified valueMatcher . |
static Matcher<org.w3c.dom.Node> |
HasXPath.hasXPath(java.lang.String xPath,
javax.xml.namespace.NamespaceContext namespaceContext,
Matcher<java.lang.String> valueMatcher)
Creates a matcher of Node s that matches when the examined node has a value at the
specified xPath , within the specified namespaceContext , that satisfies
the specified valueMatcher . |
Constructors in org.hamcrest.xml with parameters of type Matcher | |
---|---|
HasXPath(java.lang.String xPathExpression,
Matcher<java.lang.String> valueMatcher)
|
|
HasXPath(java.lang.String xPathExpression,
javax.xml.namespace.NamespaceContext namespaceContext,
Matcher<java.lang.String> valueMatcher)
|
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |