Java Hamcrest
+ Matchers that can be combined to create flexible expressions of intent
+Downloads
+-
+
- Java Hamcrest Binaries (via Maven Central), explained here +
- Source Repository +
- Project License +
- Extensions +
From 4ec050966446ade767bebeace11f269521984067 Mon Sep 17 00:00:00 2001
From: scarytom
+
+The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:
+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
+
+
+Each annotation type has its own separate page with the following sections:
+Each enum has its own separate page with the following sections:
+
+
+
+
+This help file applies to API documentation generated using the standard doclet.
+
+
+A
+
+
+
+
+
+
+
+
+
+
+
+BaseClass for all Matcher implementations.
+
+
+
+
+
+
+
+
+A Condition implements part of a multi-step match. We sometimes need to write matchers
+ that have a sequence of steps, where each step depends on the result of the previous
+ step and we can stop processing as soon as a step fails. These classes provide
+ infrastructure for writing such a sequence.
+
+ Based on https://github.com/npryce/maybe-java
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ If the specified operand is The created matcher provides a special behaviour when examining
+ The created matcher forces a relationship between specified type and the examined object, and should be
+ used when it is necessary to make generics conform, for example in the JMock clause
+
+ The created matcher assumes no relationship between specified type and the examined object.
+
+
+
+
+
+
+
+
+
+
+
+
+Utility class for writing one off matchers.
+ For example:
+
+ This class is designed for scenarios where an anonymous inner class
+ matcher makes sense. It should not be used by API designers implementing
+ matchers.
+
+
+
+
+
+Utility class for writing one off matchers.
+ For example:
+
+
+
+
+
+
+
+
+
+
+
+
+A description of a Matcher. A Matcher will describe itself to a description
+ which can later be used for reporting.
+
+
+
+
+
+
+
+
+
+
+
+TODO(ngd): Document.
+
+
+
+
+
+
+
+Marks a Hamcrest static factory method so tools recognise them.
+ A factory method is an equivalent to a named constructor.
+
+
+
+
+
+
+
+
+Supporting class for matching a feature of an object. Implement
+
+
+
+
+
+
+
+
+Integration method for use with Java's
+
+
+
+A matcher over acceptable values.
+ A matcher is able to describe itself to give feedback when it fails.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ If the specified operand is The created matcher provides a special behaviour when examining
+ The created matcher forces a relationship between specified type and the examined object, and should be
+ used when it is necessary to make generics conform, for example in the JMock clause
+
+ The created matcher assumes no relationship between specified type and the examined object.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ For example:
+
+
+ For example:
+
+
+ For example:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Java HamcrestMatchers that can be combined to create flexible expressions of intent
+ Downloads
+
+
+ Documentation
+
+ User Support
+
+
+
+
+
+
From bb0ec49416ffe4cd4bd1e29e0c4f6b71f85bd1a7 Mon Sep 17 00:00:00 2001
From: scarytom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV
+ NEXT
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+Constant Field Values
+
+Contents
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV
+ NEXT
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+
diff --git a/javadoc/1.3/deprecated-list.html b/javadoc/1.3/deprecated-list.html
new file mode 100644
index 000000000..260fc82d1
--- /dev/null
+++ b/javadoc/1.3/deprecated-list.html
@@ -0,0 +1,191 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV
+ NEXT
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+Deprecated API
+
+Contents
+
+
+
+
+
+
+
+
+Deprecated Methods
+
+
+org.hamcrest.Matcher._dont_implement_Matcher___instead_extend_BaseMatcher_()
+
+
+ to make
+
+org.hamcrest.BaseMatcher._dont_implement_Matcher___instead_extend_BaseMatcher_()
+
+
+
+
+org.hamcrest.Matchers.containsInAnyOrder(Matcher super E>)
+
+
+ use contains(Matcher super E> itemMatcher) instead
+
+org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder(Matcher super E>)
+
+
+ use contains(Matcher super E> itemMatcher) instead
+
+org.hamcrest.Matchers.is(Class
+
+ use isA(Class
+
+org.hamcrest.CoreMatchers.is(Class
+
+ use isA(Class
+
+org.hamcrest.core.Is.is(Class
+
+ use isA(Class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV
+ NEXT
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+
diff --git a/javadoc/1.3/help-doc.html b/javadoc/1.3/help-doc.html
new file mode 100644
index 000000000..e7f01c0fb
--- /dev/null
+++ b/javadoc/1.3/help-doc.html
@@ -0,0 +1,223 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV
+ NEXT
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+How This API Document Is Organized
+
+Overview
+
+
+
+
+Package
+
+
+
+
+
+
+Class/Interface
+
+
+
+
+
+
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+Annotation Type
+
+
+
+
+
+
+
+Enum
+
+
+
+
+
+
+Use
+
+Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
+
+Tree (Class Hierarchy)
+
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with
+java.lang.Object. The interfaces do not inherit from java.lang.Object.
+
+
+Deprecated API
+
+The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+
+Index
+
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+
+Prev/Next
+These links take you to the next or previous class, interface, package, or related page.
+Frames/No Frames
+These links show and hide the HTML frames. All pages are available with or without frames.
+
+Serialized Form
+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
+
+Constant Field Values
+The Constant Field Values page lists the static final fields and their values.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV
+ NEXT
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+
diff --git a/javadoc/1.3/index-all.html b/javadoc/1.3/index-all.html
new file mode 100644
index 000000000..40ed7de90
--- /dev/null
+++ b/javadoc/1.3/index-all.html
@@ -0,0 +1,2032 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+A B C D E F G H I J L M N O P R S T _
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV
+ NEXT
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+A
+
+
+Matcher to act as an
+ EasyMock IArgumentMatcher and
+ report it to EasyMock so it can be kept track of.
+Matcher to act as an
+ jMock Constraint.
+type,
+ as determined by calling the Class.isInstance(Object) method on that type, passing the
+ the examined object.
+type,
+ as determined by calling the Class.isInstance(Object) method on that type, passing the
+ the examined object.
+type,
+ as determined by calling the Class.isInstance(Object) method on that type, passing the
+ the examined object.
+String.
+String.
+String.
+SelfDescribing value to this description.
+SelfDescribing objects
+ to the description.
+length of the array
+ satisfies the specified matcher.
+length of the array
+ equals the specified size.
+length of the array
+ satisfies the specified matcher.
+length of the array
+ equals the specified size.
+StringDescription.toString(SelfDescribing).
+
+
+B
+
+
+Description that is stored as a string.
+
+C
+
+
+Doubles that matches when an examined double is equal
+ to the specified operand, within a range of +/- error.
+BigDecimals that matches when an examined BigDecimal is equal
+ to the specified operand, within a range of +/- error.
+BigDecimals that matches when an examined BigDecimal is equal
+ to the specified operand, within a range of +/- error.
+Doubles that matches when an examined double is equal
+ to the specified operand, within a range of +/- error.
+Comparable object that matches when the examined object is
+ equal to the specified value, as reported by the compareTo method of the
+ examined object.
+Comparable object that matches when the examined object is
+ equal to the specified value, as reported by the compareTo method of the
+ examined object.
+Iterables 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.
+Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
+Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, each satisfying the corresponding
+ matcher in the specified matchers.
+Iterables 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.
+Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, each satisfying the corresponding
+ matcher in the specified matchers.
+Iterables 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.
+Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
+Iterables 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.
+Iterables that matches when a single pass over
+ the examined Iterable yields a series of items, each satisfying one matcher anywhere
+ in the specified matchers.
+Iterables 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.
+Iterables 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.
+Iterables 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.
+Iterables 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.
+Iterables that matches when a single pass over
+ the examined Iterable yields a series of items, each satisfying one matcher anywhere
+ in the specified matchers.
+String contains the specified
+ String anywhere.
+String contains the specified
+ String anywhere.
+String contains the specified
+ String anywhere.
+
+
+D
+
+
+
+
+E
+
+
+Matcher
+ to act as an EasyMock IArgumentMatcher.Collections matching examined collections whose isEmpty
+ method returns true.
+Collections matching examined collections whose isEmpty
+ method returns true.
+length of the array
+ is zero.
+length of the array
+ is zero.
+Collections matching examined collections whose isEmpty
+ method returns true.
+Collections matching examined collections whose isEmpty
+ method returns true.
+Iterables matching examined iterables that yield no items.
+Iterables matching examined iterables that yield no items.
+Iterables matching examined iterables that yield no items.
+Iterables matching examined iterables that yield no items.
+String ends with the specified
+ String.
+String ends with the specified
+ String.
+String ends with the specified
+ String.
+operand, as determined by calling the Object.equals(java.lang.Object) method on
+ the examined object.
+operand, as determined by calling the Object.equals(java.lang.Object) method on
+ the examined object.
+operand, as determined by calling the Object.equals(java.lang.Object) method on
+ the examined object.
+String that matches when the examined string is equal to
+ the specified expectedString, ignoring case.
+String that matches when the examined string is equal to
+ the specified expectedString, ignoring case.
+String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored.
+String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored.
+EventObject that matches any object
+ derived from eventClass announced by source.
+EventObject that matches any EventObject
+ announced by source.
+EventObject that matches any object
+ derived from eventClass announced by source.
+EventObject that matches any EventObject
+ announced by source.
+Iterables that only matches when a single pass over the
+ examined Iterable yields items that are all matched by the specified
+ itemMatcher.
+Iterables that only matches when a single pass over the
+ examined Iterable yields items that are all matched by the specified
+ itemMatcher.
+Iterables that only matches when a single pass over the
+ examined Iterable yields items that are all matched by the specified
+ itemMatcher.
+
+
+F
+
+
+
+
+G
+
+
+Comparable object that matches when the examined object is
+ greater than the specified value, as reported by the compareTo method of the
+ examined object.
+Comparable object that matches when the examined object is
+ greater than the specified value, as reported by the compareTo method of the
+ examined object.
+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.
+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.
+
+
+H
+
+
+Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcher and whose
+ value satisfies the specified valueMatcher.
+Maps matching when the examined Map contains
+ at least one entry whose key equals the specified key and whose value equals the
+ specified value.
+Maps matching when the examined Map contains
+ at least one entry whose key equals the specified key and whose value equals the
+ specified value.
+Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcher and whose
+ value satisfies the specified valueMatcher.
+Iterables that only matches when a single pass over the
+ examined Iterable yields at least one item that is matched by the specified
+ itemMatcher.
+Iterables that only matches when a single pass over the
+ examined Iterable yields at least one item that is equal to the specified
+ item.
+Iterables that only matches when a single pass over the
+ examined Iterable yields at least one item that is equal to the specified
+ item.
+Iterables that only matches when a single pass over the
+ examined Iterable yields at least one item that is matched by the specified
+ itemMatcher.
+Iterables that only matches when a single pass over the
+ examined Iterable yields at least one item that is equal to the specified
+ item.
+Iterables that only matches when a single pass over the
+ examined Iterable yields at least one item that is matched by the specified
+ itemMatcher.
+elementMatcher.
+hasItemInArray(equalTo(x)).
+hasItemInArray(equalTo(x)).
+elementMatcher.
+Iterables 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.
+Iterables 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.
+Iterables 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.
+Iterables 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.
+Iterables 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.
+Iterables 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.
+Maps matching when the examined Map contains
+ at least one key that satisfies the specified matcher.
+Maps matching when the examined Map contains
+ at least one key that is equal to the specified key.
+Maps matching when the examined Map contains
+ at least one key that satisfies the specified matcher.
+Maps matching when the examined Map contains
+ at least one key that is equal to the specified key.
+Collections that matches when the size() method returns
+ a value that satisfies the specified matcher.
+Collections that matches when the size() method returns
+ a value equal to the specified size.
+Collections that matches when the size() method returns
+ a value that satisfies the specified matcher.
+Collections that matches when the size() method returns
+ a value equal to the specified size.
+toString method
+ returns a value that satisfies the specified matcher.
+toString method
+ returns a value equalTo the specified string.
+toString method
+ returns a value that satisfies the specified matcher.
+toString method
+ returns a value equalTo the specified string.
+Maps matching when the examined Map contains
+ at least one value that satisfies the specified valueMatcher.
+Maps matching when the examined Map contains
+ at least one value that is equal to the specified value.
+Maps matching when the examined Map contains
+ at least one value that is equal to the specified value.
+Maps matching when the examined Map contains
+ at least one value that satisfies the specified valueMatcher.
+Nodes that matches when the examined node contains a node
+ at the specified xPath within the specified namespace context, with any content.
+Nodes that matches when the examined node contains a node
+ at the specified xPath, with any content.
+Nodes that matches when the examined node has a value at the
+ specified xPath, within the specified namespaceContext, that satisfies
+ the specified valueMatcher.
+Nodes that matches when the examined node has a value at the
+ specified xPath that satisfies the specified valueMatcher.
+Nodes that matches when the examined node has a value at the
+ specified xPath that satisfies the specified valueMatcher.
+Nodes that matches when the examined node has a value at the
+ specified xPath, within the specified namespaceContext, that satisfies
+ the specified valueMatcher.
+Nodes that matches when the examined node contains a node
+ at the specified xPath, with any content.
+Nodes that matches when the examined node contains a node
+ at the specified xPath within the specified namespace context, with any content.
+
+
+I
+
+
+type,
+ as determined by calling the Class.isInstance(Object) method on that type, passing the
+ the examined object.
+type,
+ as determined by calling the Class.isInstance(Object) method on that type, passing the
+ the examined object.
+type,
+ as determined by calling the Class.isInstance(Object) method on that type, passing the
+ the examined object.
+is(equalTo(x)).
+is(equalTo(x)).
+is(equalTo(x)).
+is(instanceOf(SomeClass.class)).
+is(instanceOf(SomeClass.class)).
+is(instanceOf(SomeClass.class)).
+true.String that matches when the examined string is null, or
+ has zero length.
+String that matches when the examined string is null, or
+ has zero length.
+String that matches when the examined string has zero length.
+String that matches when the examined string has zero length.
+Object.equals(java.lang.Object) invokedMethod?Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
+Iterables that matches when a single pass over the
+ examined Iterable yields an item count that is equal to the specified
+ size argument.
+Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
+Iterables that matches when a single pass over the
+ examined Iterable yields an item count that is equal to the specified
+ size argument.
+
+
+J
+
+
+assert keyword.Matcher
+ to act as an jMock1 Constraint.
+
+L
+
+
+Comparable object that matches when the examined object is
+ less than the specified value, as reported by the compareTo method of the
+ examined object.
+Comparable object that matches when the examined object is
+ less than the specified value, as reported by the compareTo method of the
+ examined object.
+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.
+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.
+
+
+M
+
+
+
+
+N
+
+
+not(equalTo(x)).
+not(equalTo(x)).
+not(equalTo(x)).
+not(nullValue()).
+not(nullValue(X.class)).
+not(nullValue()).
+not(nullValue(X.class)).
+not(nullValue()).
+not(nullValue(X.class)).
+null.
+null.
+null.
+null.
+null.
+null.
+
+
+O
+
+
+
+
+P
+
+
+
+
+R
+
+
+
+
+S
+
+
+String starts with the specified
+ String.
+String starts with the specified
+ String.
+String starts with the specified
+ String.
+String that matches when the examined string contains all of
+ the specified substrings, regardless of the order of their appearance.
+String that matches when the examined string contains all of
+ the specified substrings, regardless of the order of their appearance.
+Description that is stored as a string.
+
+T
+
+
+SelfDescribing object as a String.
+Class that matches when the specified baseType is
+ assignable from the examined class.
+Class that matches when the specified baseType is
+ assignable from the examined class.
+matchesSafely
+ is not the class that binds <T> to a type.
+matchesSafely
+ is not the class that binds <T> to a type.
+matchesSafely
+ is not the class that binds <T> to a type.
+matchesSafely
+ is not the class that binds <T> to a type.
+
+
+_
+
+
+
+A B C D E F G H I J L M N O P R S T _
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV
+ NEXT
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+
diff --git a/javadoc/1.3/index.html b/javadoc/1.3/index.html
new file mode 100644
index 000000000..ff0017d9d
--- /dev/null
+++ b/javadoc/1.3/index.html
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
+org.hamcrest
+
+
+Class BaseDescription
+java.lang.Object
+
+
org.hamcrest.BaseDescription
+
+
+
+
+
+
+
+
+
+public abstract class BaseDescription
Description that is stored as a string.
+
+
+
+
+
+
+
+
+Nested Class Summary
+
+
+
+
+
+
+
+
+Nested classes/interfaces inherited from interface org.hamcrest.Description
+
+
+
+Description.NullDescription
+
+
+
+
+
+Field Summary
+
+
+
+
+
+
+
+
+Fields inherited from interface org.hamcrest.Description
+
+
+
+NONE
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+
+BaseDescription()
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+protected abstract void
+append(char c)
+
+
+ Append the char c to the description.
+
+
+
+protected void
+append(java.lang.String str)
+
+
+ Append the String str to the description.
+
+
+
+ Description
+appendDescriptionOf(SelfDescribing value)
+
+
+ Appends the description of a SelfDescribing value to this description.
+
+
+
+ Description
+appendList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<? extends SelfDescribing> values)
+
+
+ Appends a list of SelfDescribing objects
+ to the description.
+
+
+
+ Description
+appendText(java.lang.String text)
+
+
+ Appends some plain text to the description.
+
+
+
+ Description
+appendValue(java.lang.Object value)
+
+
+ Appends an arbitary value to the description.
+
+
+
+
+
+
+
+
+
+
+<T> Description
+appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<T> values)
+
+
+ Appends a list of values to the description.
+
+
+
+
+
+
+
+
+
+
+<T> Description
+appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ T... values)
+
+
+ Appends a list of values to the description.
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+
+
+
+
+
+Constructor Detail
+
+BaseDescription
+
+public BaseDescription()
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+appendText
+
+public Description appendText(java.lang.String text)
+
+
+Description
+
+appendText in interface Description
+
+
+
+
+appendDescriptionOf
+
+public Description appendDescriptionOf(SelfDescribing value)
+
+
+DescriptionSelfDescribing value to this description.
+
+
+appendDescriptionOf in interface Description
+
+
+
+
+appendValue
+
+public Description appendValue(java.lang.Object value)
+
+
+Description
+
+appendValue in interface Description
+
+
+
+
+appendValueList
+
+public <T> Description appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ T... values)
+
+
+Description
+
+appendValueList in interface Description
+
+
+
+
+appendValueList
+
+public <T> Description appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<T> values)
+
+
+Description
+
+appendValueList in interface Description
+
+
+
+
+appendList
+
+public Description appendList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<? extends SelfDescribing> values)
+
+
+DescriptionSelfDescribing objects
+ to the description.
+
+
+appendList in interface Description
+
+
+
+
+append
+
+protected void append(java.lang.String str)
+
+
+append(char).
+ Override in subclasses to provide an efficient implementation.
+
+
+
+
+
+
+
+append
+
+protected abstract void append(char c)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
diff --git a/javadoc/1.3/org/hamcrest/BaseMatcher.html b/javadoc/1.3/org/hamcrest/BaseMatcher.html
new file mode 100644
index 000000000..95500177c
--- /dev/null
+++ b/javadoc/1.3/org/hamcrest/BaseMatcher.html
@@ -0,0 +1,346 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
+org.hamcrest
+
+
+Class BaseMatcher<T>
+java.lang.Object
+
+
org.hamcrest.BaseMatcher<T>
+
+
+
+
+
+
+
+
+
+public abstract class BaseMatcher<T>
+
+Matcher
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+
+BaseMatcher()
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+ void
+_dont_implement_Matcher___instead_extend_BaseMatcher_()
+
+
+ Deprecated.
+
+
+
+ void
+describeMismatch(java.lang.Object item,
+ Description description)
+
+
+ Generate a description of why the matcher has not accepted the item.
+
+
+
+ java.lang.String
+toString()
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+
+
+
+
+Methods inherited from interface org.hamcrest.Matcher
+
+
+
+matches
+
+
+
+
+Methods inherited from interface org.hamcrest.SelfDescribing
+
+
+
+describeTo
+
+
+
+
+
+Constructor Detail
+
+BaseMatcher
+
+public BaseMatcher()
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+_dont_implement_Matcher___instead_extend_BaseMatcher_
+
+@Deprecated
+public final void _dont_implement_Matcher___instead_extend_BaseMatcher_()
+
+
+Matcher
+
+_dont_implement_Matcher___instead_extend_BaseMatcher_ in interface Matcher<T>
+
+
+describeMismatch
+
+public void describeMismatch(java.lang.Object item,
+ Description description)
+
+
+Matchermatches(item) is false, but
+ will not check this.
+
+
+describeMismatch in interface Matcher<T>
+
+item - The item that the Matcher has rejected.description - The description to be built or appended to.
+
+
+toString
+
+public java.lang.String toString()
+
+
+
+
+
+toString in class java.lang.Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
diff --git a/javadoc/1.3/org/hamcrest/Condition.Step.html b/javadoc/1.3/org/hamcrest/Condition.Step.html
new file mode 100644
index 000000000..c02ac9f5b
--- /dev/null
+++ b/javadoc/1.3/org/hamcrest/Condition.Step.html
@@ -0,0 +1,211 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
+org.hamcrest
+
+
+
+Interface Condition.Step<I,O>
+
+
+
+
+public static interface Condition.Step<I,O>
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+ Condition<O>
+apply(I value,
+ Description mismatch)
+
+
+
+
+
+
+
+
+Method Detail
+
+apply
+
+Condition<O> apply(I value,
+ Description mismatch)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
diff --git a/javadoc/1.3/org/hamcrest/Condition.html b/javadoc/1.3/org/hamcrest/Condition.html
new file mode 100644
index 000000000..768c41749
--- /dev/null
+++ b/javadoc/1.3/org/hamcrest/Condition.html
@@ -0,0 +1,412 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
+org.hamcrest
+
+
+Class Condition<T>
+java.lang.Object
+
+
org.hamcrest.Condition<T>
+
+
+
+
+
+public abstract class Condition<T>
+
+
+
+
+
+
+
+
+
+
+
+Nested Class Summary
+
+
+
+
+static interface
+Condition.Step<I,O>
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+
+
+
+static org.hamcrest.Condition.NotMatched<java.lang.Object>
+NOT_MATCHED
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+abstract
+
+
+
+
+
+
+<U> Condition<U>
+and(Condition.Step<? super T,U> mapping)
+
+
+
+
+
+
+static
+
+
+
+
+
+
+<T> Condition<T>
+matched(T theValue,
+ Description mismatch)
+
+
+
+
+
+
+ boolean
+matching(Matcher<T> match)
+
+
+
+
+
+
+abstract boolean
+matching(Matcher<T> match,
+ java.lang.String message)
+
+
+
+
+
+
+static
+
+
+
+
+
+
+<T> Condition<T>
+notMatched()
+
+
+
+
+
+
+
+
+
+
+
+
+
+<U> Condition<U>
+then(Condition.Step<? super T,U> mapping)
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+
+
+
+
+
+Field Detail
+
+NOT_MATCHED
+
+public static final org.hamcrest.Condition.NotMatched<java.lang.Object> NOT_MATCHED
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+matching
+
+public abstract boolean matching(Matcher<T> match,
+ java.lang.String message)
+
+
+
+
+
+
+
+and
+
+public abstract <U> Condition<U> and(Condition.Step<? super T,U> mapping)
+
+
+
+
+
+
+
+matching
+
+public final boolean matching(Matcher<T> match)
+
+
+
+
+
+
+
+then
+
+public final <U> Condition<U> then(Condition.Step<? super T,U> mapping)
+
+
+
+
+
+
+
+notMatched
+
+public static <T> Condition<T> notMatched()
+
+
+
+
+
+
+
+matched
+
+public static <T> Condition<T> matched(T theValue,
+ Description mismatch)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
diff --git a/javadoc/1.3/org/hamcrest/CoreMatchers.html b/javadoc/1.3/org/hamcrest/CoreMatchers.html
new file mode 100644
index 000000000..88aa91665
--- /dev/null
+++ b/javadoc/1.3/org/hamcrest/CoreMatchers.html
@@ -0,0 +1,1629 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
+org.hamcrest
+
+
+Class CoreMatchers
+java.lang.Object
+
+
org.hamcrest.CoreMatchers
+
+
+
+
+
+public class CoreMatchers
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+
+CoreMatchers()
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+allOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ALL of the specified matchers.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+allOf(Matcher<? super T>... matchers)
+
+
+ Creates a matcher that matches if the examined object matches ALL of the specified matchers.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+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
+
+
+
+
+
+
+<T> Matcher<T>
+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
+
+
+
+
+
+
+<T> Matcher<T>
+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
+
+
+
+
+
+
+<T> Matcher<T>
+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
+
+
+
+
+
+
+<T> Matcher<T>
+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
+
+
+
+
+
+
+<T> Matcher<T>
+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
+
+
+
+
+
+
+<T> AnyOf<T>
+anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
+
+
+
+static
+
+
+
+
+
+
+<T> AnyOf<T>
+anyOf(Matcher<? super T>... matchers)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
+
+
+
+static
+
+
+
+
+
+
+<T> AnyOf<T>
+anyOf(Matcher<T> first,
+ Matcher<? super T> second)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
+
+
+
+static
+
+
+
+
+
+
+<T> AnyOf<T>
+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
+
+
+
+
+
+
+<T> AnyOf<T>
+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
+
+
+
+
+
+
+<T> AnyOf<T>
+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
+
+
+
+
+
+
+<T> AnyOf<T>
+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 Matcher<java.lang.Object>
+anything()
+
+
+ Creates a matcher that always matches, regardless of the examined object.
+
+
+
+static Matcher<java.lang.Object>
+anything(java.lang.String description)
+
+
+ Creates a matcher that always matches, regardless of the examined object, but describes
+ itself with the specified String.
+
+
+
+static
+
+
+
+
+
+
+<LHS> CombinableMatcher.CombinableBothMatcher<LHS>
+both(Matcher<? super LHS> matcher)
+
+
+ Creates a matcher that matches when both of the specified matchers match the examined object.
+
+
+
+static Matcher<java.lang.String>
+containsString(java.lang.String substring)
+
+
+ Creates a matcher that matches if the examined String contains the specified
+ String anywhere.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+describedAs(java.lang.String description,
+ Matcher<T> matcher,
+ java.lang.Object... values)
+
+
+ Wraps an existing matcher, overriding its description with that specified.
+
+
+
+static
+
+
+
+
+
+
+<LHS> CombinableMatcher.CombinableEitherMatcher<LHS>
+either(Matcher<? super LHS> matcher)
+
+
+ Creates a matcher that matches when either of the specified matchers match the examined object.
+
+
+
+static Matcher<java.lang.String>
+endsWith(java.lang.String suffix)
+
+
+ Creates a matcher that matches if the examined String ends with the specified
+ String.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+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
+
+
+
+
+
+
+<U> Matcher<java.lang.Iterable<U>>
+everyItem(Matcher<U> itemMatcher)
+
+
+ Creates a matcher for Iterables that only matches when a single pass over the
+ examined Iterable yields items that are all matched by the specified
+ itemMatcher.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<java.lang.Iterable<? super T>>
+hasItem(Matcher<? super T> itemMatcher)
+
+
+ Creates a matcher for Iterables that only matches when a single pass over the
+ examined Iterable yields at least one item that is matched by the specified
+ itemMatcher.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<java.lang.Iterable<? super T>>
+hasItem(T item)
+
+
+ Creates a matcher for Iterables that only matches when a single pass over the
+ examined Iterable yields at least one item that is equal to the specified
+ item.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<java.lang.Iterable<T>>
+hasItems(Matcher<? super T>... itemMatchers)
+
+
+ Creates a matcher for Iterables 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
+
+
+
+
+
+
+<T> Matcher<java.lang.Iterable<T>>
+hasItems(T... items)
+
+
+ Creates a matcher for Iterables 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
+
+
+
+
+
+
+<T> Matcher<T>
+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
+
+
+
+
+
+
+<T> Matcher<T>
+is(java.lang.Class<T> type)
+
+
+ Deprecated. use isA(Class
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+is(Matcher<T> matcher)
+
+
+ Decorates another Matcher, retaining its behaviour, but allowing tests
+ to be slightly more expressive.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+is(T value)
+
+
+ A shortcut to the frequently used is(equalTo(x)).
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+isA(java.lang.Class<T> type)
+
+
+ A shortcut to the frequently used is(instanceOf(SomeClass.class)).
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+not(Matcher<T> matcher)
+
+
+ Creates a matcher that wraps an existing matcher, but inverts the logic by which
+ it will match.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+not(T value)
+
+
+ A shortcut to the frequently used not(equalTo(x)).
+
+
+
+static Matcher<java.lang.Object>
+notNullValue()
+
+
+ A shortcut to the frequently used not(nullValue()).
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+notNullValue(java.lang.Class<T> type)
+
+
+ A shortcut to the frequently used not(nullValue(X.class)).
+
+
+
+static Matcher<java.lang.Object>
+nullValue()
+
+
+ Creates a matcher that matches if examined object is null.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+nullValue(java.lang.Class<T> type)
+
+
+ Creates a matcher that matches if examined object is null.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+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>
+startsWith(java.lang.String prefix)
+
+
+ Creates a matcher that matches if the examined String starts with the specified
+ String.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+theInstance(T target)
+
+
+ Creates a matcher that matches only when the examined object is the same instance as
+ the specified target object.
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+
+
+
+
+
+Constructor Detail
+
+CoreMatchers
+
+public CoreMatchers()
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+allOf
+
+public static <T> Matcher<T> allOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+
+
+
+
+
+allOf
+
+public static <T> Matcher<T> allOf(Matcher<? super T>... matchers)
+
+
+assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+
+
+
+
+
+allOf
+
+public static <T> Matcher<T> allOf(Matcher<? super T> first,
+ Matcher<? super T> second)
+
+
+assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+
+
+
+
+
+allOf
+
+public static <T> Matcher<T> allOf(Matcher<? super T> first,
+ Matcher<? super T> second,
+ Matcher<? super T> third)
+
+
+assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+
+
+
+
+
+allOf
+
+public static <T> Matcher<T> allOf(Matcher<? super T> first,
+ Matcher<? super T> second,
+ Matcher<? super T> third,
+ Matcher<? super T> fourth)
+
+
+assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+
+
+
+
+
+allOf
+
+public static <T> Matcher<T> allOf(Matcher<? super T> first,
+ Matcher<? super T> second,
+ Matcher<? super T> third,
+ Matcher<? super T> fourth,
+ Matcher<? super T> fifth)
+
+
+assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+
+
+
+
+
+allOf
+
+public static <T> Matcher<T> 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)
+
+
+assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+
+
+
+
+
+anyOf
+
+public static <T> AnyOf<T> anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+
+
+
+
+
+anyOf
+
+public static <T> AnyOf<T> anyOf(Matcher<T> first,
+ Matcher<? super T> second,
+ Matcher<? super T> third)
+
+
+assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+
+
+
+
+
+anyOf
+
+public static <T> AnyOf<T> anyOf(Matcher<T> first,
+ Matcher<? super T> second,
+ Matcher<? super T> third,
+ Matcher<? super T> fourth)
+
+
+assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+
+
+
+
+
+anyOf
+
+public static <T> AnyOf<T> anyOf(Matcher<T> first,
+ Matcher<? super T> second,
+ Matcher<? super T> third,
+ Matcher<? super T> fourth,
+ Matcher<? super T> fifth)
+
+
+assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+
+
+
+
+
+anyOf
+
+public static <T> AnyOf<T> anyOf(Matcher<T> first,
+ Matcher<? super T> second,
+ Matcher<? super T> third,
+ Matcher<? super T> fourth,
+ Matcher<? super T> fifth,
+ Matcher<? super T> sixth)
+
+
+assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+
+
+
+
+
+anyOf
+
+public static <T> AnyOf<T> anyOf(Matcher<T> first,
+ Matcher<? super T> second)
+
+
+assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+
+
+
+
+
+anyOf
+
+public static <T> AnyOf<T> anyOf(Matcher<? super T>... matchers)
+
+
+assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+
+
+
+
+
+both
+
+public static <LHS> CombinableMatcher.CombinableBothMatcher<LHS> both(Matcher<? super LHS> matcher)
+
+
+assertThat("fab", both(containsString("a")).and(containsString("b")))
+
+
+
+
+
+either
+
+public static <LHS> CombinableMatcher.CombinableEitherMatcher<LHS> either(Matcher<? super LHS> matcher)
+
+
+assertThat("fan", either(containsString("a")).and(containsString("b")))
+
+
+
+
+
+describedAs
+
+public static <T> Matcher<T> describedAs(java.lang.String description,
+ Matcher<T> matcher,
+ java.lang.Object... values)
+
+
+describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())
+
+
+description - the new description for the wrapped matchermatcher - the matcher to wrapvalues - optional values to insert into the tokenised description
+
+
+everyItem
+
+public static <U> Matcher<java.lang.Iterable<U>> everyItem(Matcher<U> itemMatcher)
+
+
+Iterables that only matches when a single pass over the
+ examined Iterable yields items that are all matched by the specified
+ itemMatcher.
+
+ For example:
+ assertThat(Arrays.asList("bar", "baz"), everyItem(startsWith("ba")))
+
+
+itemMatcher - the matcher to apply to every item provided by the examined Iterable
+
+
+is
+
+public static <T> Matcher<T> is(T value)
+
+
+is(equalTo(x)).
+
+ For example:
+ assertThat(cheese, is(smelly))
+ instead of:
+ assertThat(cheese, is(equalTo(smelly)))
+
+
+
+
+
+is
+
+public static <T> Matcher<T> is(Matcher<T> matcher)
+
+
+assertThat(cheese, is(equalTo(smelly)))
+ instead of:
+ assertThat(cheese, equalTo(smelly))
+
+
+
+
+
+is
+
+public static <T> Matcher<T> is(java.lang.Class<T> type)
+
+
+is(instanceOf(SomeClass.class)).
+
+ For example:
+ assertThat(cheese, is(Cheddar.class))
+ instead of:
+ assertThat(cheese, is(instanceOf(Cheddar.class)))
+
+
+
+
+
+isA
+
+public static <T> Matcher<T> isA(java.lang.Class<T> type)
+
+
+is(instanceOf(SomeClass.class)).
+
+ For example:
+ assertThat(cheese, isA(Cheddar.class))
+ instead of:
+ assertThat(cheese, is(instanceOf(Cheddar.class)))
+
+
+
+
+
+anything
+
+public static Matcher<java.lang.Object> anything()
+
+
+
+
+
+
+
+anything
+
+public static Matcher<java.lang.Object> anything(java.lang.String description)
+
+
+String.
+
+
+description - a meaningful String used when describing itself
+
+
+hasItem
+
+public static <T> Matcher<java.lang.Iterable<? super T>> hasItem(T item)
+
+
+Iterables that only matches when a single pass over the
+ examined Iterable yields at least one item that is equal to the specified
+ item. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), hasItem("bar"))
+
+
+item - the item to compare against the items provided by the examined Iterable
+
+
+hasItem
+
+public static <T> Matcher<java.lang.Iterable<? super T>> hasItem(Matcher<? super T> itemMatcher)
+
+
+Iterables that only matches when a single pass over the
+ examined Iterable yields at least one item that is matched by the specified
+ itemMatcher. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), hasItem(startsWith("ba")))
+
+
+itemMatcher - the matcher to apply to items provided by the examined Iterable
+
+
+hasItems
+
+public static <T> Matcher<java.lang.Iterable<T>> hasItems(T... items)
+
+
+Iterables 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. Whilst matching, each traversal of the
+ examined Iterable will stop as soon as a matching item is found.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar", "baz"), hasItems("baz", "foo"))
+
+
+items - the items to compare against the items provided by the examined Iterable
+
+
+hasItems
+
+public static <T> Matcher<java.lang.Iterable<T>> hasItems(Matcher<? super T>... itemMatchers)
+
+
+Iterables 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. Whilst matching, each traversal of
+ the examined Iterable will stop as soon as a matching item is found.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar", "baz"), hasItems(endsWith("z"), endsWith("o")))
+
+
+itemMatchers - the matchers to apply to items provided by the examined Iterable
+
+
+equalTo
+
+public static <T> Matcher<T> equalTo(T operand)
+
+
+operand, as determined by calling the Object.equals(java.lang.Object) method on
+ the examined object.
+
+ null then the created matcher will only match if
+ the examined object's equals method returns true when passed a
+ null (which would be a violation of the equals contract), unless the
+ examined object itself is null, in which case the matcher will return a positive
+ match.Arrays, whereby
+ it will match if both the operand and the examined object are arrays of the same length and
+ contain items that are equal to each other (according to the above rules) in the same
+ indexes.
+ assertThat("foo", equalTo("foo"));
+ assertThat(new String[] {"foo", "bar"}, equalTo(new String[] {"foo", "bar"}));
+
+
+
+
+
+
+any
+
+public static <T> Matcher<T> any(java.lang.Class<T> type)
+
+
+type,
+ as determined by calling the Class.isInstance(Object) method on that type, passing the
+ the examined object.
+
+ with(any(Thing.class))assertThat(new Canoe(), instanceOf(Canoe.class));
+
+
+
+
+
+instanceOf
+
+public static <T> Matcher<T> instanceOf(java.lang.Class<?> type)
+
+
+type,
+ as determined by calling the Class.isInstance(Object) method on that type, passing the
+ the examined object.
+
+ assertThat(new Canoe(), instanceOf(Paddlable.class));
+
+
+
+
+
+not
+
+public static <T> Matcher<T> not(Matcher<T> matcher)
+
+
+assertThat(cheese, is(not(equalTo(smelly))))
+
+
+matcher - the matcher whose sense should be inverted
+
+
+not
+
+public static <T> Matcher<T> not(T value)
+
+
+not(equalTo(x)).
+
+ For example:
+ assertThat(cheese, is(not(smelly)))
+ instead of:
+ assertThat(cheese, is(not(equalTo(smelly))))
+
+
+value - the value that any examined object should not equal
+
+
+nullValue
+
+public static Matcher<java.lang.Object> nullValue()
+
+
+null.
+
+ For example:
+ assertThat(cheese, is(nullValue())
+
+
+
+
+
+nullValue
+
+public static <T> Matcher<T> nullValue(java.lang.Class<T> type)
+
+
+null. Accepts a
+ single dummy argument to facilitate type inference.
+
+ For example:
+ assertThat(cheese, is(nullValue(Cheese.class))
+
+
+type - dummy parameter used to infer the generic type of the returned matcher
+
+
+notNullValue
+
+public static Matcher<java.lang.Object> notNullValue()
+
+
+not(nullValue()).
+
+ For example:
+ assertThat(cheese, is(notNullValue()))
+ instead of:
+ assertThat(cheese, is(not(nullValue())))
+
+
+
+
+
+notNullValue
+
+public static <T> Matcher<T> notNullValue(java.lang.Class<T> type)
+
+
+not(nullValue(X.class)). Accepts a
+ single dummy argument to facilitate type inference..
+
+ For example:
+ assertThat(cheese, is(notNullValue(X.class)))
+ instead of:
+ assertThat(cheese, is(not(nullValue(X.class))))
+
+
+type - dummy parameter used to infer the generic type of the returned matcher
+
+
+sameInstance
+
+public static <T> Matcher<T> sameInstance(T target)
+
+
+
+
+target - the target instance against which others should be assessed
+
+
+theInstance
+
+public static <T> Matcher<T> theInstance(T target)
+
+
+
+
+target - the target instance against which others should be assessed
+
+
+containsString
+
+public static Matcher<java.lang.String> containsString(java.lang.String substring)
+
+
+String contains the specified
+ String anywhere.
+
+ For example:
+ assertThat("myStringOfNote", containsString("ring"))
+
+
+substring - the substring that the returned matcher will expect to find within any examined string
+
+
+startsWith
+
+public static Matcher<java.lang.String> startsWith(java.lang.String prefix)
+
+
+String starts with the specified
+ String.
+
+ For example:
+ assertThat("myStringOfNote", startsWith("my"))
+
+
+prefix - the substring that the returned matcher will expect at the start of any examined string
+
+
+endsWith
+
+public static Matcher<java.lang.String> endsWith(java.lang.String suffix)
+
+
+
+String ends with the specified
+ String.
+
+ For example:
+ assertThat("myStringOfNote", endsWith("Note"))
+
+
+suffix - the substring that the returned matcher will expect at the end of any examined string
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
diff --git a/javadoc/1.3/org/hamcrest/CustomMatcher.html b/javadoc/1.3/org/hamcrest/CustomMatcher.html
new file mode 100644
index 000000000..8ddd0c68b
--- /dev/null
+++ b/javadoc/1.3/org/hamcrest/CustomMatcher.html
@@ -0,0 +1,302 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
+org.hamcrest
+
+
+Class CustomMatcher<T>
+java.lang.Object
+
+
org.hamcrest.BaseMatcher<T>
+
org.hamcrest.CustomMatcher<T>
+
+
+T - The type of object being matched.
+
+
+
+
+
+
+public abstract class CustomMatcher<T>
+ Matcher<String> aNonEmptyString = new CustomMatcher<String>("a non empty string") {
+ public boolean matches(Object object) {
+ return ((object instanceof String) && !((String) object).isEmpty();
+ }
+ };
+
+
+
+for a type safe variant of this class that you probably
+ want to use.
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+
+CustomMatcher(java.lang.String description)
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+ void
+describeTo(Description description)
+
+
+ Generates a description of the object.
+
+
+
+
+Methods inherited from class org.hamcrest.BaseMatcher
+
+
+
+_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, toString
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+
+
+
+
+Methods inherited from interface org.hamcrest.Matcher
+
+
+
+matches
+
+
+
+
+
+Constructor Detail
+
+CustomMatcher
+
+public CustomMatcher(java.lang.String description)
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+describeTo
+
+public final void describeTo(Description description)
+
+
+
+SelfDescribing
+
+description - The description to be built or appended to.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
diff --git a/javadoc/1.3/org/hamcrest/CustomTypeSafeMatcher.html b/javadoc/1.3/org/hamcrest/CustomTypeSafeMatcher.html
new file mode 100644
index 000000000..d9d00a48d
--- /dev/null
+++ b/javadoc/1.3/org/hamcrest/CustomTypeSafeMatcher.html
@@ -0,0 +1,305 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
+org.hamcrest
+
+
+Class CustomTypeSafeMatcher<T>
+java.lang.Object
+
+
org.hamcrest.BaseMatcher<T>
+
org.hamcrest.TypeSafeMatcher<T>
+
org.hamcrest.CustomTypeSafeMatcher<T>
+
+
+T - The type of object being matched
+
+
+
+
+
+
+public abstract class CustomTypeSafeMatcher<T>
+ Matcher<String> aNonEmptyString = new CustomTypeSafeMatcher<String>("a non empty string") {
+ public boolean matchesSafely(String string) {
+ return !string.isEmpty();
+ }
+ public void describeMismatchSafely(String string, Description mismatchDescription) {
+ mismatchDescription.appendText("was empty");
+ }
+ };
+
+ This is a variant of CustomMatcher that first type checks
+ the argument being matched. By the time TypeSafeMatcher.matchesSafely(T) is
+ is called the argument is guaranteed to be non-null and of the correct
+ type.
+
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+
+CustomTypeSafeMatcher(java.lang.String description)
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+ void
+describeTo(Description description)
+
+
+ Generates a description of the object.
+
+
+
+
+Methods inherited from class org.hamcrest.TypeSafeMatcher
+
+
+
+describeMismatch, describeMismatchSafely, matches, matchesSafely
+
+
+
+
+Methods inherited from class org.hamcrest.BaseMatcher
+
+
+
+_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+
+
+
+
+
+Constructor Detail
+
+CustomTypeSafeMatcher
+
+public CustomTypeSafeMatcher(java.lang.String description)
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+describeTo
+
+public final void describeTo(Description description)
+
+
+
+SelfDescribing
+
+description - The description to be built or appended to.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
diff --git a/javadoc/1.3/org/hamcrest/Description.NullDescription.html b/javadoc/1.3/org/hamcrest/Description.NullDescription.html
new file mode 100644
index 000000000..d9e46f4b8
--- /dev/null
+++ b/javadoc/1.3/org/hamcrest/Description.NullDescription.html
@@ -0,0 +1,482 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
+org.hamcrest
+
+
+Class Description.NullDescription
+java.lang.Object
+
+
org.hamcrest.Description.NullDescription
+
+
+
+
+
+
+
+
+
+public static final class Description.NullDescription
+
+
+
+
+
+
+
+Nested Class Summary
+
+
+
+
+
+
+
+
+Nested classes/interfaces inherited from interface org.hamcrest.Description
+
+
+
+Description.NullDescription
+
+
+
+
+
+Field Summary
+
+
+
+
+
+
+
+
+Fields inherited from interface org.hamcrest.Description
+
+
+
+NONE
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+
+Description.NullDescription()
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+ Description
+appendDescriptionOf(SelfDescribing value)
+
+
+ Appends the description of a SelfDescribing value to this description.
+
+
+
+ Description
+appendList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<? extends SelfDescribing> values)
+
+
+ Appends a list of SelfDescribing objects
+ to the description.
+
+
+
+ Description
+appendText(java.lang.String text)
+
+
+ Appends some plain text to the description.
+
+
+
+ Description
+appendValue(java.lang.Object value)
+
+
+ Appends an arbitary value to the description.
+
+
+
+
+
+
+
+
+
+
+<T> Description
+appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<T> values)
+
+
+ Appends a list of values to the description.
+
+
+
+
+
+
+
+
+
+
+<T> Description
+appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ T... values)
+
+
+ Appends a list of values to the description.
+
+
+
+ java.lang.String
+toString()
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+
+
+
+
+
+Constructor Detail
+
+Description.NullDescription
+
+public Description.NullDescription()
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+appendDescriptionOf
+
+public Description appendDescriptionOf(SelfDescribing value)
+
+
+DescriptionSelfDescribing value to this description.
+
+
+appendDescriptionOf in interface Description
+
+
+
+
+appendList
+
+public Description appendList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<? extends SelfDescribing> values)
+
+
+DescriptionSelfDescribing objects
+ to the description.
+
+
+appendList in interface Description
+
+
+
+
+appendText
+
+public Description appendText(java.lang.String text)
+
+
+Description
+
+appendText in interface Description
+
+
+
+
+appendValue
+
+public Description appendValue(java.lang.Object value)
+
+
+Description
+
+appendValue in interface Description
+
+
+
+
+appendValueList
+
+public <T> Description appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ T... values)
+
+
+Description
+
+appendValueList in interface Description
+
+
+
+
+appendValueList
+
+public <T> Description appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<T> values)
+
+
+Description
+
+appendValueList in interface Description
+
+
+
+
+toString
+
+public java.lang.String toString()
+
+
+
+
+
+toString in class java.lang.Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
diff --git a/javadoc/1.3/org/hamcrest/Description.html b/javadoc/1.3/org/hamcrest/Description.html
new file mode 100644
index 000000000..a261a899e
--- /dev/null
+++ b/javadoc/1.3/org/hamcrest/Description.html
@@ -0,0 +1,412 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
+org.hamcrest
+
+
+Interface Description
+
+
+
+
+
+
+public interface Description
+
+SelfDescribing.describeTo(Description)
+
+
+
+
+
+
+
+
+
+Nested Class Summary
+
+
+
+
+static class
+Description.NullDescription
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+
+
+
+static Description
+NONE
+
+
+ A description that consumes input but does nothing.
+
+
+
+
+
+Method Summary
+
+
+
+
+ Description
+appendDescriptionOf(SelfDescribing value)
+
+
+ Appends the description of a SelfDescribing value to this description.
+
+
+
+ Description
+appendList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<? extends SelfDescribing> values)
+
+
+ Appends a list of SelfDescribing objects
+ to the description.
+
+
+
+ Description
+appendText(java.lang.String text)
+
+
+ Appends some plain text to the description.
+
+
+
+ Description
+appendValue(java.lang.Object value)
+
+
+ Appends an arbitary value to the description.
+
+
+
+
+
+
+
+
+
+
+<T> Description
+appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<T> values)
+
+
+ Appends a list of values to the description.
+
+
+
+
+
+
+
+
+
+
+<T> Description
+appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ T... values)
+
+
+ Appends a list of values to the description.
+
+
+
+
+
+Field Detail
+
+NONE
+
+static final Description NONE
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+appendText
+
+Description appendText(java.lang.String text)
+
+
+
+
+
+
+
+appendDescriptionOf
+
+Description appendDescriptionOf(SelfDescribing value)
+
+
+SelfDescribing value to this description.
+
+
+
+
+
+appendValue
+
+Description appendValue(java.lang.Object value)
+
+
+
+
+
+
+
+appendValueList
+
+<T> Description appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ T... values)
+
+
+
+
+
+
+
+appendValueList
+
+<T> Description appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<T> values)
+
+
+
+
+
+
+
+appendList
+
+Description appendList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<? extends SelfDescribing> values)
+
+
+
+SelfDescribing objects
+ to the description.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
diff --git a/javadoc/1.3/org/hamcrest/DiagnosingMatcher.html b/javadoc/1.3/org/hamcrest/DiagnosingMatcher.html
new file mode 100644
index 000000000..a3e89ebe0
--- /dev/null
+++ b/javadoc/1.3/org/hamcrest/DiagnosingMatcher.html
@@ -0,0 +1,344 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
+org.hamcrest
+
+
+Class DiagnosingMatcher<T>
+java.lang.Object
+
+
org.hamcrest.BaseMatcher<T>
+
org.hamcrest.DiagnosingMatcher<T>
+
+
+T -
+
+
+
+
+
+
+
+
+public abstract class DiagnosingMatcher<T>
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+
+DiagnosingMatcher()
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+ void
+describeMismatch(java.lang.Object item,
+ Description mismatchDescription)
+
+
+ Generate a description of why the matcher has not accepted the item.
+
+
+
+ boolean
+matches(java.lang.Object item)
+
+
+ Evaluates the matcher for argument item.
+
+
+
+protected abstract boolean
+matches(java.lang.Object item,
+ Description mismatchDescription)
+
+
+
+
+
+
+
+Methods inherited from class org.hamcrest.BaseMatcher
+
+
+
+_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+
+
+
+
+Methods inherited from interface org.hamcrest.SelfDescribing
+
+
+
+describeTo
+
+
+
+
+
+Constructor Detail
+
+DiagnosingMatcher
+
+public DiagnosingMatcher()
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+matches
+
+public final boolean matches(java.lang.Object item)
+
+
+Matcher
+
+item - the object against which the matcher is evaluated.
+true if item matches, otherwise false.BaseMatcher
+
+
+describeMismatch
+
+public final void describeMismatch(java.lang.Object item,
+ Description mismatchDescription)
+
+
+Matchermatches(item) is false, but
+ will not check this.
+
+
+describeMismatch in interface Matcher<T>describeMismatch in class BaseMatcher<T>
+
+item - The item that the Matcher has rejected.mismatchDescription - The description to be built or appended to.
+
+
+matches
+
+protected abstract boolean matches(java.lang.Object item,
+ Description mismatchDescription)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
diff --git a/javadoc/1.3/org/hamcrest/EasyMock2Matchers.html b/javadoc/1.3/org/hamcrest/EasyMock2Matchers.html
new file mode 100644
index 000000000..6c02f5d5c
--- /dev/null
+++ b/javadoc/1.3/org/hamcrest/EasyMock2Matchers.html
@@ -0,0 +1,256 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
+org.hamcrest
+
+
+Class EasyMock2Matchers
+java.lang.Object
+
+
org.hamcrest.EasyMock2Matchers
+
+
+
+
+
+public class EasyMock2Matchers
+
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+
+EasyMock2Matchers()
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+static java.lang.String
+equalTo(java.lang.String string)
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+
+
+
+
+
+Constructor Detail
+
+EasyMock2Matchers
+
+public EasyMock2Matchers()
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+equalTo
+
+public static java.lang.String equalTo(java.lang.String string)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
diff --git a/javadoc/1.3/org/hamcrest/Factory.html b/javadoc/1.3/org/hamcrest/Factory.html
new file mode 100644
index 000000000..5fb6900f8
--- /dev/null
+++ b/javadoc/1.3/org/hamcrest/Factory.html
@@ -0,0 +1,178 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: REQUIRED | OPTIONAL
+
+DETAIL: ELEMENT
+
+
+
+
+org.hamcrest
+
+
+Annotation Type Factory
+
+
+
+
+@Retention(value=RUNTIME)
+@Target(value=METHOD)
+public @interface Factory
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: REQUIRED | OPTIONAL
+
+DETAIL: ELEMENT
+
+
+
+
diff --git a/javadoc/1.3/org/hamcrest/FeatureMatcher.html b/javadoc/1.3/org/hamcrest/FeatureMatcher.html
new file mode 100644
index 000000000..20078aac8
--- /dev/null
+++ b/javadoc/1.3/org/hamcrest/FeatureMatcher.html
@@ -0,0 +1,348 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
+org.hamcrest
+
+
+Class FeatureMatcher<T,U>
+java.lang.Object
+
+
org.hamcrest.BaseMatcher<T>
+
org.hamcrest.TypeSafeDiagnosingMatcher<T>
+
org.hamcrest.FeatureMatcher<T,U>
+
+
+T - The type of the object to be matchedU - The type of the feature to be matched
+
+
+
+
+
+
+
+
+public abstract class FeatureMatcher<T,U>
featureValueOf()
+ in a subclass to pull out the feature to be matched against.
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+
+FeatureMatcher(Matcher<? super U> subMatcher,
+ java.lang.String featureDescription,
+ java.lang.String featureName)
+
+
+ Constructor
+
+
+
+
+
+Method Summary
+
+
+
+
+ void
+describeTo(Description description)
+
+
+ Generates a description of the object.
+
+
+
+protected abstract U
+featureValueOf(T actual)
+
+
+ Implement this to extract the interesting feature.
+
+
+
+protected boolean
+matchesSafely(T actual,
+ Description mismatch)
+
+
+ Subclasses should implement this.
+
+
+
+
+Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher
+
+
+
+describeMismatch, matches
+
+
+
+
+Methods inherited from class org.hamcrest.BaseMatcher
+
+
+
+_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+
+
+
+
+
+Constructor Detail
+
+FeatureMatcher
+
+public FeatureMatcher(Matcher<? super U> subMatcher,
+ java.lang.String featureDescription,
+ java.lang.String featureName)
+
+
+
+
+
+
+
+
+subMatcher - The matcher to apply to the featurefeatureDescription - Descriptive text to use in describeTofeatureName - Identifying text for mismatch message
+
+
+
+
+
+Method Detail
+
+featureValueOf
+
+protected abstract U featureValueOf(T actual)
+
+
+
+
+actual - the target object
+
+
+
+matchesSafely
+
+protected boolean matchesSafely(T actual,
+ Description mismatch)
+
+
+TypeSafeDiagnosingMatcher
+
+matchesSafely in class TypeSafeDiagnosingMatcher<T>
+
+
+
+
+describeTo
+
+public final void describeTo(Description description)
+
+
+
+SelfDescribing
+
+description - The description to be built or appended to.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
diff --git a/javadoc/1.3/org/hamcrest/JMock1Matchers.html b/javadoc/1.3/org/hamcrest/JMock1Matchers.html
new file mode 100644
index 000000000..5ede24f20
--- /dev/null
+++ b/javadoc/1.3/org/hamcrest/JMock1Matchers.html
@@ -0,0 +1,252 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
+org.hamcrest
+
+
+Class JMock1Matchers
+java.lang.Object
+
+
org.hamcrest.JMock1Matchers
+
+
+
+
+
+public class JMock1Matchers
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+
+JMock1Matchers()
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+static org.jmock.core.Constraint
+equalTo(java.lang.String string)
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+
+
+
+
+
+Constructor Detail
+
+JMock1Matchers
+
+public JMock1Matchers()
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+equalTo
+
+public static org.jmock.core.Constraint equalTo(java.lang.String string)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
diff --git a/javadoc/1.3/org/hamcrest/JavaLangMatcherAssert.html b/javadoc/1.3/org/hamcrest/JavaLangMatcherAssert.html
new file mode 100644
index 000000000..1e418dd8c
--- /dev/null
+++ b/javadoc/1.3/org/hamcrest/JavaLangMatcherAssert.html
@@ -0,0 +1,240 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
+org.hamcrest
+
+
+Class JavaLangMatcherAssert
+java.lang.Object
+
+
org.hamcrest.JavaLangMatcherAssert
+
+
+
+
+
+public class JavaLangMatcherAssert
assert keyword.
+ Example:
+
+ assert that("Foo", startsWith("f"));
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+static
+
+
+
+
+
+
+<T> boolean
+that(T argument,
+ Matcher<? super T> matcher)
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+
+
+
+
+
+Method Detail
+
+that
+
+public static <T> boolean that(T argument,
+ Matcher<? super T> matcher)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
diff --git a/javadoc/1.3/org/hamcrest/Matcher.html b/javadoc/1.3/org/hamcrest/Matcher.html
new file mode 100644
index 000000000..c8c6d8d9d
--- /dev/null
+++ b/javadoc/1.3/org/hamcrest/Matcher.html
@@ -0,0 +1,310 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
+org.hamcrest
+
+
+Interface Matcher<T>
+
+
+
+
+
+
+
+
+public interface Matcher<T>
BaseMatcher abstract class,
+ which will ensure that the Matcher API can grow to support
+ new features and remain compatible with all Matcher implementations.
+
+ For easy access to common Matcher implementations, use the static factory
+ methods in CoreMatchers.
+
+ N.B. Well designed matchers should be immutable.
+
+
+CoreMatchers,
+BaseMatcher
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+ void
+_dont_implement_Matcher___instead_extend_BaseMatcher_()
+
+
+ Deprecated. to make
+
+
+
+ void
+describeMismatch(java.lang.Object item,
+ Description mismatchDescription)
+
+
+ Generate a description of why the matcher has not accepted the item.
+
+
+
+ boolean
+matches(java.lang.Object item)
+
+
+ Evaluates the matcher for argument item.
+
+
+
+
+Methods inherited from interface org.hamcrest.SelfDescribing
+
+
+
+describeTo
+
+
+
+
+
+Method Detail
+
+matches
+
+boolean matches(java.lang.Object item)
+
+
+
+
+
+
+item - the object against which the matcher is evaluated.
+true if item matches, otherwise false.BaseMatcher
+
+
+describeMismatch
+
+void describeMismatch(java.lang.Object item,
+ Description mismatchDescription)
+
+
+matches(item) is false, but
+ will not check this.
+
+
+
+
+item - The item that the Matcher has rejected.mismatchDescription - The description to be built or appended to.
+
+
+_dont_implement_Matcher___instead_extend_BaseMatcher_
+
+@Deprecated
+void _dont_implement_Matcher___instead_extend_BaseMatcher_()
+
+
+
+
+
+
+
+for reasons why.,
+BaseMatcher
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
diff --git a/javadoc/1.3/org/hamcrest/MatcherAssert.html b/javadoc/1.3/org/hamcrest/MatcherAssert.html
new file mode 100644
index 000000000..0f0874d85
--- /dev/null
+++ b/javadoc/1.3/org/hamcrest/MatcherAssert.html
@@ -0,0 +1,312 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
+org.hamcrest
+
+
+Class MatcherAssert
+java.lang.Object
+
+
org.hamcrest.MatcherAssert
+
+
+
+
+
+public class MatcherAssert
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+
+MatcherAssert()
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+static void
+assertThat(java.lang.String reason,
+ boolean assertion)
+
+
+
+
+
+
+static
+
+
+
+
+
+
+<T> void
+assertThat(java.lang.String reason,
+ T actual,
+ Matcher<? super T> matcher)
+
+
+
+
+
+
+static
+
+
+
+
+
+
+<T> void
+assertThat(T actual,
+ Matcher<? super T> matcher)
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+
+
+
+
+
+Constructor Detail
+
+MatcherAssert
+
+public MatcherAssert()
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+assertThat
+
+public static <T> void assertThat(T actual,
+ Matcher<? super T> matcher)
+
+
+
+
+
+
+
+assertThat
+
+public static <T> void assertThat(java.lang.String reason,
+ T actual,
+ Matcher<? super T> matcher)
+
+
+
+
+
+
+
+assertThat
+
+public static void assertThat(java.lang.String reason,
+ boolean assertion)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
diff --git a/javadoc/1.3/org/hamcrest/Matchers.html b/javadoc/1.3/org/hamcrest/Matchers.html
new file mode 100644
index 000000000..23072ad2d
--- /dev/null
+++ b/javadoc/1.3/org/hamcrest/Matchers.html
@@ -0,0 +1,3658 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+ Package
+ Class
+ Use
+ Tree
+ Deprecated
+ Index
+ Help
+
+
+
+
+
+
+ PREV CLASS
+ NEXT CLASS
+
+ FRAMES
+ NO FRAMES
+
+
+
+
+
+
+
+
+ SUMMARY: NESTED | FIELD | CONSTR | METHOD
+
+DETAIL: FIELD | CONSTR | METHOD
+
+
+
+
+org.hamcrest
+
+
+Class Matchers
+java.lang.Object
+
+
org.hamcrest.Matchers
+
+
+
+
+
+public class Matchers
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+
+Matchers()
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+allOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ALL of the specified matchers.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+allOf(Matcher<? super T>... matchers)
+
+
+ Creates a matcher that matches if the examined object matches ALL of the specified matchers.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+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
+
+
+
+
+
+
+<T> Matcher<T>
+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
+
+
+
+
+
+
+<T> Matcher<T>
+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
+
+
+
+
+
+
+<T> Matcher<T>
+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
+
+
+
+
+
+
+<T> Matcher<T>
+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
+
+
+
+
+
+
+<T> Matcher<T>
+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
+
+
+
+
+
+
+<T> AnyOf<T>
+anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
+
+
+
+static
+
+
+
+
+
+
+<T> AnyOf<T>
+anyOf(Matcher<? super T>... matchers)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
+
+
+
+static
+
+
+
+
+
+
+<T> AnyOf<T>
+anyOf(Matcher<T> first,
+ Matcher<? super T> second)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
+
+
+
+static
+
+
+
+
+
+
+<T> AnyOf<T>
+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
+
+
+
+
+
+
+<T> AnyOf<T>
+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
+
+
+
+
+
+
+<T> AnyOf<T>
+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
+
+
+
+
+
+
+<T> AnyOf<T>
+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 Matcher<java.lang.Object>
+anything()
+
+
+ Creates a matcher that always matches, regardless of the examined object.
+
+
+
+static Matcher<java.lang.Object>
+anything(java.lang.String description)
+
+
+ Creates a matcher that always matches, regardless of the examined object, but describes
+ itself with the specified String.
+
+
+
+static
+
+
+
+
+
+
+<T> IsArray<T>
+array(Matcher<? super T>... elementMatchers)
+
+
+ Creates a matcher that matches arrays whose elements are satisfied by the specified matchers.
+
+
+
+static
+
+
+
+
+
+
+<E> Matcher<E[]>
+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
+
+
+
+
+
+
+<E> Matcher<E[]>
+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
+
+
+
+
+
+
+<E> Matcher<E[]>
+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
+
+
+
+
+
+
+<E> Matcher<E[]>
+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
+
+
+
+
+
+
+<E> Matcher<E[]>
+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
+
+
+
+
+
+
+<E> Matcher<E[]>
+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
+
+
+
+
+
+
+<E> Matcher<E[]>
+arrayWithSize(int size)
+
+
+ Creates a matcher for arrays that matches when the length of the array
+ equals the specified size.
+
+
+
+static
+
+
+
+
+
+
+<E> Matcher<E[]>
+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
+
+
+
+
+
+
+<LHS> CombinableMatcher.CombinableBothMatcher<LHS>
+both(Matcher<? super LHS> matcher)
+
+
+ Creates a matcher that matches when both of the specified matchers match the examined object.
+
+
+
+static Matcher<java.math.BigDecimal>
+closeTo(java.math.BigDecimal operand,
+ java.math.BigDecimal error)
+
+
+ Creates a matcher of BigDecimals that matches when an examined BigDecimal is equal
+ to the specified operand, within a range of +/- error.
+
+
+
+static Matcher<java.lang.Double>
+closeTo(double operand,
+ double error)
+
+
+ Creates a matcher of Doubles that matches when an examined double is equal
+ to the specified operand, within a range of +/- error.
+
+
+
+static
+
+
+
+
+
+
+<T extends java.lang.Comparable<T>>
+
+Matcher<T>
+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
+
+
+
+
+
+
+<E> Matcher<java.lang.Iterable<? extends E>>
+contains(E... items)
+
+
+ Creates a matcher for Iterables 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
+
+
+
+
+
+
+<E> Matcher<java.lang.Iterable<? extends E>>
+contains(java.util.List<Matcher<? super E>> itemMatchers)
+
+
+ Creates a matcher for Iterables 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
+
+
+
+
+
+
+<E> Matcher<java.lang.Iterable<? extends E>>
+contains(Matcher<? super E>... itemMatchers)
+
+
+ Creates a matcher for Iterables 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
+
+
+
+
+
+
+<E> Matcher<java.lang.Iterable<? extends E>>
+contains(Matcher<? super E> itemMatcher)
+
+
+ Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<java.lang.Iterable<? extends T>>
+containsInAnyOrder(java.util.Collection<Matcher<? super T>> itemMatchers)
+
+
+ Creates an order agnostic matcher for Iterables 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
+
+
+
+
+
+
+<E> Matcher<java.lang.Iterable<? extends E>>
+containsInAnyOrder(Matcher<? super E> itemMatcher)
+
+
+ Deprecated. use contains(Matcher super E> itemMatcher) instead
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<java.lang.Iterable<? extends T>>
+containsInAnyOrder(Matcher<? super T>... itemMatchers)
+
+
+ Creates an order agnostic matcher for Iterables 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
+
+
+
+
+
+
+<T> Matcher<java.lang.Iterable<? extends T>>
+containsInAnyOrder(T... items)
+
+
+ Creates an order agnostic matcher for Iterables 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>
+containsString(java.lang.String substring)
+
+
+ Creates a matcher that matches if the examined String contains the specified
+ String anywhere.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+describedAs(java.lang.String description,
+ Matcher<T> matcher,
+ java.lang.Object... values)
+
+
+ Wraps an existing matcher, overriding its description with that specified.
+
+
+
+static
+
+
+
+
+
+
+<LHS> CombinableMatcher.CombinableEitherMatcher<LHS>
+either(Matcher<? super LHS> matcher)
+
+
+ Creates a matcher that matches when either of the specified matchers match the examined object.
+
+
+
+static
+
+
+
+
+
+
+<E> Matcher<java.util.Collection<? extends E>>
+empty()
+
+
+ Creates a matcher for Collections matching examined collections whose isEmpty
+ method returns true.
+
+
+
+static
+
+
+
+
+
+
+<E> Matcher<E[]>
+emptyArray()
+
+
+ Creates a matcher for arrays that matches when the length of the array
+ is zero.
+
+
+
+static
+
+
+
+
+
+
+<E> Matcher<java.util.Collection<E>>
+emptyCollectionOf(java.lang.Class<E> type)
+
+
+ Creates a matcher for Collections matching examined collections whose isEmpty
+ method returns true.
+
+
+
+static
+
+
+
+
+
+
+<E> Matcher<java.lang.Iterable<? extends E>>
+emptyIterable()
+
+
+ Creates a matcher for Iterables matching examined iterables that yield no items.
+
+
+
+static
+
+
+
+
+
+
+<E> Matcher<java.lang.Iterable<E>>
+emptyIterableOf(java.lang.Class<E> type)
+
+
+ Creates a matcher for Iterables matching examined iterables that yield no items.
+
+
+
+static Matcher<java.lang.String>
+endsWith(java.lang.String suffix)
+
+
+ Creates a matcher that matches if the examined String ends with the specified
+ String.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+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>
+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>
+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>
+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>
+eventFrom(java.lang.Object source)
+
+
+ Creates a matcher of EventObject that matches any EventObject
+ announced by source.
+
+
+
+static
+
+
+
+
+
+
+<U> Matcher<java.lang.Iterable<U>>
+everyItem(Matcher<U> itemMatcher)
+
+
+ Creates a matcher for Iterables that only matches when a single pass over the
+ examined Iterable yields items that are all matched by the specified
+ itemMatcher.
+
+
+
+static
+
+
+
+
+
+
+<T extends java.lang.Comparable<T>>
+
+Matcher<T>
+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
+
+
+
+
+
+
+<T extends java.lang.Comparable<T>>
+
+Matcher<T>
+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
+
+
+
+
+
+
+<K,V> Matcher<java.util.Map<? extends K,? extends V>>
+hasEntry(K key,
+ V value)
+
+
+ Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified key and whose value equals the
+ specified value.
+
+
+
+static
+
+
+
+
+
+
+<K,V> Matcher<java.util.Map<? extends K,? extends V>>
+hasEntry(Matcher<? super K> keyMatcher,
+ Matcher<? super V> valueMatcher)
+
+
+ Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcher and whose
+ value satisfies the specified valueMatcher.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<java.lang.Iterable<? super T>>
+hasItem(Matcher<? super T> itemMatcher)
+
+
+ Creates a matcher for Iterables that only matches when a single pass over the
+ examined Iterable yields at least one item that is matched by the specified
+ itemMatcher.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<java.lang.Iterable<? super T>>
+hasItem(T item)
+
+
+ Creates a matcher for Iterables that only matches when a single pass over the
+ examined Iterable yields at least one item that is equal to the specified
+ item.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T[]>
+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
+
+
+
+
+
+
+<T> Matcher<T[]>
+hasItemInArray(T element)
+
+
+ A shortcut to the frequently used hasItemInArray(equalTo(x)).
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<java.lang.Iterable<T>>
+hasItems(Matcher<? super T>... itemMatchers)
+
+
+ Creates a matcher for Iterables 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
+
+
+
+
+
+
+<T> Matcher<java.lang.Iterable<T>>
+hasItems(T... items)
+
+
+ Creates a matcher for Iterables 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
+
+
+
+
+
+
+<K> Matcher<java.util.Map<? extends K,?>>
+hasKey(K key)
+
+
+ Creates a matcher for Maps matching when the examined Map contains
+ at least one key that is equal to the specified key.
+
+
+
+static
+
+
+
+
+
+
+<K> Matcher<java.util.Map<? extends K,?>>
+hasKey(Matcher<? super K> keyMatcher)
+
+
+ Creates a matcher for Maps matching when the examined Map contains
+ at least one key that satisfies the specified matcher.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+hasProperty(java.lang.String propertyName)
+
+
+ Creates a matcher that matches when the examined object has a JavaBean property
+ with the specified name.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+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
+
+
+
+
+
+
+<E> Matcher<java.util.Collection<? extends E>>
+hasSize(int size)
+
+
+ Creates a matcher for Collections that matches when the size() method returns
+ a value equal to the specified size.
+
+
+
+static
+
+
+
+
+
+
+<E> Matcher<java.util.Collection<? extends E>>
+hasSize(Matcher<? super java.lang.Integer> sizeMatcher)
+
+
+ Creates a matcher for Collections that matches when the size() method returns
+ a value that satisfies the specified matcher.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+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
+
+
+
+
+
+
+<T> Matcher<T>
+hasToString(java.lang.String expectedToString)
+
+
+ Creates a matcher that matches any examined object whose toString method
+ returns a value equalTo the specified string.
+
+
+
+static
+
+
+
+
+
+
+<V> Matcher<java.util.Map<?,? extends V>>
+hasValue(Matcher<? super V> valueMatcher)
+
+
+ Creates a matcher for Maps matching when the examined Map contains
+ at least one value that satisfies the specified valueMatcher.
+
+
+
+static
+
+
+
+
+
+
+<V> Matcher<java.util.Map<?,? extends V>>
+hasValue(V value)
+
+
+ Creates a matcher for Maps matching when the examined Map contains
+ at least one value that is equal to the specified value.
+
+
+
+static Matcher<org.w3c.dom.Node>
+hasXPath(java.lang.String xPath)
+
+
+ Creates a matcher of Nodes that matches when the examined node contains a node
+ at the specified xPath, with any content.
+
+
+
+static Matcher<org.w3c.dom.Node>
+hasXPath(java.lang.String xPath,
+ Matcher<java.lang.String> valueMatcher)
+
+
+ Creates a matcher of Nodes 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(java.lang.String xPath,
+ javax.xml.namespace.NamespaceContext namespaceContext)
+
+
+ Creates a matcher of Nodes 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(java.lang.String xPath,
+ javax.xml.namespace.NamespaceContext namespaceContext,
+ Matcher<java.lang.String> valueMatcher)
+
+
+ Creates a matcher of Nodes that matches when the examined node has a value at the
+ specified xPath, within the specified namespaceContext, that satisfies
+ the specified valueMatcher.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+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
+
+
+
+
+
+
+<T> Matcher<T>
+is(java.lang.Class<T> type)
+
+
+ Deprecated. use isA(Class
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+is(Matcher<T> matcher)
+
+
+ Decorates another Matcher, retaining its behaviour, but allowing tests
+ to be slightly more expressive.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+is(T value)
+
+
+ A shortcut to the frequently used is(equalTo(x)).
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+isA(java.lang.Class<T> type)
+
+
+ A shortcut to the frequently used is(instanceOf(SomeClass.class)).
+
+
+
+static Matcher<java.lang.String>
+isEmptyOrNullString()
+
+
+ Creates a matcher of String that matches when the examined string is null, or
+ has zero length.
+
+
+
+static Matcher<java.lang.String>
+isEmptyString()
+
+
+ Creates a matcher of String that matches when the examined string has zero length.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+isIn(java.util.Collection<T> collection)
+
+
+ Creates a matcher that matches when the examined object is found within the
+ specified collection.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+isIn(T[] param1)
+
+
+
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+isOneOf(T... elements)
+
+
+ Creates a matcher that matches when the examined object is equal to one of the
+ specified elements.
+
+
+
+static
+
+
+
+
+
+
+<E> Matcher<java.lang.Iterable<E>>
+iterableWithSize(int size)
+
+
+ Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that is equal to the specified
+ size argument.
+
+
+
+static
+
+
+
+
+
+
+<E> Matcher<java.lang.Iterable<E>>
+iterableWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
+
+
+ Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
+
+
+
+static
+
+
+
+
+
+
+<T extends java.lang.Comparable<T>>
+
+Matcher<T>
+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
+
+
+
+
+
+
+<T extends java.lang.Comparable<T>>
+
+Matcher<T>
+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
+
+
+
+
+
+
+<T> Matcher<T>
+not(Matcher<T> matcher)
+
+
+ Creates a matcher that wraps an existing matcher, but inverts the logic by which
+ it will match.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+not(T value)
+
+
+ A shortcut to the frequently used not(equalTo(x)).
+
+
+
+static Matcher<java.lang.Object>
+notNullValue()
+
+
+ A shortcut to the frequently used not(nullValue()).
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+notNullValue(java.lang.Class<T> type)
+
+
+ A shortcut to the frequently used not(nullValue(X.class)).
+
+
+
+static Matcher<java.lang.Object>
+nullValue()
+
+
+ Creates a matcher that matches if examined object is null.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+nullValue(java.lang.Class<T> type)
+
+
+ Creates a matcher that matches if examined object is null.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+sameInstance(T target)
+
+
+ Creates a matcher that matches only when the examined object is the same instance as
+ the specified target object.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<T>
+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>
+startsWith(java.lang.String prefix)
+
+
+ Creates a matcher that matches if the examined String starts with the specified
+ String.
+
+
+
+static Matcher<java.lang.String>
+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
+
+
+
+
+
+
+<T> Matcher<T>
+theInstance(T target)
+
+
+ Creates a matcher that matches only when the examined object is the same instance as
+ the specified target object.
+
+
+
+static
+
+
+
+
+
+
+<T> Matcher<java.lang.Class<?>>
+typeCompatibleWith(java.lang.Class<T> baseType)
+
+
+ Creates a matcher of Class that matches when the specified baseType is
+ assignable from the examined class.
+
+
+
+
+Methods inherited from class java.lang.Object
+
+
+
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+
+
+
+
+
+Constructor Detail
+
+Matchers
+
+public Matchers()
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+allOf
+
+public static <T> Matcher<T> allOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+
+
+
+
+
+allOf
+
+public static <T> Matcher<T> allOf(Matcher<? super T>... matchers)
+
+
+assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+
+
+
+
+
+allOf
+
+public static <T> Matcher<T> allOf(Matcher<? super T> first,
+ Matcher<? super T> second)
+
+
+assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+
+
+
+
+
+allOf
+
+public static <T> Matcher<T> allOf(Matcher<? super T> first,
+ Matcher<? super T> second,
+ Matcher<? super T> third)
+
+
+assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+
+
+
+
+
+allOf
+
+public static <T> Matcher<T> allOf(Matcher<? super T> first,
+ Matcher<? super T> second,
+ Matcher<? super T> third,
+ Matcher<? super T> fourth)
+
+
+assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+
+
+
+
+
+allOf
+
+public static <T> Matcher<T> allOf(Matcher<? super T> first,
+ Matcher<? super T> second,
+ Matcher<? super T> third,
+ Matcher<? super T> fourth,
+ Matcher<? super T> fifth)
+
+
+assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+
+
+
+
+
+allOf
+
+public static <T> Matcher<T> 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)
+
+
+assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
+
+
+
+
+
+anyOf
+
+public static <T> AnyOf<T> anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+
+
+
+
+
+anyOf
+
+public static <T> AnyOf<T> anyOf(Matcher<T> first,
+ Matcher<? super T> second,
+ Matcher<? super T> third)
+
+
+assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+
+
+
+
+
+anyOf
+
+public static <T> AnyOf<T> anyOf(Matcher<T> first,
+ Matcher<? super T> second,
+ Matcher<? super T> third,
+ Matcher<? super T> fourth)
+
+
+assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+
+
+
+
+
+anyOf
+
+public static <T> AnyOf<T> anyOf(Matcher<T> first,
+ Matcher<? super T> second,
+ Matcher<? super T> third,
+ Matcher<? super T> fourth,
+ Matcher<? super T> fifth)
+
+
+assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+
+
+
+
+
+anyOf
+
+public static <T> AnyOf<T> anyOf(Matcher<T> first,
+ Matcher<? super T> second,
+ Matcher<? super T> third,
+ Matcher<? super T> fourth,
+ Matcher<? super T> fifth,
+ Matcher<? super T> sixth)
+
+
+assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+
+
+
+
+
+anyOf
+
+public static <T> AnyOf<T> anyOf(Matcher<T> first,
+ Matcher<? super T> second)
+
+
+assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+
+
+
+
+
+anyOf
+
+public static <T> AnyOf<T> anyOf(Matcher<? super T>... matchers)
+
+
+assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
+
+
+
+
+
+both
+
+public static <LHS> CombinableMatcher.CombinableBothMatcher<LHS> both(Matcher<? super LHS> matcher)
+
+
+assertThat("fab", both(containsString("a")).and(containsString("b")))
+
+
+
+
+
+either
+
+public static <LHS> CombinableMatcher.CombinableEitherMatcher<LHS> either(Matcher<? super LHS> matcher)
+
+
+assertThat("fan", either(containsString("a")).and(containsString("b")))
+
+
+
+
+
+describedAs
+
+public static <T> Matcher<T> describedAs(java.lang.String description,
+ Matcher<T> matcher,
+ java.lang.Object... values)
+
+
+describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())
+
+
+description - the new description for the wrapped matchermatcher - the matcher to wrapvalues - optional values to insert into the tokenised description
+
+
+everyItem
+
+public static <U> Matcher<java.lang.Iterable<U>> everyItem(Matcher<U> itemMatcher)
+
+
+Iterables that only matches when a single pass over the
+ examined Iterable yields items that are all matched by the specified
+ itemMatcher.
+
+ For example:
+ assertThat(Arrays.asList("bar", "baz"), everyItem(startsWith("ba")))
+
+
+itemMatcher - the matcher to apply to every item provided by the examined Iterable
+
+
+is
+
+public static <T> Matcher<T> is(T value)
+
+
+is(equalTo(x)).
+
+ For example:
+ assertThat(cheese, is(smelly))
+ instead of:
+ assertThat(cheese, is(equalTo(smelly)))
+
+
+
+
+
+is
+
+public static <T> Matcher<T> is(Matcher<T> matcher)
+
+
+assertThat(cheese, is(equalTo(smelly)))
+ instead of:
+ assertThat(cheese, equalTo(smelly))
+
+
+
+
+
+is
+
+public static <T> Matcher<T> is(java.lang.Class<T> type)
+
+
+is(instanceOf(SomeClass.class)).
+
+ For example:
+ assertThat(cheese, is(Cheddar.class))
+ instead of:
+ assertThat(cheese, is(instanceOf(Cheddar.class)))
+
+
+
+
+
+isA
+
+public static <T> Matcher<T> isA(java.lang.Class<T> type)
+
+
+is(instanceOf(SomeClass.class)).
+
+ For example:
+ assertThat(cheese, isA(Cheddar.class))
+ instead of:
+ assertThat(cheese, is(instanceOf(Cheddar.class)))
+
+
+
+
+
+anything
+
+public static Matcher<java.lang.Object> anything()
+
+
+
+
+
+
+
+anything
+
+public static Matcher<java.lang.Object> anything(java.lang.String description)
+
+
+String.
+
+
+description - a meaningful String used when describing itself
+
+
+hasItem
+
+public static <T> Matcher<java.lang.Iterable<? super T>> hasItem(T item)
+
+
+Iterables that only matches when a single pass over the
+ examined Iterable yields at least one item that is equal to the specified
+ item. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), hasItem("bar"))
+
+
+item - the item to compare against the items provided by the examined Iterable
+
+
+hasItem
+
+public static <T> Matcher<java.lang.Iterable<? super T>> hasItem(Matcher<? super T> itemMatcher)
+
+
+Iterables that only matches when a single pass over the
+ examined Iterable yields at least one item that is matched by the specified
+ itemMatcher. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), hasItem(startsWith("ba")))
+
+
+itemMatcher - the matcher to apply to items provided by the examined Iterable
+
+
+hasItems
+
+public static <T> Matcher<java.lang.Iterable<T>> hasItems(T... items)
+
+
+Iterables 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. Whilst matching, each traversal of the
+ examined Iterable will stop as soon as a matching item is found.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar", "baz"), hasItems("baz", "foo"))
+
+
+items - the items to compare against the items provided by the examined Iterable
+
+
+hasItems
+
+public static <T> Matcher<java.lang.Iterable<T>> hasItems(Matcher<? super T>... itemMatchers)
+
+
+Iterables 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. Whilst matching, each traversal of
+ the examined Iterable will stop as soon as a matching item is found.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar", "baz"), hasItems(endsWith("z"), endsWith("o")))
+
+
+itemMatchers - the matchers to apply to items provided by the examined Iterable
+
+
+equalTo
+
+public static <T> Matcher<T> equalTo(T operand)
+
+
+operand, as determined by calling the Object.equals(java.lang.Object) method on
+ the examined object.
+
+ null then the created matcher will only match if
+ the examined object's equals method returns true when passed a
+ null (which would be a violation of the equals contract), unless the
+ examined object itself is null, in which case the matcher will return a positive
+ match.Arrays, whereby
+ it will match if both the operand and the examined object are arrays of the same length and
+ contain items that are equal to each other (according to the above rules) in the same
+ indexes.
+ assertThat("foo", equalTo("foo"));
+ assertThat(new String[] {"foo", "bar"}, equalTo(new String[] {"foo", "bar"}));
+
+
+
+
+
+
+any
+
+public static <T> Matcher<T> any(java.lang.Class<T> type)
+
+
+type,
+ as determined by calling the Class.isInstance(Object) method on that type, passing the
+ the examined object.
+
+ with(any(Thing.class))assertThat(new Canoe(), instanceOf(Canoe.class));
+
+
+
+
+
+instanceOf
+
+public static <T> Matcher<T> instanceOf(java.lang.Class<?> type)
+
+
+type,
+ as determined by calling the Class.isInstance(Object) method on that type, passing the
+ the examined object.
+
+ assertThat(new Canoe(), instanceOf(Paddlable.class));
+
+
+
+
+
+not
+
+public static <T> Matcher<T> not(Matcher<T> matcher)
+
+
+assertThat(cheese, is(not(equalTo(smelly))))
+
+
+matcher - the matcher whose sense should be inverted
+
+
+not
+
+public static <T> Matcher<T> not(T value)
+
+
+not(equalTo(x)).
+
+ For example:
+ assertThat(cheese, is(not(smelly)))
+ instead of:
+ assertThat(cheese, is(not(equalTo(smelly))))
+
+
+value - the value that any examined object should not equal
+
+
+nullValue
+
+public static Matcher<java.lang.Object> nullValue()
+
+
+null.
+
+ For example:
+ assertThat(cheese, is(nullValue())
+
+
+
+
+
+nullValue
+
+public static <T> Matcher<T> nullValue(java.lang.Class<T> type)
+
+
+null. Accepts a
+ single dummy argument to facilitate type inference.
+
+ For example:
+ assertThat(cheese, is(nullValue(Cheese.class))
+
+
+type - dummy parameter used to infer the generic type of the returned matcher
+
+
+notNullValue
+
+public static Matcher<java.lang.Object> notNullValue()
+
+
+not(nullValue()).
+
+ For example:
+ assertThat(cheese, is(notNullValue()))
+ instead of:
+ assertThat(cheese, is(not(nullValue())))
+
+
+
+
+
+notNullValue
+
+public static <T> Matcher<T> notNullValue(java.lang.Class<T> type)
+
+
+not(nullValue(X.class)). Accepts a
+ single dummy argument to facilitate type inference..
+
+ For example:
+ assertThat(cheese, is(notNullValue(X.class)))
+ instead of:
+ assertThat(cheese, is(not(nullValue(X.class))))
+
+
+type - dummy parameter used to infer the generic type of the returned matcher
+
+
+sameInstance
+
+public static <T> Matcher<T> sameInstance(T target)
+
+
+
+
+target - the target instance against which others should be assessed
+
+
+theInstance
+
+public static <T> Matcher<T> theInstance(T target)
+
+
+
+
+target - the target instance against which others should be assessed
+
+
+containsString
+
+public static Matcher<java.lang.String> containsString(java.lang.String substring)
+
+
+String contains the specified
+ String anywhere.
+
+ For example:
+ assertThat("myStringOfNote", containsString("ring"))
+
+
+substring - the substring that the returned matcher will expect to find within any examined string
+
+
+startsWith
+
+public static Matcher<java.lang.String> startsWith(java.lang.String prefix)
+
+
+String starts with the specified
+ String.
+
+ For example:
+ assertThat("myStringOfNote", startsWith("my"))
+
+
+prefix - the substring that the returned matcher will expect at the start of any examined string
+
+
+endsWith
+
+public static Matcher<java.lang.String> endsWith(java.lang.String suffix)
+
+
+String ends with the specified
+ String.
+
+ For example:
+ assertThat("myStringOfNote", endsWith("Note"))
+
+
+suffix - the substring that the returned matcher will expect at the end of any examined string
+
+
+array
+
+public static <T> IsArray<T> array(Matcher<? super T>... elementMatchers)
+
+
+assertThat(new Integer[]{1,2,3}, is(array(equalTo(1), equalTo(2), equalTo(3))))
+
+
+elementMatchers - the matchers that the elements of examined arrays should satisfy
+
+
+hasItemInArray
+
+public static <T> Matcher<T[]> hasItemInArray(T element)
+
+
+hasItemInArray(equalTo(x)).
+
+ For example:
+ assertThat(hasItemInArray(x))
+ instead of:
+ assertThat(hasItemInArray(equalTo(x)))
+
+
+element - the element that should be present in examined arrays
+
+
+hasItemInArray
+
+public static <T> Matcher<T[]> hasItemInArray(Matcher<? super T> elementMatcher)
+
+
+elementMatcher. Whilst matching, the traversal
+ of the examined array will stop as soon as a matching element is found.
+
+ For example:
+ assertThat(new String[] {"foo", "bar"}, hasItemInArray(startsWith("ba")))
+
+
+elementMatcher - the matcher to apply to elements in examined arrays
+
+
+arrayContaining
+
+public static <E> Matcher<E[]> arrayContaining(java.util.List<Matcher<? super E>> itemMatchers)
+
+
+assertThat(new String[]{"foo", "bar"}, contains(Arrays.asList(equalTo("foo"), equalTo("bar"))))
+
+
+itemMatchers - a list of matchers, each of which must be satisfied by the corresponding item in an examined array
+
+
+arrayContaining
+
+public static <E> Matcher<E[]> arrayContaining(E... items)
+
+
+assertThat(new String[]{"foo", "bar"}, contains("foo", "bar"))
+
+
+items - the items that must equal the items within an examined array
+
+
+arrayContaining
+
+public static <E> Matcher<E[]> arrayContaining(Matcher<? super E>... itemMatchers)
+
+
+assertThat(new String[]{"foo", "bar"}, contains(equalTo("foo"), equalTo("bar")))
+
+
+itemMatchers - the matchers that must be satisfied by the items in the examined array
+
+
+arrayContainingInAnyOrder
+
+public static <E> Matcher<E[]> arrayContainingInAnyOrder(E... items)
+
+
+assertThat(new String[]{"foo", "bar"}, containsInAnyOrder("bar", "foo"))
+
+
+items - the items that must equal the entries of an examined array, in any order
+
+
+arrayContainingInAnyOrder
+
+public static <E> Matcher<E[]> arrayContainingInAnyOrder(Matcher<? super E>... itemMatchers)
+
+
+assertThat(new String[]{"foo", "bar"}, arrayContainingInAnyOrder(equalTo("bar"), equalTo("foo")))
+
+
+itemMatchers - a list of matchers, each of which must be satisfied by an entry in an examined array
+
+
+arrayContainingInAnyOrder
+
+public static <E> Matcher<E[]> arrayContainingInAnyOrder(java.util.Collection<Matcher<? super E>> itemMatchers)
+
+
+assertThat(new String[]{"foo", "bar"}, arrayContainingInAnyOrder(Arrays.asList(equalTo("bar"), equalTo("foo"))))
+
+
+itemMatchers - a list of matchers, each of which must be satisfied by an item provided by an examined array
+
+
+arrayWithSize
+
+public static <E> Matcher<E[]> arrayWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
+
+
+length of the array
+ satisfies the specified matcher.
+
+ For example:
+ assertThat(new String[]{"foo", "bar"}, arrayWithSize(equalTo(2)))
+
+
+sizeMatcher - a matcher for the length of an examined array
+
+
+arrayWithSize
+
+public static <E> Matcher<E[]> arrayWithSize(int size)
+
+
+length of the array
+ equals the specified size.
+
+ For example:
+ assertThat(new String[]{"foo", "bar"}, arrayWithSize(2))
+
+
+size - the length that an examined array must have for a positive match
+
+
+emptyArray
+
+public static <E> Matcher<E[]> emptyArray()
+
+
+length of the array
+ is zero.
+
+ For example:
+ assertThat(new String[0], emptyArray())
+
+
+
+
+
+hasSize
+
+public static <E> Matcher<java.util.Collection<? extends E>> hasSize(Matcher<? super java.lang.Integer> sizeMatcher)
+
+
+Collections that matches when the size() method returns
+ a value that satisfies the specified matcher.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), hasSize(equalTo(2)))
+
+
+sizeMatcher - a matcher for the size of an examined Collection
+
+
+hasSize
+
+public static <E> Matcher<java.util.Collection<? extends E>> hasSize(int size)
+
+
+Collections that matches when the size() method returns
+ a value equal to the specified size.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), hasSize(2))
+
+
+size - the expected size of an examined Collection
+
+
+empty
+
+public static <E> Matcher<java.util.Collection<? extends E>> empty()
+
+
+Collections matching examined collections whose isEmpty
+ method returns true.
+
+ For example:
+ assertThat(new ArrayList<String>(), is(empty()))
+
+
+
+
+
+emptyCollectionOf
+
+public static <E> Matcher<java.util.Collection<E>> emptyCollectionOf(java.lang.Class<E> type)
+
+
+Collections matching examined collections whose isEmpty
+ method returns true.
+
+ For example:
+ assertThat(new ArrayList<String>(), is(emptyCollectionOf(String.class)))
+
+
+type - the type of the collection's content
+
+
+emptyIterable
+
+public static <E> Matcher<java.lang.Iterable<? extends E>> emptyIterable()
+
+
+Iterables matching examined iterables that yield no items.
+
+ For example:
+ assertThat(new ArrayList<String>(), is(emptyIterable()))
+
+
+
+
+
+emptyIterableOf
+
+public static <E> Matcher<java.lang.Iterable<E>> emptyIterableOf(java.lang.Class<E> type)
+
+
+Iterables matching examined iterables that yield no items.
+
+ For example:
+ assertThat(new ArrayList<String>(), is(emptyIterableOf(String.class)))
+
+
+type - the type of the iterable's content
+
+
+contains
+
+public static <E> Matcher<java.lang.Iterable<? extends E>> contains(Matcher<? super E>... itemMatchers)
+
+
+Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, each satisfying the corresponding
+ matcher in the specified matchers. For a positive match, the examined iterable
+ must be of the same length as the number of specified matchers.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), contains(equalTo("foo"), equalTo("bar")))
+
+
+itemMatchers - the matchers that must be satisfied by the items provided by an examined Iterable
+
+
+contains
+
+public static <E> Matcher<java.lang.Iterable<? extends E>> contains(E... items)
+
+
+Iterables 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. For a positive match, the examined iterable
+ must be of the same length as the number of specified items.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), contains("foo", "bar"))
+
+
+items - the items that must equal the items provided by an examined Iterable
+
+
+contains
+
+public static <E> Matcher<java.lang.Iterable<? extends E>> contains(Matcher<? super E> itemMatcher)
+
+
+Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
+ For a positive match, the examined iterable must only yield one item.
+
+ For example:
+ assertThat(Arrays.asList("foo"), contains(equalTo("foo")))
+
+
+itemMatcher - the matcher that must be satisfied by the single item provided by an
+ examined Iterable
+
+
+contains
+
+public static <E> Matcher<java.lang.Iterable<? extends E>> contains(java.util.List<Matcher<? super E>> itemMatchers)
+
+
+Iterables 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. For a positive match, the examined iterable
+ must be of the same length as the specified list of matchers.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), contains(Arrays.asList(equalTo("foo"), equalTo("bar"))))
+
+
+itemMatchers - a list of matchers, each of which must be satisfied by the corresponding item provided by
+ an examined Iterable
+
+
+containsInAnyOrder
+
+public static <T> Matcher<java.lang.Iterable<? extends T>> containsInAnyOrder(T... items)
+
+
+Iterables 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. For a positive match, the examined iterable
+ must be of the same length as the number of specified items.
+
+ N.B. each of the specified items will only be used once during a given examination, so be
+ careful when specifying items that may be equal to more than one entry in an examined
+ iterable.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), containsInAnyOrder("bar", "foo"))
+
+
+items - the items that must equal the items provided by an examined Iterable in any order
+
+
+containsInAnyOrder
+
+public static <T> Matcher<java.lang.Iterable<? extends T>> containsInAnyOrder(java.util.Collection<Matcher<? super T>> itemMatchers)
+
+
+Iterables 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. For a positive match, the examined iterable
+ must be of the same length as the specified collection of matchers.
+
+ N.B. each matcher in the specified collection will only be used once during a given
+ examination, so be careful when specifying matchers that may be satisfied by more than
+ one entry in an examined iterable.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), containsInAnyOrder(Arrays.asList(equalTo("bar"), equalTo("foo"))))
+
+
+itemMatchers - a list of matchers, each of which must be satisfied by an item provided by an examined Iterable
+
+
+containsInAnyOrder
+
+public static <T> Matcher<java.lang.Iterable<? extends T>> containsInAnyOrder(Matcher<? super T>... itemMatchers)
+
+
+Iterables that matches when a single pass over
+ the examined Iterable yields a series of items, each satisfying one matcher anywhere
+ in the specified matchers. For a positive match, the examined iterable must be of the same
+ length as the number of specified matchers.
+
+ N.B. each of the specified matchers will only be used once during a given examination, so be
+ careful when specifying matchers that may be satisfied by more than one entry in an examined
+ iterable.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), containsInAnyOrder(equalTo("bar"), equalTo("foo")))
+
+
+itemMatchers - a list of matchers, each of which must be satisfied by an item provided by an examined Iterable
+
+
+containsInAnyOrder
+
+public static <E> Matcher<java.lang.Iterable<? extends E>> containsInAnyOrder(Matcher<? super E> itemMatcher)
+
+
+Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
+ For a positive match, the examined iterable must only yield one item.
+
+ For example:
+ assertThat(Arrays.asList("foo"), containsInAnyOrder(equalTo("foo")))
+
+
+itemMatcher - the matcher that must be satisfied by the single item provided by an
+ examined Iterable
+
+
+iterableWithSize
+
+public static <E> Matcher<java.lang.Iterable<E>> iterableWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
+
+
+Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), iterableWithSize(equalTo(2)))
+
+
+sizeMatcher - a matcher for the number of items that should be yielded by an examined Iterable
+
+
+iterableWithSize
+
+public static <E> Matcher<java.lang.Iterable<E>> iterableWithSize(int size)
+
+
+Iterables that matches when a single pass over the
+ examined Iterable yields an item count that is equal to the specified
+ size argument.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), iterableWithSize(2))
+
+
+size - the number of items that should be yielded by an examined Iterable
+
+
+hasEntry
+
+public static <K,V> Matcher<java.util.Map<? extends K,? extends V>> hasEntry(K key,
+ V value)
+
+
+Maps matching when the examined Map contains
+ at least one entry whose key equals the specified key and whose value equals the
+ specified value.
+
+ For example:
+ assertThat(myMap, hasEntry("bar", "foo"))
+
+
+key - the key that, in combination with the value, must be describe at least one entryvalue - the value that, in combination with the key, must be describe at least one entry
+
+
+hasEntry
+
+public static <K,V> Matcher<java.util.Map<? extends K,? extends V>> hasEntry(Matcher<? super K> keyMatcher,
+ Matcher<? super V> valueMatcher)
+
+
+Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcher and whose
+ value satisfies the specified valueMatcher.
+
+ For example:
+ assertThat(myMap, hasEntry(equalTo("bar"), equalTo("foo")))
+
+
+keyMatcher - the key matcher that, in combination with the valueMatcher, must be satisfied by at least one entryvalueMatcher - the value matcher that, in combination with the keyMatcher, must be satisfied by at least one entry
+
+
+hasKey
+
+public static <K> Matcher<java.util.Map<? extends K,?>> hasKey(Matcher<? super K> keyMatcher)
+
+
+Maps matching when the examined Map contains
+ at least one key that satisfies the specified matcher.
+
+ For example:
+ assertThat(myMap, hasKey(equalTo("bar")))
+
+
+keyMatcher - the matcher that must be satisfied by at least one key
+
+
+hasKey
+
+public static <K> Matcher<java.util.Map<? extends K,?>> hasKey(K key)
+
+
+Maps matching when the examined Map contains
+ at least one key that is equal to the specified key.
+
+ For example:
+ assertThat(myMap, hasKey("bar"))
+
+
+key - the key that satisfying maps must contain
+
+
+hasValue
+
+public static <V> Matcher<java.util.Map<?,? extends V>> hasValue(V value)
+
+
+Maps matching when the examined Map contains
+ at least one value that is equal to the specified value.
+
+ For example:
+ assertThat(myMap, hasValue("foo"))
+
+
+value - the value that satisfying maps must contain
+
+
+hasValue
+
+public static <V> Matcher<java.util.Map<?,? extends V>> hasValue(Matcher<? super V> valueMatcher)
+
+
+Maps matching when the examined Map contains
+ at least one value that satisfies the specified valueMatcher.
+
+ For example:
+ assertThat(myMap, hasValue(equalTo("foo")))
+
+
+valueMatcher - the matcher that must be satisfied by at least one value
+
+
+isIn
+
+public static <T> Matcher<T> isIn(java.util.Collection<T> collection)
+
+
+assertThat("foo", isIn(Arrays.asList("bar", "foo")))
+
+
+collection - the collection in which matching items must be found
+
+
+isIn
+
+public static <T> Matcher<T> isIn(T[] param1)
+
+
+
+
+
+
+
+isOneOf
+
+public static <T> Matcher<T> isOneOf(T... elements)
+
+
+assertThat("foo", isIn("bar", "foo"))
+
+
+elements - the elements amongst which matching items will be found
+
+
+closeTo
+
+public static Matcher<java.lang.Double> closeTo(double operand,
+ double error)
+
+
+Doubles that matches when an examined double is equal
+ to the specified operand, within a range of +/- error.
+
+ For example:
+ assertThat(1.03, is(closeTo(1.0, 0.03)))
+
+
+operand - the expected value of matching doubleserror - the delta (+/-) within which matches will be allowed
+
+
+closeTo
+
+public static Matcher<java.math.BigDecimal> closeTo(java.math.BigDecimal operand,
+ java.math.BigDecimal error)
+
+
+BigDecimals that matches when an examined BigDecimal is equal
+ to the specified operand, within a range of +/- error. The comparison for equality
+ is done by BigDecimals BigDecimal.compareTo(java.math.BigDecimal) method.
+
+ For example:
+ assertThat(new BigDecimal("1.03"), is(closeTo(new BigDecimal("1.0"), new BigDecimal("0.03"))))
+
+
+operand - the expected value of matching BigDecimalserror - the delta (+/-) within which matches will be allowed
+
+
+comparesEqualTo
+
+public static <T extends java.lang.Comparable<T>> Matcher<T> comparesEqualTo(T value)
+
+
+Comparable object that matches when the examined object is
+ equal to the specified value, as reported by the compareTo method of the
+ examined object.
+
+ For example:
+ assertThat(1, comparesEqualTo(1))
+
+
+value - the value which, when passed to the compareTo method of the examined object, should return zero
+
+
+greaterThan
+
+public static <T extends java.lang.Comparable<T>> Matcher<T> greaterThan(T value)
+
+
+Comparable object that matches when the examined object is
+ greater than the specified value, as reported by the compareTo method of the
+ examined object.
+
+ For example:
+ assertThat(2, greaterThan(1))
+
+
+value - the value which, when passed to the compareTo method of the examined object, should return greater
+ than zero
+
+
+greaterThanOrEqualTo
+
+public static <T extends java.lang.Comparable<T>> Matcher<T> greaterThanOrEqualTo(T value)
+
+
+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.
+
+ For example:
+ assertThat(1, greaterThanOrEqualTo(1))
+
+
+value - the value which, when passed to the compareTo method of the examined object, should return greater
+ than or equal to zero
+
+
+lessThan
+
+public static <T extends java.lang.Comparable<T>> Matcher<T> lessThan(T value)
+
+
+Comparable object that matches when the examined object is
+ less than the specified value, as reported by the compareTo method of the
+ examined object.
+
+ For example:
+ assertThat(1, lessThan(2))
+
+
+value - the value which, when passed to the compareTo method of the examined object, should return less
+ than zero
+
+
+lessThanOrEqualTo
+
+public static <T extends java.lang.Comparable<T>> Matcher<T> lessThanOrEqualTo(T value)
+
+
+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.
+
+ For example:
+ assertThat(1, lessThanOrEqualTo(1))
+
+
+value - the value which, when passed to the compareTo method of the examined object, should return less
+ than or equal to zero
+
+
+equalToIgnoringCase
+
+public static Matcher<java.lang.String> equalToIgnoringCase(java.lang.String expectedString)
+
+
+String that matches when the examined string is equal to
+ the specified expectedString, ignoring case.
+
+ For example:
+ assertThat("Foo", equalToIgnoringCase("FOO"))
+
+
+expectedString - the expected value of matched strings
+
+
+equalToIgnoringWhiteSpace
+
+public static Matcher<java.lang.String> equalToIgnoringWhiteSpace(java.lang.String expectedString)
+
+
+String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored. To be
+ exact, the following whitespace rules are applied:
+
+
+
+ For example:
+ assertThat(" my\tfoo bar ", equalToIgnoringWhiteSpace(" my foo bar"))
+
+
+expectedString - the expected value of matched strings
+
+
+isEmptyString
+
+public static Matcher<java.lang.String> isEmptyString()
+
+
+String that matches when the examined string has zero length.
+
+ For example:
+ assertThat("", isEmptyString())
+
+
+
+
+
+isEmptyOrNullString
+
+public static Matcher<java.lang.String> isEmptyOrNullString()
+
+
+String that matches when the examined string is null, or
+ has zero length.
+
+ For example:
+ assertThat(((String)null), isEmptyString())
+
+
+
+
+
+stringContainsInOrder
+
+public static Matcher<java.lang.String> stringContainsInOrder(java.lang.Iterable<java.lang.String> substrings)
+
+
+String that matches when the examined string contains all of
+ the specified substrings, regardless of the order of their appearance.
+
+ For example:
+ assertThat("myfoobarbaz", stringContainsInOrder(Arrays.asList("bar", "foo")))
+
+
+substrings - the substrings that must be contained within matching strings
+
+
+hasToString
+
+public static <T> Matcher<T> hasToString(Matcher<? super java.lang.String> toStringMatcher)
+
+
+toString method
+ returns a value that satisfies the specified matcher.
+
+ For example:
+ assertThat(true, hasToString(equalTo("TRUE")))
+
+
+toStringMatcher - the matcher used to verify the toString result
+
+
+hasToString
+
+public static <T> Matcher<T> hasToString(java.lang.String expectedToString)
+
+
+toString method
+ returns a value equalTo the specified string.
+
+ For example:
+ assertThat(true, hasToString("TRUE"))
+
+
+expectedToString - the expected toString result
+
+
+typeCompatibleWith
+
+public static <T> Matcher<java.lang.Class<?>> typeCompatibleWith(java.lang.Class<T> baseType)
+
+
+Class that matches when the specified baseType is
+ assignable from the examined class.
+
+ For example:
+ assertThat(Integer.class, typeCompatibleWith(Number.class))
+
+
+baseType - the base class to examine classes against
+
+
+eventFrom
+
+public static Matcher<java.util.EventObject> eventFrom(java.lang.Class<? extends java.util.EventObject> eventClass,
+ java.lang.Object source)
+
+
EventObject that matches any object
+ derived from eventClass announced by source.
+
assertThat(myEvent, is(eventFrom(PropertyChangeEvent.class, myBean)))+
+
eventClass - the class of the event to match onsource - the source of the event+public static Matcher<java.util.EventObject> eventFrom(java.lang.Object source)+
EventObject that matches any EventObject
+ announced by source.
+
+ For example:
+ assertThat(myEvent, is(eventFrom(myBean)))+
+
source - the source of the event+public static <T> Matcher<T> hasProperty(java.lang.String propertyName)+
assertThat(myBean, hasProperty("foo"))
++
propertyName - the name of the JavaBean property that examined beans should possess+public static <T> Matcher<T> hasProperty(java.lang.String propertyName, + Matcher<?> valueMatcher)+
assertThat(myBean, hasProperty("foo", equalTo("bar"))
++
propertyName - the name of the JavaBean property that examined beans should possessvalueMatcher - a matcher for the value of the specified property of the examined bean+public static <T> Matcher<T> samePropertyValuesAs(T expectedBean)+
assertThat(myBean, samePropertyValuesAs(myExpectedBean))+
+
expectedBean - the bean against which examined beans are compared+public static Matcher<org.w3c.dom.Node> hasXPath(java.lang.String xPath, + javax.xml.namespace.NamespaceContext namespaceContext)+
Nodes that matches when the examined node contains a node
+ at the specified xPath within the specified namespace context, with any content.
+
+ For example:
+ assertThat(xml, hasXPath("/root/something[2]/cheese", myNs))
++
xPath - the target xpathnamespaceContext - the namespace for matching nodes+public static Matcher<org.w3c.dom.Node> hasXPath(java.lang.String xPath)+
Nodes that matches when the examined node contains a node
+ at the specified xPath, with any content.
+
+ For example:
+ assertThat(xml, hasXPath("/root/something[2]/cheese"))
++
xPath - the target xpath+public static Matcher<org.w3c.dom.Node> hasXPath(java.lang.String xPath, + javax.xml.namespace.NamespaceContext namespaceContext, + Matcher<java.lang.String> valueMatcher)+
Nodes that matches when the examined node has a value at the
+ specified xPath, within the specified namespaceContext, that satisfies
+ the specified valueMatcher.
+
+ For example:
+ assertThat(xml, hasXPath("/root/something[2]/cheese", myNs, equalTo("Cheddar")))
++
xPath - the target xpathnamespaceContext - the namespace for matching nodesvalueMatcher - matcher for the value at the specified xpath+public static Matcher<org.w3c.dom.Node> hasXPath(java.lang.String xPath, + Matcher<java.lang.String> valueMatcher)+
Nodes that matches when the examined node has a value at the
+ specified xPath that satisfies the specified valueMatcher.
+
+ For example:
+ assertThat(xml, hasXPath("/root/something[2]/cheese", equalTo("Cheddar")))
++
xPath - the target xpathvalueMatcher - matcher for the value at the specified xpath
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
public interface SelfDescribing
+The ability of an object to describe itself. +
+ +
+
| +Method Summary | +|
|---|---|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+
| +Method Detail | +
|---|
+void describeTo(Description description)+
+
description - The description to be built or appended to.
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseDescription +
org.hamcrest.StringDescription +
public class StringDescription
+A Description that is stored as a string.
+
+ +
+
| +Nested Class Summary | +
|---|
| Nested classes/interfaces inherited from interface org.hamcrest.Description | +
|---|
Description.NullDescription |
+
| +Field Summary | +
|---|
| Fields inherited from interface org.hamcrest.Description | +
|---|
NONE |
+
| +Constructor Summary | +|
|---|---|
StringDescription()
+
++ |
+|
StringDescription(java.lang.Appendable out)
+
++ |
+|
| +Method Summary | +|
|---|---|
+protected void |
+append(char c)
+
++ Append the char c to the description. |
+
+protected void |
+append(java.lang.String str)
+
++ Append the String str to the description. |
+
+static java.lang.String |
+asString(SelfDescribing selfDescribing)
+
++ Alias for toString(SelfDescribing). |
+
+ java.lang.String |
+toString()
+
++ Returns the description as a string. |
+
+static java.lang.String |
+toString(SelfDescribing selfDescribing)
+
++ Return the description of a SelfDescribing object as a String. |
+
| Methods inherited from class org.hamcrest.BaseDescription | +
|---|
appendDescriptionOf, appendList, appendText, appendValue, appendValueList, appendValueList |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public StringDescription()+
+public StringDescription(java.lang.Appendable out)+
| +Method Detail | +
|---|
+public static java.lang.String toString(SelfDescribing selfDescribing)+
SelfDescribing object as a String.
++
selfDescribing - The object to be described.
++public static java.lang.String asString(SelfDescribing selfDescribing)+
toString(SelfDescribing).
++
+protected void append(java.lang.String str)+
BaseDescriptionBaseDescription.append(char).
+ Override in subclasses to provide an efficient implementation.
++
append in class BaseDescription+protected void append(char c)+
BaseDescription+
append in class BaseDescription+public java.lang.String toString()+
+
toString in class java.lang.Object
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeDiagnosingMatcher<T> +
T - public abstract 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. + This implements the null check, checks the type and then casts. + To use, implement
matchesSafely(). +
+ +
+
| +Constructor Summary | +|
|---|---|
+protected |
+TypeSafeDiagnosingMatcher()
+
++ The default constructor for simple sub types |
+
+protected |
+TypeSafeDiagnosingMatcher(java.lang.Class<?> expectedType)
+
++ Use this constructor if the subclass that implements matchesSafely
+ is not the class that binds <T> to a type. |
+
+protected |
+TypeSafeDiagnosingMatcher(ReflectiveTypeFinder typeFinder)
+
++ Use this constructor if the subclass that implements matchesSafely
+ is not the class that binds <T> to a type. |
+
| +Method Summary | +|
|---|---|
+ void |
+describeMismatch(java.lang.Object item,
+ Description mismatchDescription)
+
++ Generate a description of why the matcher has not accepted the item. |
+
+ boolean |
+matches(java.lang.Object item)
+
++ Evaluates the matcher for argument item. |
+
+protected abstract boolean |
+matchesSafely(T item,
+ Description mismatchDescription)
+
++ Subclasses should implement this. |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| Methods inherited from interface org.hamcrest.SelfDescribing | +
|---|
describeTo |
+
| +Constructor Detail | +
|---|
+protected TypeSafeDiagnosingMatcher(java.lang.Class<?> expectedType)+
matchesSafely
+ is not the class that binds <T> to a type.
++
expectedType - The expectedType of the actual value.+protected TypeSafeDiagnosingMatcher(ReflectiveTypeFinder typeFinder)+
matchesSafely
+ is not the class that binds <T> to a type.
++
typeFinder - A type finder to extract the type+protected TypeSafeDiagnosingMatcher()+
+
| +Method Detail | +
|---|
+protected abstract boolean matchesSafely(T item, + Description mismatchDescription)+
+
+public final boolean matches(java.lang.Object item)+
Matcher+
item - the object against which the matcher is evaluated.
+true if item matches, otherwise false.BaseMatcher+public final void describeMismatch(java.lang.Object item, + Description mismatchDescription)+
Matchermatches(item) is false, but
+ will not check this.
++
describeMismatch in interface Matcher<T>describeMismatch in class BaseMatcher<T>item - The item that the Matcher has rejected.mismatchDescription - The description to be built or appended to.
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<T> +
public abstract class TypeSafeMatcher<T>
+Convenient base class for Matchers that require a non-null value of a specific type. + This simply implements the null check, checks the type and then casts. +
+ +
+
| +Constructor Summary | +|
|---|---|
+protected |
+TypeSafeMatcher()
+
++ The default constructor for simple sub types |
+
+protected |
+TypeSafeMatcher(java.lang.Class<?> expectedType)
+
++ Use this constructor if the subclass that implements matchesSafely
+ is not the class that binds <T> to a type. |
+
+protected |
+TypeSafeMatcher(ReflectiveTypeFinder typeFinder)
+
++ Use this constructor if the subclass that implements matchesSafely
+ is not the class that binds <T> to a type. |
+
| +Method Summary | +|
|---|---|
+ void |
+describeMismatch(java.lang.Object item,
+ Description description)
+
++ Generate a description of why the matcher has not accepted the item. |
+
+protected void |
+describeMismatchSafely(T item,
+ Description mismatchDescription)
+
++ Subclasses should override this. |
+
+ boolean |
+matches(java.lang.Object item)
+
++ Methods made final to prevent accidental override. |
+
+protected abstract boolean |
+matchesSafely(T item)
+
++ Subclasses should implement this. |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| Methods inherited from interface org.hamcrest.SelfDescribing | +
|---|
describeTo |
+
| +Constructor Detail | +
|---|
+protected TypeSafeMatcher()+
+
+protected TypeSafeMatcher(java.lang.Class<?> expectedType)+
matchesSafely
+ is not the class that binds <T> to a type.
++
expectedType - The expectedType of the actual value.+protected TypeSafeMatcher(ReflectiveTypeFinder typeFinder)+
matchesSafely
+ is not the class that binds <T> to a type.
++
typeFinder - A type finder to extract the type| +Method Detail | +
|---|
+protected abstract boolean matchesSafely(T item)+
+
+protected void describeMismatchSafely(T item, + Description mismatchDescription)+
+
+public final boolean matches(java.lang.Object item)+
BaseMatcher.
++
item - the object against which the matcher is evaluated.
+true if item matches, otherwise false.BaseMatcher+public final void describeMismatch(java.lang.Object item, + Description description)+
Matchermatches(item) is false, but
+ will not check this.
++
describeMismatch in interface Matcher<T>describeMismatch in class BaseMatcher<T>item - The item that the Matcher has rejected.description - The description to be built or appended to.
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<T> +
org.hamcrest.beans.HasProperty<T> +
public class HasProperty<T>
+A Matcher that checks that an object has a JavaBean property + with the specified name. If an error occurs during introspection + of the object then this is treated as a mismatch. +
+ +
+
| +Constructor Summary | +|
|---|---|
HasProperty(java.lang.String propertyName)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+ void |
+describeMismatchSafely(T item,
+ Description mismatchDescription)
+
++ Subclasses should override this. |
+|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+static
+ |
+hasProperty(java.lang.String propertyName)
+
++ Creates a matcher that matches when the examined object has a JavaBean property + with the specified name. |
+|
+ boolean |
+matchesSafely(T obj)
+
++ Subclasses should implement this. |
+|
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public HasProperty(java.lang.String propertyName)+
| +Method Detail | +
|---|
+public boolean matchesSafely(T obj)+
TypeSafeMatcher+
matchesSafely in class TypeSafeMatcher<T>+public void describeMismatchSafely(T item, + Description mismatchDescription)+
TypeSafeMatcher+
describeMismatchSafely in class TypeSafeMatcher<T>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <T> Matcher<T> hasProperty(java.lang.String propertyName)+
assertThat(myBean, hasProperty("foo"))
++
propertyName - the name of the JavaBean property that examined beans should possess
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeDiagnosingMatcher<T> +
org.hamcrest.beans.HasPropertyWithValue<T> +
public class HasPropertyWithValue<T>
+Matcher that asserts that a JavaBean property on an argument passed to the + mock object meets the provided matcher. This is useful for when objects + are created within code under test and passed to a mock object, and you wish + to assert that the created object has certain properties. +
+
+ public class Person {
+ private String name;
+ public Person(String person) {
+ this.person = person;
+ }
+ public String getName() {
+ return name;
+ }
+ }
+
+ And that these person objects are generated within a piece of code under test
+ (a class named PersonGenerator). This object is sent to one of our mock objects
+ which overrides the PersonGenerationListener interface:
+
+ public interface PersonGenerationListener {
+ public void personGenerated(Person person);
+ }
+
+ In order to check that the code under test generates a person with name
+ "Iain" we would do the following:
+
+ Mock personGenListenerMock = mock(PersonGenerationListener.class);
+ personGenListenerMock.expects(once()).method("personGenerated").with(and(isA(Person.class), hasProperty("Name", eq("Iain")));
+ PersonGenerationListener listener = (PersonGenerationListener)personGenListenerMock.proxy();
+
+ If an exception is thrown by the getter method for a property, the property
+ does not exist, is not readable, or a reflection related exception is thrown
+ when trying to invoke it then this is treated as an evaluation failure and
+ the matches method will return false.
+
+ This matcher class will also work with JavaBean objects that have explicit
+ bean descriptions via an associated BeanInfo description class. See the
+ JavaBeans specification for more information:
+
+ http://java.sun.com/products/javabeans/docs/index.html
++ +
+
| +Constructor Summary | +|
|---|---|
HasPropertyWithValue(java.lang.String propertyName,
+ Matcher<?> valueMatcher)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+static
+ |
+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. |
+|
+ boolean |
+matchesSafely(T bean,
+ Description mismatch)
+
++ Subclasses should implement this. |
+|
| Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public HasPropertyWithValue(java.lang.String propertyName, + Matcher<?> valueMatcher)+
| +Method Detail | +
|---|
+public boolean matchesSafely(T bean, + Description mismatch)+
TypeSafeDiagnosingMatcher+
matchesSafely in class TypeSafeDiagnosingMatcher<T>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <T> Matcher<T> hasProperty(java.lang.String propertyName, + Matcher<?> valueMatcher)+
assertThat(myBean, hasProperty("foo", equalTo("bar"))
++
propertyName - the name of the JavaBean property that examined beans should possessvalueMatcher - a matcher for the value of the specified property of the examined bean
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.beans.PropertyUtil +
public class PropertyUtil
+Utility class for accessing properties on JavaBean objects. +
+ See http://java.sun.com/products/javabeans/docs/index.html for + more information on JavaBeans. ++ +
+
| +Field Summary | +|
|---|---|
+static java.lang.Object[] |
+NO_ARGUMENTS
+
++ |
+
| +Constructor Summary | +|
|---|---|
PropertyUtil()
+
++ |
+|
| +Method Summary | +|
|---|---|
+static java.beans.PropertyDescriptor |
+getPropertyDescriptor(java.lang.String propertyName,
+ java.lang.Object fromObj)
+
++ Returns the description of the property with the provided + name on the provided object's interface. |
+
+static java.beans.PropertyDescriptor[] |
+propertyDescriptorsFor(java.lang.Object fromObj,
+ java.lang.Class<java.lang.Object> stopClass)
+
++ Returns all the property descriptors for the class associated with the given object |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| +Field Detail | +
|---|
+public static final java.lang.Object[] NO_ARGUMENTS+
| +Constructor Detail | +
|---|
+public PropertyUtil()+
| +Method Detail | +
|---|
+public static java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.String propertyName, + java.lang.Object fromObj) + throws java.lang.IllegalArgumentException+
+
java.lang.IllegalArgumentException - if there's a introspection failure+public static java.beans.PropertyDescriptor[] propertyDescriptorsFor(java.lang.Object fromObj, + java.lang.Class<java.lang.Object> stopClass) + throws java.lang.IllegalArgumentException+
+
fromObj - Use the class of this objectstopClass - Don't include any properties from this ancestor class upwards.
+java.lang.IllegalArgumentException - if there's a introspection failure
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.DiagnosingMatcher<java.lang.Object> +
org.hamcrest.beans.SamePropertyValuesAs.PropertyMatcher +
public static class SamePropertyValuesAs.PropertyMatcher
+
| +Constructor Summary | +|
|---|---|
SamePropertyValuesAs.PropertyMatcher(java.beans.PropertyDescriptor descriptor,
+ java.lang.Object expectedObject)
+
++ |
+|
| +Method Summary | +|
|---|---|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+
+ boolean |
+matches(java.lang.Object actual,
+ Description mismatch)
+
++ |
+
| Methods inherited from class org.hamcrest.DiagnosingMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public SamePropertyValuesAs.PropertyMatcher(java.beans.PropertyDescriptor descriptor, + java.lang.Object expectedObject)+
| +Method Detail | +
|---|
+public boolean matches(java.lang.Object actual, + Description mismatch)+
matches in class DiagnosingMatcher<java.lang.Object>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeDiagnosingMatcher<T> +
org.hamcrest.beans.SamePropertyValuesAs<T> +
public class SamePropertyValuesAs<T>
+
| +Nested Class Summary | +|
|---|---|
+static class |
+SamePropertyValuesAs.PropertyMatcher
+
++ |
+
| +Constructor Summary | +|
|---|---|
SamePropertyValuesAs(T expectedBean)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+ boolean |
+matchesSafely(T bean,
+ Description mismatch)
+
++ Subclasses should implement this. |
+|
+static
+ |
+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 inherited from class org.hamcrest.TypeSafeDiagnosingMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public SamePropertyValuesAs(T expectedBean)+
| +Method Detail | +
|---|
+public boolean matchesSafely(T bean, + Description mismatch)+
TypeSafeDiagnosingMatcher+
matchesSafely in class TypeSafeDiagnosingMatcher<T>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <T> Matcher<T> samePropertyValuesAs(T expectedBean)+
assertThat(myBean, samePropertyValuesAs(myExpectedBean))+
+
expectedBean - the bean against which examined beans are compared
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
|
+Classes
+
+ +HasProperty + +HasPropertyWithValue + +PropertyUtil + +SamePropertyValuesAs + +SamePropertyValuesAs.PropertyMatcher |
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+See:
+
+ Description
+
+ +
| +Class Summary | +|
|---|---|
| HasProperty<T> | +A Matcher that checks that an object has a JavaBean property + with the specified name. | +
| HasPropertyWithValue<T> | +Matcher that asserts that a JavaBean property on an argument passed to the + mock object meets the provided matcher. | +
| PropertyUtil | +Utility class for accessing properties on JavaBean objects. | +
| SamePropertyValuesAs<T> | ++ |
| SamePropertyValuesAs.PropertyMatcher | ++ |
+
Matchers of Java Bean properties and their values.
++ +
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use BaseDescription | +|
|---|---|
| org.hamcrest | +The stable API defining Matcher and its associated interfaces and classes. | +
| +Uses of BaseDescription in org.hamcrest | +
|---|
+ +
| Subclasses of BaseDescription in org.hamcrest | +|
|---|---|
+ class |
+StringDescription
+
++ A Description that is stored as a string. |
+
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use BaseMatcher | +|
|---|---|
| org.hamcrest | +The stable API defining Matcher and its associated interfaces and classes. | +
| org.hamcrest.beans | +Matchers of Java Bean properties and their values. | +
| org.hamcrest.collection | +Matchers of arrays and collections. | +
| org.hamcrest.core | +Fundamental matchers of objects and values, and composite matchers. | +
| org.hamcrest.number | +Matchers that perform numeric comparisons. | +
| org.hamcrest.object | +Matchers that inspect objects and classes. | +
| org.hamcrest.text | +Matchers that perform text comparisons. | +
| org.hamcrest.xml | +Matchers of XML documents. | +
| +Uses of BaseMatcher in org.hamcrest | +
|---|
+ +
| Subclasses of BaseMatcher in org.hamcrest | +|
|---|---|
+ 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. |
+
| +Uses of BaseMatcher in org.hamcrest.beans | +
|---|
+ +
| Subclasses of BaseMatcher in org.hamcrest.beans | +|
|---|---|
+ 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
+
++ |
+
| +Uses of BaseMatcher in org.hamcrest.collection | +
|---|
+ +
| Subclasses of BaseMatcher in org.hamcrest.collection | +|
|---|---|
+ 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>
+
++ |
+
| +Uses of BaseMatcher in org.hamcrest.core | +
|---|
+ +
| Subclasses of BaseMatcher in org.hamcrest.core | +|
|---|---|
+ 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
+
++ |
+
| +Uses of BaseMatcher in org.hamcrest.number | +
|---|
+ +
| Subclasses of BaseMatcher in org.hamcrest.number | +|
|---|---|
+ 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>>
+
++ |
+
| +Uses of BaseMatcher in org.hamcrest.object | +
|---|
+ +
| Subclasses of BaseMatcher in org.hamcrest.object | +|
|---|---|
+ class |
+HasToString<T>
+
++ |
+
+ class |
+IsCompatibleType<T>
+
++ |
+
+ class |
+IsEventFrom
+
++ Tests if the value is an event announced by a specific object. |
+
| +Uses of BaseMatcher in org.hamcrest.text | +
|---|
+ +
| Subclasses of BaseMatcher in org.hamcrest.text | +|
|---|---|
+ 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
+
++ |
+
| +Uses of BaseMatcher in org.hamcrest.xml | +
|---|
+ +
| Subclasses of BaseMatcher in org.hamcrest.xml | +|
|---|---|
+ class |
+HasXPath
+
++ Applies a Matcher to a given XML Node in an existing XML Node tree, specified by an XPath expression. |
+
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use Condition.Step | +|
|---|---|
| org.hamcrest | +The stable API defining Matcher and its associated interfaces and classes. | +
| +Uses of Condition.Step in org.hamcrest | +
|---|
+ +
| Methods in org.hamcrest with parameters of type Condition.Step | +||
|---|---|---|
+abstract
+ |
+Condition.and(Condition.Step<? super T,U> mapping)
+
++ |
+|
+
+ |
+Condition.then(Condition.Step<? super T,U> mapping)
+
++ |
+|
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use Condition | +|
|---|---|
| org.hamcrest | +The stable API defining Matcher and its associated interfaces and classes. | +
| +Uses of Condition in org.hamcrest | +
|---|
+ +
| Methods in org.hamcrest that return Condition | +||
|---|---|---|
+abstract
+ |
+Condition.and(Condition.Step<? super T,U> mapping)
+
++ |
+|
+ Condition<O> |
+Condition.Step.apply(I value,
+ Description mismatch)
+
++ |
+|
+static
+ |
+Condition.matched(T theValue,
+ Description mismatch)
+
++ |
+|
+static
+ |
+Condition.notMatched()
+
++ |
+|
+
+ |
+Condition.then(Condition.Step<? super T,U> mapping)
+
++ |
+|
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use Description | +|
|---|---|
| org.hamcrest | +The stable API defining Matcher and its associated interfaces and classes. | +
| org.hamcrest.beans | +Matchers of Java Bean properties and their values. | +
| org.hamcrest.collection | +Matchers of arrays and collections. | +
| org.hamcrest.core | +Fundamental matchers of objects and values, and composite matchers. | +
| org.hamcrest.internal | ++ |
| org.hamcrest.number | +Matchers that perform numeric comparisons. | +
| org.hamcrest.object | +Matchers that inspect objects and classes. | +
| org.hamcrest.text | +Matchers that perform text comparisons. | +
| org.hamcrest.xml | +Matchers of XML documents. | +
| +Uses of Description in org.hamcrest | +
|---|
+ +
| Classes in org.hamcrest that implement Description | +|
|---|---|
+ class |
+BaseDescription
+
++ A Description that is stored as a string. |
+
+static class |
+Description.NullDescription
+
++ |
+
+ class |
+StringDescription
+
++ A Description that is stored as a string. |
+
+ +
| Fields in org.hamcrest declared as Description | +|
|---|---|
+static Description |
+Description.NONE
+
++ A description that consumes input but does nothing. |
+
+ +
| Methods in org.hamcrest that return Description | +||
|---|---|---|
+ Description |
+Description.appendDescriptionOf(SelfDescribing value)
+
++ Appends the description of a SelfDescribing value to this description. |
+|
+ Description |
+Description.NullDescription.appendDescriptionOf(SelfDescribing value)
+
++ |
+|
+ Description |
+BaseDescription.appendDescriptionOf(SelfDescribing value)
+
++ |
+|
+ Description |
+Description.appendList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<? extends SelfDescribing> values)
+
++ Appends a list of SelfDescribing objects
+ to the description. |
+|
+ Description |
+Description.NullDescription.appendList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<? extends SelfDescribing> values)
+
++ |
+|
+ Description |
+BaseDescription.appendList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<? extends SelfDescribing> values)
+
++ |
+|
+ Description |
+Description.appendText(java.lang.String text)
+
++ Appends some plain text to the description. |
+|
+ Description |
+Description.NullDescription.appendText(java.lang.String text)
+
++ |
+|
+ Description |
+BaseDescription.appendText(java.lang.String text)
+
++ |
+|
+ Description |
+Description.appendValue(java.lang.Object value)
+
++ Appends an arbitary value to the description. |
+|
+ Description |
+Description.NullDescription.appendValue(java.lang.Object value)
+
++ |
+|
+ Description |
+BaseDescription.appendValue(java.lang.Object value)
+
++ |
+|
+
+ |
+Description.appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<T> values)
+
++ Appends a list of values to the description. |
+|
+
+ |
+Description.NullDescription.appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<T> values)
+
++ |
+|
+
+ |
+BaseDescription.appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<T> values)
+
++ |
+|
+
+ |
+Description.appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ T... values)
+
++ Appends a list of values to the description. |
+|
+
+ |
+Description.NullDescription.appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ T... values)
+
++ |
+|
+
+ |
+BaseDescription.appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ T... values)
+
++ |
+|
+ +
| Methods in org.hamcrest with parameters of type Description | +||
|---|---|---|
+ Condition<O> |
+Condition.Step.apply(I value,
+ Description mismatch)
+
++ |
+|
+ void |
+TypeSafeMatcher.describeMismatch(java.lang.Object item,
+ Description description)
+
++ |
+|
+ void |
+TypeSafeDiagnosingMatcher.describeMismatch(java.lang.Object item,
+ Description mismatchDescription)
+
++ |
+|
+ void |
+Matcher.describeMismatch(java.lang.Object item,
+ Description mismatchDescription)
+
++ Generate a description of why the matcher has not accepted the item. |
+|
+ void |
+DiagnosingMatcher.describeMismatch(java.lang.Object item,
+ Description mismatchDescription)
+
++ |
+|
+ void |
+BaseMatcher.describeMismatch(java.lang.Object item,
+ Description description)
+
++ |
+|
+protected void |
+TypeSafeMatcher.describeMismatchSafely(T item,
+ Description mismatchDescription)
+
++ Subclasses should override this. |
+|
+ void |
+SelfDescribing.describeTo(Description description)
+
++ Generates a description of the object. |
+|
+ void |
+FeatureMatcher.describeTo(Description description)
+
++ |
+|
+ void |
+CustomTypeSafeMatcher.describeTo(Description description)
+
++ |
+|
+ void |
+CustomMatcher.describeTo(Description description)
+
++ |
+|
+static
+ |
+Condition.matched(T theValue,
+ Description mismatch)
+
++ |
+|
+protected abstract boolean |
+DiagnosingMatcher.matches(java.lang.Object item,
+ Description mismatchDescription)
+
++ |
+|
+protected abstract boolean |
+TypeSafeDiagnosingMatcher.matchesSafely(T item,
+ Description mismatchDescription)
+
++ Subclasses should implement this. |
+|
+protected boolean |
+FeatureMatcher.matchesSafely(T actual,
+ Description mismatch)
+
++ |
+|
| +Uses of Description in org.hamcrest.beans | +
|---|
+ +
| Methods in org.hamcrest.beans with parameters of type Description | +|
|---|---|
+ void |
+HasProperty.describeMismatchSafely(T item,
+ Description mismatchDescription)
+
++ |
+
+ void |
+SamePropertyValuesAs.describeTo(Description description)
+
++ |
+
+ void |
+SamePropertyValuesAs.PropertyMatcher.describeTo(Description description)
+
++ |
+
+ void |
+HasPropertyWithValue.describeTo(Description description)
+
++ |
+
+ void |
+HasProperty.describeTo(Description description)
+
++ |
+
+ boolean |
+SamePropertyValuesAs.PropertyMatcher.matches(java.lang.Object actual,
+ Description mismatch)
+
++ |
+
+ boolean |
+SamePropertyValuesAs.matchesSafely(T bean,
+ Description mismatch)
+
++ |
+
+ boolean |
+HasPropertyWithValue.matchesSafely(T bean,
+ Description mismatch)
+
++ |
+
| +Uses of Description in org.hamcrest.collection | +
|---|
+ +
| Methods in org.hamcrest.collection with parameters of type Description | +|
|---|---|
+ void |
+IsEmptyCollection.describeMismatchSafely(java.util.Collection<? extends E> item,
+ Description mismatchDescription)
+
++ |
+
+ void |
+IsArrayContainingInOrder.describeMismatchSafely(E[] item,
+ Description mismatchDescription)
+
++ |
+
+ void |
+IsArrayContainingInAnyOrder.describeMismatchSafely(E[] item,
+ Description mismatchDescription)
+
++ |
+
+ void |
+IsEmptyIterable.describeMismatchSafely(java.lang.Iterable<? extends E> iter,
+ Description mismatchDescription)
+
++ |
+
+ void |
+IsMapContaining.describeMismatchSafely(java.util.Map<? extends K,? extends V> map,
+ Description mismatchDescription)
+
++ |
+
+ void |
+IsArrayContaining.describeMismatchSafely(T[] item,
+ Description mismatchDescription)
+
++ |
+
+ void |
+IsArray.describeMismatchSafely(T[] actual,
+ Description mismatchDescription)
+
++ |
+
+ void |
+IsMapContaining.describeTo(Description description)
+
++ |
+
+ void |
+IsIterableContainingInOrder.describeTo(Description description)
+
++ |
+
+ void |
+IsIterableContainingInAnyOrder.describeTo(Description description)
+
++ |
+
+ void |
+IsIn.describeTo(Description buffer)
+
++ |
+
+ void |
+IsEmptyIterable.describeTo(Description description)
+
++ |
+
+ void |
+IsEmptyCollection.describeTo(Description description)
+
++ |
+
+ void |
+IsArrayContainingInOrder.describeTo(Description description)
+
++ |
+
+ void |
+IsArrayContainingInAnyOrder.describeTo(Description description)
+
++ |
+
+ void |
+IsArrayContaining.describeTo(Description description)
+
++ |
+
+ void |
+IsArray.describeTo(Description description)
+
++ |
+
+protected boolean |
+IsIterableContainingInOrder.matchesSafely(java.lang.Iterable<? extends E> iterable,
+ Description mismatchDescription)
+
++ |
+
+protected boolean |
+IsIterableContainingInAnyOrder.matchesSafely(java.lang.Iterable<? extends T> items,
+ Description mismatchDescription)
+
++ |
+
| +Uses of Description in org.hamcrest.core | +
|---|
+ +
| Methods in org.hamcrest.core with parameters of type Description | +|
|---|---|
+ void |
+Is.describeMismatch(java.lang.Object item,
+ Description mismatchDescription)
+
++ |
+
+ void |
+DescribedAs.describeMismatch(java.lang.Object item,
+ Description description)
+
++ |
+
+ void |
+SubstringMatcher.describeMismatchSafely(java.lang.String item,
+ Description mismatchDescription)
+
++ |
+
+ void |
+SubstringMatcher.describeTo(Description description)
+
++ |
+
+ void |
+IsSame.describeTo(Description description)
+
++ |
+
+ void |
+IsNull.describeTo(Description description)
+
++ |
+
+ void |
+IsNot.describeTo(Description description)
+
++ |
+
+ void |
+IsInstanceOf.describeTo(Description description)
+
++ |
+
+ void |
+IsEqual.describeTo(Description description)
+
++ |
+
+ void |
+IsCollectionContaining.describeTo(Description description)
+
++ |
+
+ void |
+IsAnything.describeTo(Description description)
+
++ |
+
+ void |
+Is.describeTo(Description description)
+
++ |
+
+ void |
+Every.describeTo(Description description)
+
++ |
+
+ void |
+DescribedAs.describeTo(Description description)
+
++ |
+
+ void |
+CombinableMatcher.describeTo(Description description)
+
++ |
+
+ void |
+AnyOf.describeTo(Description description)
+
++ |
+
+ void |
+AllOf.describeTo(Description description)
+
++ |
+
+protected boolean |
+IsInstanceOf.matches(java.lang.Object item,
+ Description mismatch)
+
++ |
+
+ boolean |
+AllOf.matches(java.lang.Object o,
+ Description mismatch)
+
++ |
+
+protected boolean |
+IsCollectionContaining.matchesSafely(java.lang.Iterable<? super T> collection,
+ Description mismatchDescription)
+
++ |
+
+ boolean |
+Every.matchesSafely(java.lang.Iterable<T> collection,
+ Description mismatchDescription)
+
++ |
+
+protected boolean |
+CombinableMatcher.matchesSafely(T item,
+ Description mismatch)
+
++ |
+
| +Uses of Description in org.hamcrest.internal | +
|---|
+ +
| Methods in org.hamcrest.internal with parameters of type Description | +|
|---|---|
+ void |
+SelfDescribingValue.describeTo(Description description)
+
++ |
+
| +Uses of Description in org.hamcrest.number | +
|---|
+ +
| Methods in org.hamcrest.number with parameters of type Description | +|
|---|---|
+ void |
+BigDecimalCloseTo.describeMismatchSafely(java.math.BigDecimal item,
+ Description mismatchDescription)
+
++ |
+
+ void |
+IsCloseTo.describeMismatchSafely(java.lang.Double item,
+ Description mismatchDescription)
+
++ |
+
+ void |
+OrderingComparison.describeMismatchSafely(T actual,
+ Description mismatchDescription)
+
++ |
+
+ void |
+OrderingComparison.describeTo(Description description)
+
++ |
+
+ void |
+IsCloseTo.describeTo(Description description)
+
++ |
+
+ void |
+BigDecimalCloseTo.describeTo(Description description)
+
++ |
+
| +Uses of Description in org.hamcrest.object | +
|---|
+ +
| Methods in org.hamcrest.object with parameters of type Description | +|
|---|---|
+ void |
+IsCompatibleType.describeMismatchSafely(java.lang.Class<?> cls,
+ Description mismatchDescription)
+
++ |
+
+ void |
+IsEventFrom.describeTo(Description description)
+
++ |
+
+ void |
+IsCompatibleType.describeTo(Description description)
+
++ |
+
+ boolean |
+IsEventFrom.matchesSafely(java.util.EventObject item,
+ Description mismatchDescription)
+
++ |
+
| +Uses of Description in org.hamcrest.text | +
|---|
+ +
| Methods in org.hamcrest.text with parameters of type Description | +|
|---|---|
+ void |
+StringContainsInOrder.describeMismatchSafely(java.lang.String item,
+ Description mismatchDescription)
+
++ |
+
+ void |
+IsEqualIgnoringWhiteSpace.describeMismatchSafely(java.lang.String item,
+ Description mismatchDescription)
+
++ |
+
+ void |
+IsEqualIgnoringCase.describeMismatchSafely(java.lang.String item,
+ Description mismatchDescription)
+
++ |
+
+ void |
+StringContainsInOrder.describeTo(Description description)
+
++ |
+
+ void |
+IsEqualIgnoringWhiteSpace.describeTo(Description description)
+
++ |
+
+ void |
+IsEqualIgnoringCase.describeTo(Description description)
+
++ |
+
+ void |
+IsEmptyString.describeTo(Description description)
+
++ |
+
| +Uses of Description in org.hamcrest.xml | +
|---|
+ +
| Methods in org.hamcrest.xml with parameters of type Description | +|
|---|---|
+ void |
+HasXPath.describeTo(Description description)
+
++ |
+
+ boolean |
+HasXPath.matchesSafely(org.w3c.dom.Node item,
+ Description mismatch)
+
++ |
+
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use DiagnosingMatcher | +|
|---|---|
| org.hamcrest.beans | +Matchers of Java Bean properties and their values. | +
| org.hamcrest.core | +Fundamental matchers of objects and values, and composite matchers. | +
| +Uses of DiagnosingMatcher in org.hamcrest.beans | +
|---|
+ +
| Subclasses of DiagnosingMatcher in org.hamcrest.beans | +|
|---|---|
+static class |
+SamePropertyValuesAs.PropertyMatcher
+
++ |
+
| +Uses of DiagnosingMatcher in org.hamcrest.core | +
|---|
+ +
| Subclasses of DiagnosingMatcher in org.hamcrest.core | +|
|---|---|
+ class |
+AllOf<T>
+
++ Calculates the logical conjunction of multiple matchers. |
+
+ class |
+IsInstanceOf
+
++ Tests whether the value is an instance of a class. |
+
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use Factory | +|
|---|---|
| org.hamcrest.beans | +Matchers of Java Bean properties and their values. | +
| org.hamcrest.collection | +Matchers of arrays and collections. | +
| org.hamcrest.core | +Fundamental matchers of objects and values, and composite matchers. | +
| org.hamcrest.number | +Matchers that perform numeric comparisons. | +
| org.hamcrest.object | +Matchers that inspect objects and classes. | +
| org.hamcrest.text | +Matchers that perform text comparisons. | +
| org.hamcrest.xml | +Matchers of XML documents. | +
| +Uses of Factory in org.hamcrest.beans | +
|---|
+ +
| Methods in org.hamcrest.beans with annotations of type Factory | +||
|---|---|---|
+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. |
+|
| +Uses of Factory in org.hamcrest.collection | +
|---|
+ +
| Methods in org.hamcrest.collection with annotations of type Factory | +||
|---|---|---|
+static
+ |
+IsArray.array(Matcher<? super T>... elementMatchers)
+
++ Creates a matcher that matches arrays whose elements are satisfied by the specified matchers. |
+|
+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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Collections 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 Collections matching examined collections whose isEmpty
+ method returns true. |
+|
+static
+ |
+IsEmptyIterable.emptyIterable()
+
++ Creates a matcher for Iterables matching examined iterables that yield no items. |
+|
+static
+ |
+IsEmptyIterable.emptyIterableOf(java.lang.Class<E> type)
+
++ Creates a matcher for Iterables matching examined iterables that yield no items. |
+|
+static
+ |
+IsMapContaining.hasEntry(K key,
+ V value)
+
++ Creates a matcher for Maps 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 Maps 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 Maps 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 Maps matching when the examined Map contains
+ at least one key that satisfies the specified matcher. |
+|
+static
+ |
+IsCollectionWithSize.hasSize(int size)
+
++ Creates a matcher for Collections 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 Collections 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 Maps matching when the examined Map contains
+ at least one value that satisfies the specified valueMatcher. |
+|
+static
+ |
+IsMapContaining.hasValue(V value)
+
++ Creates a matcher for Maps 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 Iterables 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 Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher. |
+|
| +Uses of Factory in org.hamcrest.core | +
|---|
+ +
| Methods in org.hamcrest.core with annotations of type Factory | +||
|---|---|---|
+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
+ |
+AnyOf.anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
++ Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
+|
+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,
+ 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,
+ 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 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
+ |
+CombinableMatcher.both(Matcher<? super LHS> matcher)
+
++ Creates a matcher that matches when both of the specified matchers match the examined object. |
+|
+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
+ |
+CombinableMatcher.either(Matcher<? super LHS> matcher)
+
++ Creates a matcher that matches when either of the specified matchers match the examined object. |
+|
+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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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. |
+|
| +Uses of Factory in org.hamcrest.number | +
|---|
+ +
| Methods in org.hamcrest.number with annotations of type Factory | +||
|---|---|---|
+static Matcher<java.math.BigDecimal> |
+BigDecimalCloseTo.closeTo(java.math.BigDecimal operand,
+ java.math.BigDecimal error)
+
++ Creates a matcher of BigDecimals 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 Doubles 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 Factory in org.hamcrest.object | +
|---|
+ +
| Methods in org.hamcrest.object with annotations of type Factory | +||
|---|---|---|
+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. |
+|
| +Uses of Factory in org.hamcrest.text | +
|---|
+ +
| Methods in org.hamcrest.text with annotations of type Factory | +|
|---|---|
+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 Factory in org.hamcrest.xml | +
|---|
+ +
| Methods in org.hamcrest.xml with annotations of type Factory | +|
|---|---|
+static Matcher<org.w3c.dom.Node> |
+HasXPath.hasXPath(java.lang.String xPath)
+
++ Creates a matcher of Nodes 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 Nodes 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 Nodes 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 Nodes that matches when the examined node has a value at the
+ specified xPath, within the specified namespaceContext, that satisfies
+ the specified valueMatcher. |
+
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use FeatureMatcher | +|
|---|---|
| org.hamcrest.collection | +Matchers of arrays and collections. | +
| org.hamcrest.object | +Matchers that inspect objects and classes. | +
| +Uses of FeatureMatcher in org.hamcrest.collection | +
|---|
+ +
| Subclasses of FeatureMatcher in org.hamcrest.collection | +|
|---|---|
+ class |
+IsArrayWithSize<E>
+
++ Matches if array size satisfies a nested matcher. |
+
+ class |
+IsCollectionWithSize<E>
+
++ Matches if collection size satisfies a nested matcher. |
+
+ class |
+IsIterableWithSize<E>
+
++ |
+
| +Uses of FeatureMatcher in org.hamcrest.object | +
|---|
+ +
| Subclasses of FeatureMatcher in org.hamcrest.object | +|
|---|---|
+ class |
+HasToString<T>
+
++ |
+
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + 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 BigDecimals 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 Doubles 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Collections 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 Collections matching examined collections whose isEmpty
+ method returns true. |
+|
+static
+ |
+Matchers.emptyIterable()
+
++ Creates a matcher for Iterables matching examined iterables that yield no items. |
+|
+static
+ |
+Matchers.emptyIterableOf(java.lang.Class<E> type)
+
++ Creates a matcher for Iterables 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 Iterables 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 Iterables 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 Maps 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 Maps 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Maps 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 Maps 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 Collections 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 Collections 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 Maps matching when the examined Map contains
+ at least one value that satisfies the specified valueMatcher. |
+|
+static
+ |
+Matchers.hasValue(V value)
+
++ Creates a matcher for Maps 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 Nodes 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 Nodes 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 Nodes 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 Nodes 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Maps 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 Maps 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Maps 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 Collections 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 Maps 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 Nodes 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 Nodes 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Collections 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 Collections matching examined collections whose isEmpty
+ method returns true. |
+|
+static
+ |
+IsEmptyIterable.emptyIterable()
+
++ Creates a matcher for Iterables matching examined iterables that yield no items. |
+|
+static
+ |
+IsEmptyIterable.emptyIterableOf(java.lang.Class<E> type)
+
++ Creates a matcher for Iterables matching examined iterables that yield no items. |
+|
+static
+ |
+IsMapContaining.hasEntry(K key,
+ V value)
+
++ Creates a matcher for Maps 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 Maps 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 Maps 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 Maps matching when the examined Map contains
+ at least one key that satisfies the specified matcher. |
+|
+static
+ |
+IsCollectionWithSize.hasSize(int size)
+
++ Creates a matcher for Collections 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 Collections 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 Maps matching when the examined Map contains
+ at least one value that satisfies the specified valueMatcher. |
+|
+static
+ |
+IsMapContaining.hasValue(V value)
+
++ Creates a matcher for Maps 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Maps 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 Maps 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 Maps 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 Collections 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 Maps 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 Iterables 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 BigDecimals 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 Doubles 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 Nodes 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 Nodes 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 Nodes 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 Nodes 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 Nodes 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 Nodes 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 + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use SelfDescribing | +|
|---|---|
| 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.internal | ++ |
| org.hamcrest.number | +Matchers that perform numeric comparisons. | +
| org.hamcrest.object | +Matchers that inspect objects and classes. | +
| org.hamcrest.text | +Matchers that perform text comparisons. | +
| org.hamcrest.xml | +Matchers of XML documents. | +
| +Uses of SelfDescribing in org.hamcrest | +
|---|
+ +
| Subinterfaces of SelfDescribing in org.hamcrest | +|
|---|---|
+ interface |
+Matcher<T>
+
++ A matcher over acceptable values. |
+
+ +
| Classes in org.hamcrest that implement SelfDescribing | +|
|---|---|
+ 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 with parameters of type SelfDescribing | +|
|---|---|
+ Description |
+Description.appendDescriptionOf(SelfDescribing value)
+
++ Appends the description of a SelfDescribing value to this description. |
+
+ Description |
+Description.NullDescription.appendDescriptionOf(SelfDescribing value)
+
++ |
+
+ Description |
+BaseDescription.appendDescriptionOf(SelfDescribing value)
+
++ |
+
+static java.lang.String |
+StringDescription.asString(SelfDescribing selfDescribing)
+
++ Alias for StringDescription.toString(SelfDescribing). |
+
+static java.lang.String |
+StringDescription.toString(SelfDescribing selfDescribing)
+
++ Return the description of a SelfDescribing object as a String. |
+
+ +
| Method parameters in org.hamcrest with type arguments of type SelfDescribing | +|
|---|---|
+ Description |
+Description.appendList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<? extends SelfDescribing> values)
+
++ Appends a list of SelfDescribing objects
+ to the description. |
+
+ Description |
+Description.NullDescription.appendList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<? extends SelfDescribing> values)
+
++ |
+
+ Description |
+BaseDescription.appendList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ java.lang.Iterable<? extends SelfDescribing> values)
+
++ |
+
| +Uses of SelfDescribing in org.hamcrest.beans | +
|---|
+ +
| Classes in org.hamcrest.beans that implement SelfDescribing | +|
|---|---|
+ 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
+
++ |
+
| +Uses of SelfDescribing in org.hamcrest.collection | +
|---|
+ +
| Classes in org.hamcrest.collection that implement SelfDescribing | +|
|---|---|
+ 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>
+
++ |
+
| +Uses of SelfDescribing in org.hamcrest.core | +
|---|
+ +
| Classes in org.hamcrest.core that implement SelfDescribing | +|
|---|---|
+ 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
+
++ |
+
| +Uses of SelfDescribing in org.hamcrest.internal | +
|---|
+ +
| Classes in org.hamcrest.internal that implement SelfDescribing | +|
|---|---|
+ class |
+SelfDescribingValue<T>
+
++ |
+
+ +
| Methods in org.hamcrest.internal that return SelfDescribing | +|
|---|---|
+ SelfDescribing |
+SelfDescribingValueIterator.next()
+
++ |
+
| +Uses of SelfDescribing in org.hamcrest.number | +
|---|
+ +
| Classes in org.hamcrest.number that implement SelfDescribing | +|
|---|---|
+ 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>>
+
++ |
+
| +Uses of SelfDescribing in org.hamcrest.object | +
|---|
+ +
| Classes in org.hamcrest.object that implement SelfDescribing | +|
|---|---|
+ class |
+HasToString<T>
+
++ |
+
+ class |
+IsCompatibleType<T>
+
++ |
+
+ class |
+IsEventFrom
+
++ Tests if the value is an event announced by a specific object. |
+
| +Uses of SelfDescribing in org.hamcrest.text | +
|---|
+ +
| Classes in org.hamcrest.text that implement SelfDescribing | +|
|---|---|
+ 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
+
++ |
+
| +Uses of SelfDescribing in org.hamcrest.xml | +
|---|
+ +
| Classes in org.hamcrest.xml that implement SelfDescribing | +|
|---|---|
+ class |
+HasXPath
+
++ Applies a Matcher to a given XML Node in an existing XML Node tree, specified by an XPath expression. |
+
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use TypeSafeDiagnosingMatcher | +|
|---|---|
| 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.object | +Matchers that inspect objects and classes. | +
| org.hamcrest.xml | +Matchers of XML documents. | +
| +Uses of TypeSafeDiagnosingMatcher in org.hamcrest | +
|---|
+ +
| Subclasses of TypeSafeDiagnosingMatcher in org.hamcrest | +|
|---|---|
+ class |
+FeatureMatcher<T,U>
+
++ Supporting class for matching a feature of an object. |
+
| +Uses of TypeSafeDiagnosingMatcher in org.hamcrest.beans | +
|---|
+ +
| Subclasses of TypeSafeDiagnosingMatcher in org.hamcrest.beans | +|
|---|---|
+ 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>
+
++ |
+
| +Uses of TypeSafeDiagnosingMatcher in org.hamcrest.collection | +
|---|
+ +
| Subclasses of TypeSafeDiagnosingMatcher in org.hamcrest.collection | +|
|---|---|
+ class |
+IsArrayWithSize<E>
+
++ Matches if array size satisfies a nested matcher. |
+
+ class |
+IsCollectionWithSize<E>
+
++ Matches if collection size satisfies a nested matcher. |
+
+ class |
+IsIterableContainingInAnyOrder<T>
+
++ |
+
+ class |
+IsIterableContainingInOrder<E>
+
++ |
+
+ class |
+IsIterableWithSize<E>
+
++ |
+
| +Uses of TypeSafeDiagnosingMatcher in org.hamcrest.core | +
|---|
+ +
| Subclasses of TypeSafeDiagnosingMatcher in org.hamcrest.core | +|
|---|---|
+ class |
+CombinableMatcher<T>
+
++ |
+
+ class |
+Every<T>
+
++ |
+
+ class |
+IsCollectionContaining<T>
+
++ |
+
| +Uses of TypeSafeDiagnosingMatcher in org.hamcrest.object | +
|---|
+ +
| Subclasses of TypeSafeDiagnosingMatcher in org.hamcrest.object | +|
|---|---|
+ class |
+HasToString<T>
+
++ |
+
+ class |
+IsEventFrom
+
++ Tests if the value is an event announced by a specific object. |
+
| +Uses of TypeSafeDiagnosingMatcher in org.hamcrest.xml | +
|---|
+ +
| Subclasses of TypeSafeDiagnosingMatcher in org.hamcrest.xml | +|
|---|---|
+ class |
+HasXPath
+
++ Applies a Matcher to a given XML Node in an existing XML Node tree, specified by an XPath expression. |
+
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use TypeSafeMatcher | +|
|---|---|
| org.hamcrest | +The stable API defining Matcher and its associated interfaces and classes. | +
| org.hamcrest.beans | +Matchers of Java Bean properties and their values. | +
| org.hamcrest.collection | +Matchers of arrays and collections. | +
| org.hamcrest.core | +Fundamental matchers of objects and values, and composite matchers. | +
| org.hamcrest.number | +Matchers that perform numeric comparisons. | +
| org.hamcrest.object | +Matchers that inspect objects and classes. | +
| org.hamcrest.text | +Matchers that perform text comparisons. | +
| +Uses of TypeSafeMatcher in org.hamcrest | +
|---|
+ +
| Subclasses of TypeSafeMatcher in org.hamcrest | +|
|---|---|
+ class |
+CustomTypeSafeMatcher<T>
+
++ Utility class for writing one off matchers. |
+
| +Uses of TypeSafeMatcher in org.hamcrest.beans | +
|---|
+ +
| Subclasses of TypeSafeMatcher in org.hamcrest.beans | +|
|---|---|
+ class |
+HasProperty<T>
+
++ A Matcher that checks that an object has a JavaBean property + with the specified name. |
+
| +Uses of TypeSafeMatcher in org.hamcrest.collection | +
|---|
+ +
| Subclasses of TypeSafeMatcher in org.hamcrest.collection | +|
|---|---|
+ 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 |
+IsEmptyCollection<E>
+
++ Tests if collection is empty. |
+
+ class |
+IsEmptyIterable<E>
+
++ Tests if collection is empty. |
+
+ class |
+IsMapContaining<K,V>
+
++ |
+
| +Uses of TypeSafeMatcher in org.hamcrest.core | +
|---|
+ +
| Subclasses of TypeSafeMatcher in org.hamcrest.core | +|
|---|---|
+ 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
+
++ |
+
| +Uses of TypeSafeMatcher in org.hamcrest.number | +
|---|
+ +
| Subclasses of TypeSafeMatcher in org.hamcrest.number | +|
|---|---|
+ 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>>
+
++ |
+
| +Uses of TypeSafeMatcher in org.hamcrest.object | +
|---|
+ +
| Subclasses of TypeSafeMatcher in org.hamcrest.object | +|
|---|---|
+ class |
+IsCompatibleType<T>
+
++ |
+
| +Uses of TypeSafeMatcher in org.hamcrest.text | +
|---|
+ +
| Subclasses of TypeSafeMatcher in org.hamcrest.text | +|
|---|---|
+ 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
+
++ |
+
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<T[]> +
org.hamcrest.collection.IsArray<T> +
public class IsArray<T>
+Matcher for array whose elements satisfy a sequence of matchers. + The array size must equal the number of element matchers. +
+ +
+
| +Constructor Summary | +|
|---|---|
IsArray(Matcher<? super T>[] elementMatchers)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+static
+ |
+array(Matcher<? super T>... elementMatchers)
+
++ Creates a matcher that matches arrays whose elements are satisfied by the specified matchers. |
+|
+ void |
+describeMismatchSafely(T[] actual,
+ Description mismatchDescription)
+
++ Subclasses should override this. |
+|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+protected java.lang.String |
+descriptionEnd()
+
++ Returns the string that ends the description. |
+|
+protected java.lang.String |
+descriptionSeparator()
+
++ Returns the string that separates the elements in the description. |
+|
+protected java.lang.String |
+descriptionStart()
+
++ Returns the string that starts the description. |
+|
+ boolean |
+matchesSafely(T[] array)
+
++ Subclasses should implement this. |
+|
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsArray(Matcher<? super T>[] elementMatchers)+
| +Method Detail | +
|---|
+public boolean matchesSafely(T[] array)+
TypeSafeMatcher+
matchesSafely in class TypeSafeMatcher<T[]>+public void describeMismatchSafely(T[] actual, + Description mismatchDescription)+
TypeSafeMatcher+
describeMismatchSafely in class TypeSafeMatcher<T[]>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+protected java.lang.String descriptionStart()+
+
+protected java.lang.String descriptionSeparator()+
+
+protected java.lang.String descriptionEnd()+
+
+public static <T> IsArray<T> array(Matcher<? super T>... elementMatchers)+
assertThat(new Integer[]{1,2,3}, is(array(equalTo(1), equalTo(2), equalTo(3))))
++
elementMatchers - the matchers that the elements of examined arrays should satisfy
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<T[]> +
org.hamcrest.collection.IsArrayContaining<T> +
public class IsArrayContaining<T>
+Matches if an array contains an item satisfying a nested matcher. +
+ +
+
| +Constructor Summary | +|
|---|---|
IsArrayContaining(Matcher<? super T> elementMatcher)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+ void |
+describeMismatchSafely(T[] item,
+ Description mismatchDescription)
+
++ Subclasses should override this. |
+|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+static
+ |
+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
+ |
+hasItemInArray(T element)
+
++ A shortcut to the frequently used hasItemInArray(equalTo(x)). |
+|
+ boolean |
+matchesSafely(T[] array)
+
++ Subclasses should implement this. |
+|
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsArrayContaining(Matcher<? super T> elementMatcher)+
| +Method Detail | +
|---|
+public boolean matchesSafely(T[] array)+
TypeSafeMatcher+
matchesSafely in class TypeSafeMatcher<T[]>+public void describeMismatchSafely(T[] item, + Description mismatchDescription)+
TypeSafeMatcher+
describeMismatchSafely in class TypeSafeMatcher<T[]>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <T> Matcher<T[]> hasItemInArray(Matcher<? super T> elementMatcher)+
elementMatcher. Whilst matching, the traversal
+ of the examined array will stop as soon as a matching element is found.
+
+ For example:
+ assertThat(new String[] {"foo", "bar"}, hasItemInArray(startsWith("ba")))
++
elementMatcher - the matcher to apply to elements in examined arrays+public static <T> Matcher<T[]> hasItemInArray(T element)+
hasItemInArray(equalTo(x)).
+
+ For example:
+ assertThat(hasItemInArray(x))+ instead of: +
assertThat(hasItemInArray(equalTo(x)))+
+
element - the element that should be present in examined arrays
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<E[]> +
org.hamcrest.collection.IsArrayContainingInAnyOrder<E> +
public class IsArrayContainingInAnyOrder<E>
+
| +Constructor Summary | +|
|---|---|
IsArrayContainingInAnyOrder(java.util.Collection<Matcher<? super E>> matchers)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+static
+ |
+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
+ |
+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
+ |
+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. |
+|
+ void |
+describeMismatchSafely(E[] item,
+ Description mismatchDescription)
+
++ Subclasses should override this. |
+|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+ boolean |
+matchesSafely(E[] item)
+
++ Subclasses should implement this. |
+|
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsArrayContainingInAnyOrder(java.util.Collection<Matcher<? super E>> matchers)+
| +Method Detail | +
|---|
+public boolean matchesSafely(E[] item)+
TypeSafeMatcher+
matchesSafely in class TypeSafeMatcher<E[]>+public void describeMismatchSafely(E[] item, + Description mismatchDescription)+
TypeSafeMatcher+
describeMismatchSafely in class TypeSafeMatcher<E[]>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <E> Matcher<E[]> arrayContainingInAnyOrder(Matcher<? super E>... itemMatchers)+
+ For example: +
assertThat(new String[]{"foo", "bar"}, arrayContainingInAnyOrder(equalTo("bar"), equalTo("foo")))
++
itemMatchers - a list of matchers, each of which must be satisfied by an entry in an examined array+public static <E> Matcher<E[]> arrayContainingInAnyOrder(java.util.Collection<Matcher<? super E>> itemMatchers)+
+ For example: +
assertThat(new String[]{"foo", "bar"}, arrayContainingInAnyOrder(Arrays.asList(equalTo("bar"), equalTo("foo"))))
++
itemMatchers - a list of matchers, each of which must be satisfied by an item provided by an examined array+public static <E> Matcher<E[]> arrayContainingInAnyOrder(E... items)+
+ For example: +
assertThat(new String[]{"foo", "bar"}, containsInAnyOrder("bar", "foo"))
++
items - the items that must equal the entries of an examined array, in any order
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<E[]> +
org.hamcrest.collection.IsArrayContainingInOrder<E> +
public class IsArrayContainingInOrder<E>
+
| +Constructor Summary | +|
|---|---|
IsArrayContainingInOrder(java.util.List<Matcher<? super E>> matchers)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+static
+ |
+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
+ |
+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
+ |
+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. |
+|
+ void |
+describeMismatchSafely(E[] item,
+ Description mismatchDescription)
+
++ Subclasses should override this. |
+|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+ boolean |
+matchesSafely(E[] item)
+
++ Subclasses should implement this. |
+|
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsArrayContainingInOrder(java.util.List<Matcher<? super E>> matchers)+
| +Method Detail | +
|---|
+public boolean matchesSafely(E[] item)+
TypeSafeMatcher+
matchesSafely in class TypeSafeMatcher<E[]>+public void describeMismatchSafely(E[] item, + Description mismatchDescription)+
TypeSafeMatcher+
describeMismatchSafely in class TypeSafeMatcher<E[]>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <E> Matcher<E[]> arrayContaining(E... items)+
assertThat(new String[]{"foo", "bar"}, contains("foo", "bar"))
++
items - the items that must equal the items within an examined array+public static <E> Matcher<E[]> arrayContaining(Matcher<? super E>... itemMatchers)+
assertThat(new String[]{"foo", "bar"}, contains(equalTo("foo"), equalTo("bar")))
++
itemMatchers - the matchers that must be satisfied by the items in the examined array+public static <E> Matcher<E[]> arrayContaining(java.util.List<Matcher<? super E>> itemMatchers)+
assertThat(new String[]{"foo", "bar"}, contains(Arrays.asList(equalTo("foo"), equalTo("bar"))))
++
itemMatchers - a list of matchers, each of which must be satisfied by the corresponding item in an examined array
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeDiagnosingMatcher<T> +
org.hamcrest.FeatureMatcher<E[],java.lang.Integer> +
org.hamcrest.collection.IsArrayWithSize<E> +
public class IsArrayWithSize<E>
+Matches if array size satisfies a nested matcher. +
+ +
+
| +Constructor Summary | +|
|---|---|
IsArrayWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+static
+ |
+arrayWithSize(int size)
+
++ Creates a matcher for arrays that matches when the length of the array
+ equals the specified size. |
+|
+static
+ |
+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
+ |
+emptyArray()
+
++ Creates a matcher for arrays that matches when the length of the array
+ is zero. |
+|
+protected java.lang.Integer |
+featureValueOf(E[] actual)
+
++ Implement this to extract the interesting feature. |
+|
| Methods inherited from class org.hamcrest.FeatureMatcher | +
|---|
describeTo, matchesSafely |
+
| Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsArrayWithSize(Matcher<? super java.lang.Integer> sizeMatcher)+
| +Method Detail | +
|---|
+protected java.lang.Integer featureValueOf(E[] actual)+
FeatureMatcher+
featureValueOf in class FeatureMatcher<E[],java.lang.Integer>actual - the target object
++public static <E> Matcher<E[]> arrayWithSize(Matcher<? super java.lang.Integer> sizeMatcher)+
length of the array
+ satisfies the specified matcher.
+
+ For example:
+ assertThat(new String[]{"foo", "bar"}, arrayWithSize(equalTo(2)))
++
sizeMatcher - a matcher for the length of an examined array+public static <E> Matcher<E[]> arrayWithSize(int size)+
length of the array
+ equals the specified size.
+
+ For example:
+ assertThat(new String[]{"foo", "bar"}, arrayWithSize(2))
++
size - the length that an examined array must have for a positive match+public static <E> Matcher<E[]> emptyArray()+
length of the array
+ is zero.
+
+ For example:
+ assertThat(new String[0], emptyArray())+
+
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeDiagnosingMatcher<T> +
org.hamcrest.FeatureMatcher<java.util.Collection<? extends E>,java.lang.Integer> +
org.hamcrest.collection.IsCollectionWithSize<E> +
public class IsCollectionWithSize<E>
+Matches if collection size satisfies a nested matcher. +
+ +
+
| +Constructor Summary | +|
|---|---|
IsCollectionWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+protected java.lang.Integer |
+featureValueOf(java.util.Collection<? extends E> actual)
+
++ Implement this to extract the interesting feature. |
+|
+static
+ |
+hasSize(int size)
+
++ Creates a matcher for Collections that matches when the size() method returns
+ a value equal to the specified size. |
+|
+static
+ |
+hasSize(Matcher<? super java.lang.Integer> sizeMatcher)
+
++ Creates a matcher for Collections that matches when the size() method returns
+ a value that satisfies the specified matcher. |
+|
| Methods inherited from class org.hamcrest.FeatureMatcher | +
|---|
describeTo, matchesSafely |
+
| Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsCollectionWithSize(Matcher<? super java.lang.Integer> sizeMatcher)+
| +Method Detail | +
|---|
+protected java.lang.Integer featureValueOf(java.util.Collection<? extends E> actual)+
FeatureMatcher+
featureValueOf in class FeatureMatcher<java.util.Collection<? extends E>,java.lang.Integer>actual - the target object
++public static <E> Matcher<java.util.Collection<? extends E>> hasSize(Matcher<? super java.lang.Integer> sizeMatcher)+
Collections that matches when the size() method returns
+ a value that satisfies the specified matcher.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), hasSize(equalTo(2)))
++
sizeMatcher - a matcher for the size of an examined Collection+public static <E> Matcher<java.util.Collection<? extends E>> hasSize(int size)+
Collections that matches when the size() method returns
+ a value equal to the specified size.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), hasSize(2))
++
size - the expected size of an examined Collection
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<java.util.Collection<? extends E>> +
org.hamcrest.collection.IsEmptyCollection<E> +
public class IsEmptyCollection<E>
+Tests if collection is empty. +
+ +
+
| +Constructor Summary | +|
|---|---|
IsEmptyCollection()
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+ void |
+describeMismatchSafely(java.util.Collection<? extends E> item,
+ Description mismatchDescription)
+
++ Subclasses should override this. |
+|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+static
+ |
+empty()
+
++ Creates a matcher for Collections matching examined collections whose isEmpty
+ method returns true. |
+|
+static
+ |
+emptyCollectionOf(java.lang.Class<E> type)
+
++ Creates a matcher for Collections matching examined collections whose isEmpty
+ method returns true. |
+|
+ boolean |
+matchesSafely(java.util.Collection<? extends E> item)
+
++ Subclasses should implement this. |
+|
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsEmptyCollection()+
| +Method Detail | +
|---|
+public boolean matchesSafely(java.util.Collection<? extends E> item)+
TypeSafeMatcher+
matchesSafely in class TypeSafeMatcher<java.util.Collection<? extends E>>+public void describeMismatchSafely(java.util.Collection<? extends E> item, + Description mismatchDescription)+
TypeSafeMatcher+
describeMismatchSafely in class TypeSafeMatcher<java.util.Collection<? extends E>>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <E> Matcher<java.util.Collection<? extends E>> empty()+
Collections matching examined collections whose isEmpty
+ method returns true.
+
+ For example:
+ assertThat(new ArrayList<String>(), is(empty()))+
+
+public static <E> Matcher<java.util.Collection<E>> emptyCollectionOf(java.lang.Class<E> type)+
Collections matching examined collections whose isEmpty
+ method returns true.
+
+ For example:
+ assertThat(new ArrayList<String>(), is(emptyCollectionOf(String.class)))+
+
type - the type of the collection's content
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<java.lang.Iterable<? extends E>> +
org.hamcrest.collection.IsEmptyIterable<E> +
public class IsEmptyIterable<E>
+Tests if collection is empty. +
+ +
+
| +Constructor Summary | +|
|---|---|
IsEmptyIterable()
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+ void |
+describeMismatchSafely(java.lang.Iterable<? extends E> iter,
+ Description mismatchDescription)
+
++ Subclasses should override this. |
+|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+static
+ |
+emptyIterable()
+
++ Creates a matcher for Iterables matching examined iterables that yield no items. |
+|
+static
+ |
+emptyIterableOf(java.lang.Class<E> type)
+
++ Creates a matcher for Iterables matching examined iterables that yield no items. |
+|
+ boolean |
+matchesSafely(java.lang.Iterable<? extends E> iterable)
+
++ Subclasses should implement this. |
+|
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsEmptyIterable()+
| +Method Detail | +
|---|
+public boolean matchesSafely(java.lang.Iterable<? extends E> iterable)+
TypeSafeMatcher+
matchesSafely in class TypeSafeMatcher<java.lang.Iterable<? extends E>>+public void describeMismatchSafely(java.lang.Iterable<? extends E> iter, + Description mismatchDescription)+
TypeSafeMatcher+
describeMismatchSafely in class TypeSafeMatcher<java.lang.Iterable<? extends E>>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <E> Matcher<java.lang.Iterable<? extends E>> emptyIterable()+
Iterables matching examined iterables that yield no items.
+
+ For example:
+ assertThat(new ArrayList<String>(), is(emptyIterable()))+
+
+public static <E> Matcher<java.lang.Iterable<E>> emptyIterableOf(java.lang.Class<E> type)+
Iterables matching examined iterables that yield no items.
+
+ For example:
+ assertThat(new ArrayList<String>(), is(emptyIterableOf(String.class)))+
+
type - the type of the iterable's content
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.collection.IsIn<T> +
public class IsIn<T>
+
| +Constructor Summary | +|
|---|---|
IsIn(java.util.Collection<T> collection)
+
++ |
+|
IsIn(T[] elements)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+ void |
+describeTo(Description buffer)
+
++ Generates a description of the object. |
+|
+static
+ |
+isIn(java.util.Collection<T> collection)
+
++ Creates a matcher that matches when the examined object is found within the + specified collection. |
+|
+static
+ |
+isIn(T[] elements)
+
++ Creates a matcher that matches when the examined object is found within the + specified array. |
+|
+static
+ |
+isOneOf(T... elements)
+
++ Creates a matcher that matches when the examined object is equal to one of the + specified elements. |
+|
+ boolean |
+matches(java.lang.Object o)
+
++ Evaluates the matcher for argument item. |
+|
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsIn(java.util.Collection<T> collection)+
+public IsIn(T[] elements)+
| +Method Detail | +
|---|
+public boolean matches(java.lang.Object o)+
Matcher+
o - the object against which the matcher is evaluated.
+true if item matches, otherwise false.BaseMatcher+public void describeTo(Description buffer)+
SelfDescribing+
buffer - The description to be built or appended to.+public static <T> Matcher<T> isIn(java.util.Collection<T> collection)+
assertThat("foo", isIn(Arrays.asList("bar", "foo")))
++
collection - the collection in which matching items must be found+public static <T> Matcher<T> isIn(T[] elements)+
assertThat("foo", isIn(new String[]{"bar", "foo"}))
++
elements - the array in which matching items must be found+public static <T> Matcher<T> isOneOf(T... elements)+
assertThat("foo", isIn("bar", "foo"))
++
elements - the elements amongst which matching items will be found
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeDiagnosingMatcher<java.lang.Iterable<? extends T>> +
org.hamcrest.collection.IsIterableContainingInAnyOrder<T> +
public class IsIterableContainingInAnyOrder<T>
+
| +Constructor Summary | +|
|---|---|
IsIterableContainingInAnyOrder(java.util.Collection<Matcher<? super T>> matchers)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+static
+ |
+containsInAnyOrder(java.util.Collection<Matcher<? super T>> itemMatchers)
+
++ Creates an order agnostic matcher for Iterables 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
+ |
+containsInAnyOrder(Matcher<? super E> itemMatcher)
+
++ Deprecated. use contains(Matcher super E> itemMatcher) instead |
+|
+static
+ |
+containsInAnyOrder(Matcher<? super T>... itemMatchers)
+
++ Creates an order agnostic matcher for Iterables 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
+ |
+containsInAnyOrder(T... items)
+
++ Creates an order agnostic matcher for Iterables 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. |
+|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+protected boolean |
+matchesSafely(java.lang.Iterable<? extends T> items,
+ Description mismatchDescription)
+
++ Subclasses should implement this. |
+|
| Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsIterableContainingInAnyOrder(java.util.Collection<Matcher<? super T>> matchers)+
| +Method Detail | +
|---|
+protected boolean matchesSafely(java.lang.Iterable<? extends T> items, + Description mismatchDescription)+
TypeSafeDiagnosingMatcher+
matchesSafely in class TypeSafeDiagnosingMatcher<java.lang.Iterable<? extends T>>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+@Deprecated +public static <E> Matcher<java.lang.Iterable<? extends E>> containsInAnyOrder(Matcher<? super E> itemMatcher)+
+
Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
+ For a positive match, the examined iterable must only yield one item.
+
+ For example:
+ assertThat(Arrays.asList("foo"), containsInAnyOrder(equalTo("foo")))
++
itemMatcher - the matcher that must be satisfied by the single item provided by an
+ examined Iterable+public static <T> Matcher<java.lang.Iterable<? extends T>> containsInAnyOrder(Matcher<? super T>... itemMatchers)+
Iterables that matches when a single pass over
+ the examined Iterable yields a series of items, each satisfying one matcher anywhere
+ in the specified matchers. For a positive match, the examined iterable must be of the same
+ length as the number of specified matchers.
+
+ N.B. each of the specified matchers will only be used once during a given examination, so be
+ careful when specifying matchers that may be satisfied by more than one entry in an examined
+ iterable.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), containsInAnyOrder(equalTo("bar"), equalTo("foo")))
++
itemMatchers - a list of matchers, each of which must be satisfied by an item provided by an examined Iterable+public static <T> Matcher<java.lang.Iterable<? extends T>> containsInAnyOrder(T... items)+
Iterables 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. For a positive match, the examined iterable
+ must be of the same length as the number of specified items.
+
+ N.B. each of the specified items will only be used once during a given examination, so be
+ careful when specifying items that may be equal to more than one entry in an examined
+ iterable.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), containsInAnyOrder("bar", "foo"))
++
items - the items that must equal the items provided by an examined Iterable in any order+public static <T> Matcher<java.lang.Iterable<? extends T>> containsInAnyOrder(java.util.Collection<Matcher<? super T>> itemMatchers)+
Iterables 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. For a positive match, the examined iterable
+ must be of the same length as the specified collection of matchers.
+
+ N.B. each matcher in the specified collection will only be used once during a given
+ examination, so be careful when specifying matchers that may be satisfied by more than
+ one entry in an examined iterable.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), containsInAnyOrder(Arrays.asList(equalTo("bar"), equalTo("foo"))))
++
itemMatchers - a list of matchers, each of which must be satisfied by an item provided by an examined Iterable
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeDiagnosingMatcher<java.lang.Iterable<? extends E>> +
org.hamcrest.collection.IsIterableContainingInOrder<E> +
public class IsIterableContainingInOrder<E>
+
| +Constructor Summary | +|
|---|---|
IsIterableContainingInOrder(java.util.List<Matcher<? super E>> matchers)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+static
+ |
+contains(E... items)
+
++ Creates a matcher for Iterables 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
+ |
+contains(java.util.List<Matcher<? super E>> itemMatchers)
+
++ Creates a matcher for Iterables 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
+ |
+contains(Matcher<? super E>... itemMatchers)
+
++ Creates a matcher for Iterables 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
+ |
+contains(Matcher<? super E> itemMatcher)
+
++ Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher. |
+|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+protected boolean |
+matchesSafely(java.lang.Iterable<? extends E> iterable,
+ Description mismatchDescription)
+
++ Subclasses should implement this. |
+|
| Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsIterableContainingInOrder(java.util.List<Matcher<? super E>> matchers)+
| +Method Detail | +
|---|
+protected boolean matchesSafely(java.lang.Iterable<? extends E> iterable, + Description mismatchDescription)+
TypeSafeDiagnosingMatcher+
matchesSafely in class TypeSafeDiagnosingMatcher<java.lang.Iterable<? extends E>>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <E> Matcher<java.lang.Iterable<? extends E>> contains(E... items)+
Iterables 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. For a positive match, the examined iterable
+ must be of the same length as the number of specified items.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), contains("foo", "bar"))
++
items - the items that must equal the items provided by an examined Iterable+public static <E> Matcher<java.lang.Iterable<? extends E>> contains(Matcher<? super E> itemMatcher)+
Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
+ For a positive match, the examined iterable must only yield one item.
+
+ For example:
+ assertThat(Arrays.asList("foo"), contains(equalTo("foo")))
++
itemMatcher - the matcher that must be satisfied by the single item provided by an
+ examined Iterable+public static <E> Matcher<java.lang.Iterable<? extends E>> contains(Matcher<? super E>... itemMatchers)+
Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, each satisfying the corresponding
+ matcher in the specified matchers. For a positive match, the examined iterable
+ must be of the same length as the number of specified matchers.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), contains(equalTo("foo"), equalTo("bar")))
++
itemMatchers - the matchers that must be satisfied by the items provided by an examined Iterable+public static <E> Matcher<java.lang.Iterable<? extends E>> contains(java.util.List<Matcher<? super E>> itemMatchers)+
Iterables 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. For a positive match, the examined iterable
+ must be of the same length as the specified list of matchers.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), contains(Arrays.asList(equalTo("foo"), equalTo("bar"))))
++
itemMatchers - a list of matchers, each of which must be satisfied by the corresponding item provided by
+ an examined Iterable
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeDiagnosingMatcher<T> +
org.hamcrest.FeatureMatcher<java.lang.Iterable<E>,java.lang.Integer> +
org.hamcrest.collection.IsIterableWithSize<E> +
public class IsIterableWithSize<E>
+
| +Constructor Summary | +|
|---|---|
IsIterableWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+protected java.lang.Integer |
+featureValueOf(java.lang.Iterable<E> actual)
+
++ Implement this to extract the interesting feature. |
+|
+static
+ |
+iterableWithSize(int size)
+
++ Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that is equal to the specified
+ size argument. |
+|
+static
+ |
+iterableWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
+
++ Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher. |
+|
| Methods inherited from class org.hamcrest.FeatureMatcher | +
|---|
describeTo, matchesSafely |
+
| Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsIterableWithSize(Matcher<? super java.lang.Integer> sizeMatcher)+
| +Method Detail | +
|---|
+protected java.lang.Integer featureValueOf(java.lang.Iterable<E> actual)+
FeatureMatcher+
featureValueOf in class FeatureMatcher<java.lang.Iterable<E>,java.lang.Integer>actual - the target object
++public static <E> Matcher<java.lang.Iterable<E>> iterableWithSize(Matcher<? super java.lang.Integer> sizeMatcher)+
Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), iterableWithSize(equalTo(2)))
++
sizeMatcher - a matcher for the number of items that should be yielded by an examined Iterable+public static <E> Matcher<java.lang.Iterable<E>> iterableWithSize(int size)+
Iterables that matches when a single pass over the
+ examined Iterable yields an item count that is equal to the specified
+ size argument.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), iterableWithSize(2))
++
size - the number of items that should be yielded by an examined Iterable
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<java.util.Map<? extends K,? extends V>> +
org.hamcrest.collection.IsMapContaining<K,V> +
public class IsMapContaining<K,V>
+
| +Constructor Summary | +|
|---|---|
IsMapContaining(Matcher<? super K> keyMatcher,
+ Matcher<? super V> valueMatcher)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+ void |
+describeMismatchSafely(java.util.Map<? extends K,? extends V> map,
+ Description mismatchDescription)
+
++ Subclasses should override this. |
+|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+static
+ |
+hasEntry(K key,
+ V value)
+
++ Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified key and whose value equals the
+ specified value. |
+|
+static
+ |
+hasEntry(Matcher<? super K> keyMatcher,
+ Matcher<? super V> valueMatcher)
+
++ Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcher and whose
+ value satisfies the specified valueMatcher. |
+|
+static
+ |
+hasKey(K key)
+
++ Creates a matcher for Maps matching when the examined Map contains
+ at least one key that is equal to the specified key. |
+|
+static
+ |
+hasKey(Matcher<? super K> keyMatcher)
+
++ Creates a matcher for Maps matching when the examined Map contains
+ at least one key that satisfies the specified matcher. |
+|
+static
+ |
+hasValue(Matcher<? super V> valueMatcher)
+
++ Creates a matcher for Maps matching when the examined Map contains
+ at least one value that satisfies the specified valueMatcher. |
+|
+static
+ |
+hasValue(V value)
+
++ Creates a matcher for Maps matching when the examined Map contains
+ at least one value that is equal to the specified value. |
+|
+ boolean |
+matchesSafely(java.util.Map<? extends K,? extends V> map)
+
++ Subclasses should implement this. |
+|
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsMapContaining(Matcher<? super K> keyMatcher, + Matcher<? super V> valueMatcher)+
| +Method Detail | +
|---|
+public boolean matchesSafely(java.util.Map<? extends K,? extends V> map)+
TypeSafeMatcher+
matchesSafely in class TypeSafeMatcher<java.util.Map<? extends K,? extends V>>+public void describeMismatchSafely(java.util.Map<? extends K,? extends V> map, + Description mismatchDescription)+
TypeSafeMatcher+
describeMismatchSafely in class TypeSafeMatcher<java.util.Map<? extends K,? extends V>>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <K,V> Matcher<java.util.Map<? extends K,? extends V>> hasEntry(Matcher<? super K> keyMatcher, + Matcher<? super V> valueMatcher)+
Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcher and whose
+ value satisfies the specified valueMatcher.
+
+ For example:
+ assertThat(myMap, hasEntry(equalTo("bar"), equalTo("foo")))
++
keyMatcher - the key matcher that, in combination with the valueMatcher, must be satisfied by at least one entryvalueMatcher - the value matcher that, in combination with the keyMatcher, must be satisfied by at least one entry+public static <K,V> Matcher<java.util.Map<? extends K,? extends V>> hasEntry(K key, + V value)+
Maps matching when the examined Map contains
+ at least one entry whose key equals the specified key and whose value equals the
+ specified value.
+
+ For example:
+ assertThat(myMap, hasEntry("bar", "foo"))
++
key - the key that, in combination with the value, must be describe at least one entryvalue - the value that, in combination with the key, must be describe at least one entry+public static <K> Matcher<java.util.Map<? extends K,?>> hasKey(Matcher<? super K> keyMatcher)+
Maps matching when the examined Map contains
+ at least one key that satisfies the specified matcher.
+
+ For example:
+ assertThat(myMap, hasKey(equalTo("bar")))
++
keyMatcher - the matcher that must be satisfied by at least one key+public static <K> Matcher<java.util.Map<? extends K,?>> hasKey(K key)+
Maps matching when the examined Map contains
+ at least one key that is equal to the specified key.
+
+ For example:
+ assertThat(myMap, hasKey("bar"))
++
key - the key that satisfying maps must contain+public static <V> Matcher<java.util.Map<?,? extends V>> hasValue(Matcher<? super V> valueMatcher)+
Maps matching when the examined Map contains
+ at least one value that satisfies the specified valueMatcher.
+
+ For example:
+ assertThat(myMap, hasValue(equalTo("foo")))
++
valueMatcher - the matcher that must be satisfied by at least one value+public static <V> Matcher<java.util.Map<?,? extends V>> hasValue(V value)+
Maps matching when the examined Map contains
+ at least one value that is equal to the specified value.
+
+ For example:
+ assertThat(myMap, hasValue("foo"))
++
value - the value that satisfying maps must contain
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use IsArray | +|
|---|---|
| org.hamcrest | +The stable API defining Matcher and its associated interfaces and classes. | +
| org.hamcrest.collection | +Matchers of arrays and collections. | +
| +Uses of IsArray in org.hamcrest | +
|---|
+ +
| Methods in org.hamcrest that return IsArray | +||
|---|---|---|
+static
+ |
+Matchers.array(Matcher<? super T>... elementMatchers)
+
++ Creates a matcher that matches arrays whose elements are satisfied by the specified matchers. |
+|
| +Uses of IsArray in org.hamcrest.collection | +
|---|
+ +
| Methods in org.hamcrest.collection that return IsArray | +||
|---|---|---|
+static
+ |
+IsArray.array(Matcher<? super T>... elementMatchers)
+
++ Creates a matcher that matches arrays whose elements are satisfied by the specified matchers. |
+|
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
|
+Classes
+
+ +IsArray + +IsArrayContaining + +IsArrayContainingInAnyOrder + +IsArrayContainingInOrder + +IsArrayWithSize + +IsCollectionWithSize + +IsEmptyCollection + +IsEmptyIterable + +IsIn + +IsIterableContainingInAnyOrder + +IsIterableContainingInOrder + +IsIterableWithSize + +IsMapContaining |
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+See:
+
+ Description
+
+ +
| +Class Summary | +|
|---|---|
| IsArray<T> | +Matcher for array whose elements satisfy a sequence of matchers. | +
| IsArrayContaining<T> | +Matches if an array contains an item satisfying a nested matcher. | +
| IsArrayContainingInAnyOrder<E> | ++ |
| IsArrayContainingInOrder<E> | ++ |
| IsArrayWithSize<E> | +Matches if array size satisfies a nested matcher. | +
| IsCollectionWithSize<E> | +Matches if collection size satisfies a nested matcher. | +
| IsEmptyCollection<E> | +Tests if collection is empty. | +
| IsEmptyIterable<E> | +Tests if collection is empty. | +
| IsIn<T> | ++ |
| IsIterableContainingInAnyOrder<T> | ++ |
| IsIterableContainingInOrder<E> | ++ |
| IsIterableWithSize<E> | ++ |
| IsMapContaining<K,V> | ++ |
+
Matchers of arrays and collections.
++ +
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use org.hamcrest.collection | +|
|---|---|
| org.hamcrest | +The stable API defining Matcher and its associated interfaces and classes. | +
| org.hamcrest.collection | +Matchers of arrays and collections. | +
| +Classes in org.hamcrest.collection used by org.hamcrest | +|
|---|---|
| IsArray
+
+ + Matcher for array whose elements satisfy a sequence of matchers. |
+|
| +Classes in org.hamcrest.collection used by org.hamcrest.collection | +|
|---|---|
| IsArray
+
+ + Matcher for array whose elements satisfy a sequence of matchers. |
+|
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.DiagnosingMatcher<T> +
org.hamcrest.core.AllOf<T> +
public class AllOf<T>
+Calculates the logical conjunction of multiple matchers. Evaluation is shortcut, so
+ subsequent matchers are not called if an earlier matcher returns false.
+
+ +
+
| +Constructor Summary | +|
|---|---|
AllOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+static
+ |
+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(Matcher<? super T>... matchers)
+
++ Creates a matcher that matches if the examined object matches ALL of the specified matchers. |
+|
+static
+ |
+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(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(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(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(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. |
+|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+ boolean |
+matches(java.lang.Object o,
+ Description mismatch)
+
++ |
+|
| Methods inherited from class org.hamcrest.DiagnosingMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public AllOf(java.lang.Iterable<Matcher<? super T>> matchers)+
| +Method Detail | +
|---|
+public boolean matches(java.lang.Object o, + Description mismatch)+
matches in class DiagnosingMatcher<T>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <T> Matcher<T> allOf(java.lang.Iterable<Matcher<? super T>> matchers)+
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
++
+public static <T> Matcher<T> allOf(Matcher<? super T>... matchers)+
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
++
+public static <T> Matcher<T> allOf(Matcher<? super T> first, + Matcher<? super T> second)+
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
++
+public static <T> Matcher<T> allOf(Matcher<? super T> first, + Matcher<? super T> second, + Matcher<? super T> third)+
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
++
+public static <T> Matcher<T> allOf(Matcher<? super T> first, + Matcher<? super T> second, + Matcher<? super T> third, + Matcher<? super T> fourth)+
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
++
+public static <T> Matcher<T> allOf(Matcher<? super T> first, + Matcher<? super T> second, + Matcher<? super T> third, + Matcher<? super T> fourth, + Matcher<? super T> fifth)+
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
++
+public static <T> Matcher<T> 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)+
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))
++
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.core.AnyOf<T> +
public class AnyOf<T>
+Calculates the logical disjunction of multiple matchers. Evaluation is shortcut, so
+ subsequent matchers are not called if an earlier matcher returns true.
+
+ +
+
| +Constructor Summary | +|
|---|---|
AnyOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+static
+ |
+anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
++ Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
+|
+static
+ |
+anyOf(Matcher<? super T>... matchers)
+
++ Creates a matcher that matches if the examined object matches ANY of the specified matchers. |
+|
+static
+ |
+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(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(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(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(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. |
+|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+ void |
+describeTo(Description description,
+ java.lang.String operator)
+
++ |
+|
+ boolean |
+matches(java.lang.Object o)
+
++ Evaluates the matcher for argument item. |
+|
+protected boolean |
+matches(java.lang.Object o,
+ boolean shortcut)
+
++ |
+|
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public AnyOf(java.lang.Iterable<Matcher<? super T>> matchers)+
| +Method Detail | +
|---|
+public boolean matches(java.lang.Object o)+
Matcher+
matches in interface Matcher<T>o - the object against which the matcher is evaluated.
+true if item matches, otherwise false.BaseMatcher+public void describeTo(Description description)+
SelfDescribing+
describeTo in interface SelfDescribingdescription - The description to be built or appended to.+public static <T> AnyOf<T> anyOf(java.lang.Iterable<Matcher<? super T>> matchers)+
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
++
+public static <T> AnyOf<T> anyOf(Matcher<? super T>... matchers)+
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
++
+public static <T> AnyOf<T> anyOf(Matcher<T> first, + Matcher<? super T> second)+
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
++
+public static <T> AnyOf<T> anyOf(Matcher<T> first, + Matcher<? super T> second, + Matcher<? super T> third)+
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
++
+public static <T> AnyOf<T> anyOf(Matcher<T> first, + Matcher<? super T> second, + Matcher<? super T> third, + Matcher<? super T> fourth)+
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
++
+public static <T> AnyOf<T> anyOf(Matcher<T> first, + Matcher<? super T> second, + Matcher<? super T> third, + Matcher<? super T> fourth, + Matcher<? super T> fifth)+
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
++
+public static <T> AnyOf<T> anyOf(Matcher<T> first, + Matcher<? super T> second, + Matcher<? super T> third, + Matcher<? super T> fourth, + Matcher<? super T> fifth, + Matcher<? super T> sixth)+
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))
++
+protected boolean matches(java.lang.Object o, + boolean shortcut)+
+public void describeTo(Description description, + java.lang.String operator)+
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.core.CombinableMatcher.CombinableBothMatcher<X> +
public static final class CombinableMatcher.CombinableBothMatcher<X>
+
| +Constructor Summary | +|
|---|---|
CombinableMatcher.CombinableBothMatcher(Matcher<? super X> matcher)
+
++ |
+|
| +Method Summary | +|
|---|---|
+ CombinableMatcher<X> |
+and(Matcher<? super X> other)
+
++ |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public CombinableMatcher.CombinableBothMatcher(Matcher<? super X> matcher)+
| +Method Detail | +
|---|
+public CombinableMatcher<X> and(Matcher<? super X> other)+
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.core.CombinableMatcher.CombinableEitherMatcher<X> +
public static final class CombinableMatcher.CombinableEitherMatcher<X>
+
| +Constructor Summary | +|
|---|---|
CombinableMatcher.CombinableEitherMatcher(Matcher<? super X> matcher)
+
++ |
+|
| +Method Summary | +|
|---|---|
+ CombinableMatcher<X> |
+or(Matcher<? super X> other)
+
++ |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public CombinableMatcher.CombinableEitherMatcher(Matcher<? super X> matcher)+
| +Method Detail | +
|---|
+public CombinableMatcher<X> or(Matcher<? super X> other)+
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeDiagnosingMatcher<T> +
org.hamcrest.core.CombinableMatcher<T> +
public class CombinableMatcher<T>
+
| +Nested Class Summary | +|
|---|---|
+static class |
+CombinableMatcher.CombinableBothMatcher<X>
+
++ |
+
+static class |
+CombinableMatcher.CombinableEitherMatcher<X>
+
++ |
+
| +Constructor Summary | +|
|---|---|
CombinableMatcher(Matcher<? super T> matcher)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+ CombinableMatcher<T> |
+and(Matcher<? super T> other)
+
++ |
+|
+static
+ |
+both(Matcher<? super LHS> matcher)
+
++ Creates a matcher that matches when both of the specified matchers match the examined object. |
+|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+static
+ |
+either(Matcher<? super LHS> matcher)
+
++ Creates a matcher that matches when either of the specified matchers match the examined object. |
+|
+protected boolean |
+matchesSafely(T item,
+ Description mismatch)
+
++ Subclasses should implement this. |
+|
+ CombinableMatcher<T> |
+or(Matcher<? super T> other)
+
++ |
+|
| Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public CombinableMatcher(Matcher<? super T> matcher)+
| +Method Detail | +
|---|
+protected boolean matchesSafely(T item, + Description mismatch)+
TypeSafeDiagnosingMatcher+
matchesSafely in class TypeSafeDiagnosingMatcher<T>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public CombinableMatcher<T> and(Matcher<? super T> other)+
+public CombinableMatcher<T> or(Matcher<? super T> other)+
+public static <LHS> CombinableMatcher.CombinableBothMatcher<LHS> both(Matcher<? super LHS> matcher)+
assertThat("fab", both(containsString("a")).and(containsString("b")))
++
+public static <LHS> CombinableMatcher.CombinableEitherMatcher<LHS> either(Matcher<? super LHS> matcher)+
assertThat("fan", either(containsString("a")).and(containsString("b")))
++
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.core.DescribedAs<T> +
public class DescribedAs<T>
+Provides a custom description to another matcher. +
+ +
+
| +Constructor Summary | +|
|---|---|
DescribedAs(java.lang.String descriptionTemplate,
+ Matcher<T> matcher,
+ java.lang.Object[] values)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+static
+ |
+describedAs(java.lang.String description,
+ Matcher<T> matcher,
+ java.lang.Object... values)
+
++ Wraps an existing matcher, overriding its description with that specified. |
+|
+ void |
+describeMismatch(java.lang.Object item,
+ Description description)
+
++ Generate a description of why the matcher has not accepted the item. |
+|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+ boolean |
+matches(java.lang.Object o)
+
++ Evaluates the matcher for argument item. |
+|
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public DescribedAs(java.lang.String descriptionTemplate, + Matcher<T> matcher, + java.lang.Object[] values)+
| +Method Detail | +
|---|
+public boolean matches(java.lang.Object o)+
Matcher+
o - the object against which the matcher is evaluated.
+true if item matches, otherwise false.BaseMatcher+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public void describeMismatch(java.lang.Object item, + Description description)+
Matchermatches(item) is false, but
+ will not check this.
++
describeMismatch in interface Matcher<T>describeMismatch in class BaseMatcher<T>item - The item that the Matcher has rejected.description - The description to be built or appended to.+public static <T> Matcher<T> describedAs(java.lang.String description, + Matcher<T> matcher, + java.lang.Object... values)+
describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())
++
description - the new description for the wrapped matchermatcher - the matcher to wrapvalues - optional values to insert into the tokenised description
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeDiagnosingMatcher<java.lang.Iterable<T>> +
org.hamcrest.core.Every<T> +
public class Every<T>
+
| +Constructor Summary | +|
|---|---|
Every(Matcher<? super T> matcher)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+static
+ |
+everyItem(Matcher<U> itemMatcher)
+
++ Creates a matcher for Iterables that only matches when a single pass over the
+ examined Iterable yields items that are all matched by the specified
+ itemMatcher. |
+|
+ boolean |
+matchesSafely(java.lang.Iterable<T> collection,
+ Description mismatchDescription)
+
++ Subclasses should implement this. |
+|
| Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public Every(Matcher<? super T> matcher)+
| +Method Detail | +
|---|
+public boolean matchesSafely(java.lang.Iterable<T> collection, + Description mismatchDescription)+
TypeSafeDiagnosingMatcher+
matchesSafely in class TypeSafeDiagnosingMatcher<java.lang.Iterable<T>>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <U> Matcher<java.lang.Iterable<U>> everyItem(Matcher<U> itemMatcher)+
Iterables that only matches when a single pass over the
+ examined Iterable yields items that are all matched by the specified
+ itemMatcher.
+
+ For example:
+ assertThat(Arrays.asList("bar", "baz"), everyItem(startsWith("ba")))
++
itemMatcher - the matcher to apply to every item provided by the examined Iterable
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.core.Is<T> +
public class Is<T>
+Decorates another Matcher, retaining the behaviour but allowing tests + to be slightly more expressive. + + For example: assertThat(cheese, equalTo(smelly)) + vs. assertThat(cheese, is(equalTo(smelly))) +
+ +
+
| +Constructor Summary | +|
|---|---|
Is(Matcher<T> matcher)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+ void |
+describeMismatch(java.lang.Object item,
+ Description mismatchDescription)
+
++ Generate a description of why the matcher has not accepted the item. |
+|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+static
+ |
+is(java.lang.Class<T> type)
+
++ Deprecated. use isA(Class |
+|
+static
+ |
+is(Matcher<T> matcher)
+
++ Decorates another Matcher, retaining its behaviour, but allowing tests + to be slightly more expressive. |
+|
+static
+ |
+is(T value)
+
++ A shortcut to the frequently used is(equalTo(x)). |
+|
+static
+ |
+isA(java.lang.Class<T> type)
+
++ A shortcut to the frequently used is(instanceOf(SomeClass.class)). |
+|
+ boolean |
+matches(java.lang.Object arg)
+
++ Evaluates the matcher for argument item. |
+|
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public Is(Matcher<T> matcher)+
| +Method Detail | +
|---|
+public boolean matches(java.lang.Object arg)+
Matcher+
arg - the object against which the matcher is evaluated.
+true if item matches, otherwise false.BaseMatcher+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public void describeMismatch(java.lang.Object item, + Description mismatchDescription)+
Matchermatches(item) is false, but
+ will not check this.
++
describeMismatch in interface Matcher<T>describeMismatch in class BaseMatcher<T>item - The item that the Matcher has rejected.mismatchDescription - The description to be built or appended to.+public static <T> Matcher<T> is(Matcher<T> matcher)+
assertThat(cheese, is(equalTo(smelly)))+ instead of: +
assertThat(cheese, equalTo(smelly))+
+
+public static <T> Matcher<T> is(T value)+
is(equalTo(x)).
+
+ For example:
+ assertThat(cheese, is(smelly))+ instead of: +
assertThat(cheese, is(equalTo(smelly)))+
+
+@Deprecated +public static <T> Matcher<T> is(java.lang.Class<T> type)+
+
is(instanceOf(SomeClass.class)).
+
+ For example:
+ assertThat(cheese, is(Cheddar.class))+ instead of: +
assertThat(cheese, is(instanceOf(Cheddar.class)))+
+
+public static <T> Matcher<T> isA(java.lang.Class<T> type)+
is(instanceOf(SomeClass.class)).
+
+ For example:
+ assertThat(cheese, isA(Cheddar.class))+ instead of: +
assertThat(cheese, is(instanceOf(Cheddar.class)))+
+
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.core.IsAnything<T> +
public class IsAnything<T>
+A matcher that always returns true.
+
+ +
+
| +Constructor Summary | +|
|---|---|
IsAnything()
+
++ |
+|
IsAnything(java.lang.String message)
+
++ |
+|
| +Method Summary | +|
|---|---|
+static Matcher<java.lang.Object> |
+anything()
+
++ Creates a matcher that always matches, regardless of the examined object. |
+
+static Matcher<java.lang.Object> |
+anything(java.lang.String description)
+
++ Creates a matcher that always matches, regardless of the examined object, but describes + itself with the specified String. |
+
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+
+ boolean |
+matches(java.lang.Object o)
+
++ Evaluates the matcher for argument item. |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsAnything()+
+public IsAnything(java.lang.String message)+
| +Method Detail | +
|---|
+public boolean matches(java.lang.Object o)+
Matcher+
o - the object against which the matcher is evaluated.
+true if item matches, otherwise false.BaseMatcher+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static Matcher<java.lang.Object> anything()+
+
+public static Matcher<java.lang.Object> anything(java.lang.String description)+
String.
++
description - a meaningful String used when describing itself
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeDiagnosingMatcher<java.lang.Iterable<? super T>> +
org.hamcrest.core.IsCollectionContaining<T> +
public class IsCollectionContaining<T>
+
| +Constructor Summary | +|
|---|---|
IsCollectionContaining(Matcher<? super T> elementMatcher)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+static
+ |
+hasItem(Matcher<? super T> itemMatcher)
+
++ Creates a matcher for Iterables that only matches when a single pass over the
+ examined Iterable yields at least one item that is matched by the specified
+ itemMatcher. |
+|
+static
+ |
+hasItem(T item)
+
++ Creates a matcher for Iterables that only matches when a single pass over the
+ examined Iterable yields at least one item that is equal to the specified
+ item. |
+|
+static
+ |
+hasItems(Matcher<? super T>... itemMatchers)
+
++ Creates a matcher for Iterables 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
+ |
+hasItems(T... items)
+
++ Creates a matcher for Iterables 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. |
+|
+protected boolean |
+matchesSafely(java.lang.Iterable<? super T> collection,
+ Description mismatchDescription)
+
++ Subclasses should implement this. |
+|
| Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsCollectionContaining(Matcher<? super T> elementMatcher)+
| +Method Detail | +
|---|
+protected boolean matchesSafely(java.lang.Iterable<? super T> collection, + Description mismatchDescription)+
TypeSafeDiagnosingMatcher+
matchesSafely in class TypeSafeDiagnosingMatcher<java.lang.Iterable<? super T>>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <T> Matcher<java.lang.Iterable<? super T>> hasItem(Matcher<? super T> itemMatcher)+
Iterables that only matches when a single pass over the
+ examined Iterable yields at least one item that is matched by the specified
+ itemMatcher. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), hasItem(startsWith("ba")))
++
itemMatcher - the matcher to apply to items provided by the examined Iterable+public static <T> Matcher<java.lang.Iterable<? super T>> hasItem(T item)+
Iterables that only matches when a single pass over the
+ examined Iterable yields at least one item that is equal to the specified
+ item. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar"), hasItem("bar"))
++
item - the item to compare against the items provided by the examined Iterable+public static <T> Matcher<java.lang.Iterable<T>> hasItems(Matcher<? super T>... itemMatchers)+
Iterables 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. Whilst matching, each traversal of
+ the examined Iterable will stop as soon as a matching item is found.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar", "baz"), hasItems(endsWith("z"), endsWith("o")))
++
itemMatchers - the matchers to apply to items provided by the examined Iterable+public static <T> Matcher<java.lang.Iterable<T>> hasItems(T... items)+
Iterables 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. Whilst matching, each traversal of the
+ examined Iterable will stop as soon as a matching item is found.
+
+ For example:
+ assertThat(Arrays.asList("foo", "bar", "baz"), hasItems("baz", "foo"))
++
items - the items to compare against the items provided by the examined Iterable
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.core.IsEqual<T> +
public class IsEqual<T>
+Is the value equal to another value, as tested by the
+ Object.equals(java.lang.Object) invokedMethod?
+
+ +
+
| +Constructor Summary | +|
|---|---|
IsEqual(T equalArg)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+static
+ |
+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. |
+|
+ boolean |
+matches(java.lang.Object actualValue)
+
++ Evaluates the matcher for argument item. |
+|
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsEqual(T equalArg)+
| +Method Detail | +
|---|
+public boolean matches(java.lang.Object actualValue)+
Matcher+
actualValue - the object against which the matcher is evaluated.
+true if item matches, otherwise false.BaseMatcher+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <T> Matcher<T> equalTo(T operand)+
operand, as determined by calling the Object.equals(java.lang.Object) method on
+ the examined object.
+
+ If the specified operand is null then the created matcher will only match if
+ the examined object's equals method returns true when passed a
+ null (which would be a violation of the equals contract), unless the
+ examined object itself is null, in which case the matcher will return a positive
+ match.
The created matcher provides a special behaviour when examining Arrays, whereby
+ it will match if both the operand and the examined object are arrays of the same length and
+ contain items that are equal to each other (according to the above rules) in the same
+ indexes.
+ assertThat("foo", equalTo("foo"));
+ assertThat(new String[] {"foo", "bar"}, equalTo(new String[] {"foo", "bar"}));
+
++
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.DiagnosingMatcher<java.lang.Object> +
org.hamcrest.core.IsInstanceOf +
public class IsInstanceOf
+Tests whether the value is an instance of a class. + Classes of basic types will be converted to the relevant "Object" classes +
+ +
+
| +Constructor Summary | +|
|---|---|
IsInstanceOf(java.lang.Class<?> expectedClass)
+
++ Creates a new instance of IsInstanceOf |
+|
| +Method Summary | +||
|---|---|---|
+static
+ |
+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. |
+|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+static
+ |
+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. |
+|
+protected boolean |
+matches(java.lang.Object item,
+ Description mismatch)
+
++ |
+|
| Methods inherited from class org.hamcrest.DiagnosingMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsInstanceOf(java.lang.Class<?> expectedClass)+
+
expectedClass - The predicate evaluates to true for instances of this class
+ or one of its subclasses.| +Method Detail | +
|---|
+protected boolean matches(java.lang.Object item, + Description mismatch)+
matches in class DiagnosingMatcher<java.lang.Object>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <T> Matcher<T> instanceOf(java.lang.Class<?> type)+
type,
+ as determined by calling the Class.isInstance(Object) method on that type, passing the
+ the examined object.
+
+ The created matcher assumes no relationship between specified type and the examined object.
+ + For example: +assertThat(new Canoe(), instanceOf(Paddlable.class));+
+
+public static <T> Matcher<T> any(java.lang.Class<T> type)+
type,
+ as determined by calling the Class.isInstance(Object) method on that type, passing the
+ the examined object.
+
+ The created matcher forces a relationship between specified type and the examined object, and should be
+ used when it is necessary to make generics conform, for example in the JMock clause
+ with(any(Thing.class))
assertThat(new Canoe(), instanceOf(Canoe.class));+
+
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.core.IsNot<T> +
public class IsNot<T>
+Calculates the logical negation of a matcher. +
+ +
+
| +Constructor Summary | +|
|---|---|
IsNot(Matcher<T> matcher)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+ boolean |
+matches(java.lang.Object arg)
+
++ Evaluates the matcher for argument item. |
+|
+static
+ |
+not(Matcher<T> matcher)
+
++ Creates a matcher that wraps an existing matcher, but inverts the logic by which + it will match. |
+|
+static
+ |
+not(T value)
+
++ A shortcut to the frequently used not(equalTo(x)). |
+|
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsNot(Matcher<T> matcher)+
| +Method Detail | +
|---|
+public boolean matches(java.lang.Object arg)+
Matcher+
arg - the object against which the matcher is evaluated.
+true if item matches, otherwise false.BaseMatcher+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <T> Matcher<T> not(Matcher<T> matcher)+
assertThat(cheese, is(not(equalTo(smelly))))+
+
matcher - the matcher whose sense should be inverted+public static <T> Matcher<T> not(T value)+
not(equalTo(x)).
+
+ For example:
+ assertThat(cheese, is(not(smelly)))+ instead of: +
assertThat(cheese, is(not(equalTo(smelly))))+
+
value - the value that any examined object should not equal
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.core.IsNull<T> +
public class IsNull<T>
+Is the value null? +
+ +
+
| +Constructor Summary | +|
|---|---|
IsNull()
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+ boolean |
+matches(java.lang.Object o)
+
++ Evaluates the matcher for argument item. |
+|
+static Matcher<java.lang.Object> |
+notNullValue()
+
++ A shortcut to the frequently used not(nullValue()). |
+|
+static
+ |
+notNullValue(java.lang.Class<T> type)
+
++ A shortcut to the frequently used not(nullValue(X.class)). |
+|
+static Matcher<java.lang.Object> |
+nullValue()
+
++ Creates a matcher that matches if examined object is null. |
+|
+static
+ |
+nullValue(java.lang.Class<T> type)
+
++ Creates a matcher that matches if examined object is null. |
+|
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsNull()+
| +Method Detail | +
|---|
+public boolean matches(java.lang.Object o)+
Matcher+
o - the object against which the matcher is evaluated.
+true if item matches, otherwise false.BaseMatcher+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static Matcher<java.lang.Object> nullValue()+
null.
+
+ For example:
+ assertThat(cheese, is(nullValue())+
+
+public static Matcher<java.lang.Object> notNullValue()+
not(nullValue()).
+
+ For example:
+ assertThat(cheese, is(notNullValue()))+ instead of: +
assertThat(cheese, is(not(nullValue())))+
+
+public static <T> Matcher<T> nullValue(java.lang.Class<T> type)+
null. Accepts a
+ single dummy argument to facilitate type inference.
+
+ For example:
+ assertThat(cheese, is(nullValue(Cheese.class))+
+
type - dummy parameter used to infer the generic type of the returned matcher+public static <T> Matcher<T> notNullValue(java.lang.Class<T> type)+
not(nullValue(X.class)). Accepts a
+ single dummy argument to facilitate type inference..
+
+ For example:
+ assertThat(cheese, is(notNullValue(X.class)))+ instead of: +
assertThat(cheese, is(not(nullValue(X.class))))+
+
type - dummy parameter used to infer the generic type of the returned matcher
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.core.IsSame<T> +
public class IsSame<T>
+Is the value the same object as another value? +
+ +
+
| +Constructor Summary | +|
|---|---|
IsSame(T object)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+ boolean |
+matches(java.lang.Object arg)
+
++ Evaluates the matcher for argument item. |
+|
+static
+ |
+sameInstance(T target)
+
++ Creates a matcher that matches only when the examined object is the same instance as + the specified target object. |
+|
+static
+ |
+theInstance(T target)
+
++ Creates a matcher that matches only when the examined object is the same instance as + the specified target object. |
+|
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsSame(T object)+
| +Method Detail | +
|---|
+public boolean matches(java.lang.Object arg)+
Matcher+
arg - the object against which the matcher is evaluated.
+true if item matches, otherwise false.BaseMatcher+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <T> Matcher<T> sameInstance(T target)+
+
target - the target instance against which others should be assessed+public static <T> Matcher<T> theInstance(T target)+
+
target - the target instance against which others should be assessed
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<java.lang.String> +
org.hamcrest.core.SubstringMatcher +
org.hamcrest.core.StringContains +
public class StringContains
+Tests if the argument is a string that contains a substring. +
+ +
+
| +Field Summary | +
|---|
| Fields inherited from class org.hamcrest.core.SubstringMatcher | +
|---|
substring |
+
| +Constructor Summary | +|
|---|---|
StringContains(java.lang.String substring)
+
++ |
+|
| +Method Summary | +|
|---|---|
+static Matcher<java.lang.String> |
+containsString(java.lang.String substring)
+
++ Creates a matcher that matches if the examined String contains the specified
+ String anywhere. |
+
+protected boolean |
+evalSubstringOf(java.lang.String s)
+
++ |
+
+protected java.lang.String |
+relationship()
+
++ |
+
| Methods inherited from class org.hamcrest.core.SubstringMatcher | +
|---|
describeMismatchSafely, describeTo, matchesSafely |
+
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public StringContains(java.lang.String substring)+
| +Method Detail | +
|---|
+protected boolean evalSubstringOf(java.lang.String s)+
evalSubstringOf in class SubstringMatcher+protected java.lang.String relationship()+
relationship in class SubstringMatcher+public static Matcher<java.lang.String> containsString(java.lang.String substring)+
String contains the specified
+ String anywhere.
+
+ For example:
+ assertThat("myStringOfNote", containsString("ring"))
++
substring - the substring that the returned matcher will expect to find within any examined string
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<java.lang.String> +
org.hamcrest.core.SubstringMatcher +
org.hamcrest.core.StringEndsWith +
public class StringEndsWith
+Tests if the argument is a string that contains a substring. +
+ +
+
| +Field Summary | +
|---|
| Fields inherited from class org.hamcrest.core.SubstringMatcher | +
|---|
substring |
+
| +Constructor Summary | +|
|---|---|
StringEndsWith(java.lang.String substring)
+
++ |
+|
| +Method Summary | +|
|---|---|
+static Matcher<java.lang.String> |
+endsWith(java.lang.String suffix)
+
++ Creates a matcher that matches if the examined String ends with the specified
+ String. |
+
+protected boolean |
+evalSubstringOf(java.lang.String s)
+
++ |
+
+protected java.lang.String |
+relationship()
+
++ |
+
| Methods inherited from class org.hamcrest.core.SubstringMatcher | +
|---|
describeMismatchSafely, describeTo, matchesSafely |
+
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public StringEndsWith(java.lang.String substring)+
| +Method Detail | +
|---|
+protected boolean evalSubstringOf(java.lang.String s)+
evalSubstringOf in class SubstringMatcher+protected java.lang.String relationship()+
relationship in class SubstringMatcher+public static Matcher<java.lang.String> endsWith(java.lang.String suffix)+
String ends with the specified
+ String.
+
+ For example:
+ assertThat("myStringOfNote", endsWith("Note"))
++
suffix - the substring that the returned matcher will expect at the end of any examined string
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<java.lang.String> +
org.hamcrest.core.SubstringMatcher +
org.hamcrest.core.StringStartsWith +
public class StringStartsWith
+Tests if the argument is a string that contains a substring. +
+ +
+
| +Field Summary | +
|---|
| Fields inherited from class org.hamcrest.core.SubstringMatcher | +
|---|
substring |
+
| +Constructor Summary | +|
|---|---|
StringStartsWith(java.lang.String substring)
+
++ |
+|
| +Method Summary | +|
|---|---|
+protected boolean |
+evalSubstringOf(java.lang.String s)
+
++ |
+
+protected java.lang.String |
+relationship()
+
++ |
+
+static Matcher<java.lang.String> |
+startsWith(java.lang.String prefix)
+
++ Creates a matcher that matches if the examined String starts with the specified
+ String. |
+
| Methods inherited from class org.hamcrest.core.SubstringMatcher | +
|---|
describeMismatchSafely, describeTo, matchesSafely |
+
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public StringStartsWith(java.lang.String substring)+
| +Method Detail | +
|---|
+protected boolean evalSubstringOf(java.lang.String s)+
evalSubstringOf in class SubstringMatcher+protected java.lang.String relationship()+
relationship in class SubstringMatcher+public static Matcher<java.lang.String> startsWith(java.lang.String prefix)+
String starts with the specified
+ String.
+
+ For example:
+ assertThat("myStringOfNote", startsWith("my"))
++
prefix - the substring that the returned matcher will expect at the start of any examined string
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<java.lang.String> +
org.hamcrest.core.SubstringMatcher +
public abstract class SubstringMatcher
+
| +Field Summary | +|
|---|---|
+protected java.lang.String |
+substring
+
++ |
+
| +Constructor Summary | +|
|---|---|
+protected |
+SubstringMatcher(java.lang.String substring)
+
++ |
+
| +Method Summary | +|
|---|---|
+ void |
+describeMismatchSafely(java.lang.String item,
+ Description mismatchDescription)
+
++ Subclasses should override this. |
+
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+
+protected abstract boolean |
+evalSubstringOf(java.lang.String string)
+
++ |
+
+ boolean |
+matchesSafely(java.lang.String item)
+
++ Subclasses should implement this. |
+
+protected abstract java.lang.String |
+relationship()
+
++ |
+
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Field Detail | +
|---|
+protected final java.lang.String substring+
| +Constructor Detail | +
|---|
+protected SubstringMatcher(java.lang.String substring)+
| +Method Detail | +
|---|
+public boolean matchesSafely(java.lang.String item)+
TypeSafeMatcher+
matchesSafely in class TypeSafeMatcher<java.lang.String>+public void describeMismatchSafely(java.lang.String item, + Description mismatchDescription)+
TypeSafeMatcher+
describeMismatchSafely in class TypeSafeMatcher<java.lang.String>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+protected abstract boolean evalSubstringOf(java.lang.String string)+
+protected abstract java.lang.String relationship()+
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use AnyOf | +|
|---|---|
| org.hamcrest | +The stable API defining Matcher and its associated interfaces and classes. | +
| org.hamcrest.core | +Fundamental matchers of objects and values, and composite matchers. | +
| +Uses of AnyOf in org.hamcrest | +
|---|
+ +
| Methods in org.hamcrest that return AnyOf | +||
|---|---|---|
+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.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
+ |
+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
+ |
+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
+ |
+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
+ |
+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
+ |
+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. |
+|
| +Uses of AnyOf in org.hamcrest.core | +
|---|
+ +
| Methods in org.hamcrest.core that return AnyOf | +||
|---|---|---|
+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. |
+|
+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,
+ 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,
+ 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. |
+|
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use CombinableMatcher.CombinableBothMatcher | +|
|---|---|
| org.hamcrest | +The stable API defining Matcher and its associated interfaces and classes. | +
| org.hamcrest.core | +Fundamental matchers of objects and values, and composite matchers. | +
| +Uses of CombinableMatcher.CombinableBothMatcher in org.hamcrest | +
|---|
+ +
| Methods in org.hamcrest that return CombinableMatcher.CombinableBothMatcher | +||
|---|---|---|
+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. |
+|
| +Uses of CombinableMatcher.CombinableBothMatcher in org.hamcrest.core | +
|---|
+ +
| Methods in org.hamcrest.core that return CombinableMatcher.CombinableBothMatcher | +||
|---|---|---|
+static
+ |
+CombinableMatcher.both(Matcher<? super LHS> matcher)
+
++ Creates a matcher that matches when both of the specified matchers match the examined object. |
+|
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use CombinableMatcher.CombinableEitherMatcher | +|
|---|---|
| org.hamcrest | +The stable API defining Matcher and its associated interfaces and classes. | +
| org.hamcrest.core | +Fundamental matchers of objects and values, and composite matchers. | +
| +Uses of CombinableMatcher.CombinableEitherMatcher in org.hamcrest | +
|---|
+ +
| Methods in org.hamcrest that return CombinableMatcher.CombinableEitherMatcher | +||
|---|---|---|
+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. |
+|
| +Uses of CombinableMatcher.CombinableEitherMatcher in org.hamcrest.core | +
|---|
+ +
| Methods in org.hamcrest.core that return CombinableMatcher.CombinableEitherMatcher | +||
|---|---|---|
+static
+ |
+CombinableMatcher.either(Matcher<? super LHS> matcher)
+
++ Creates a matcher that matches when either of the specified matchers match the examined object. |
+|
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use CombinableMatcher | +|
|---|---|
| org.hamcrest.core | +Fundamental matchers of objects and values, and composite matchers. | +
| +Uses of CombinableMatcher in org.hamcrest.core | +
|---|
+ +
| Methods in org.hamcrest.core that return CombinableMatcher | +|
|---|---|
+ CombinableMatcher<T> |
+CombinableMatcher.and(Matcher<? super T> other)
+
++ |
+
+ CombinableMatcher<X> |
+CombinableMatcher.CombinableBothMatcher.and(Matcher<? super X> other)
+
++ |
+
+ CombinableMatcher<T> |
+CombinableMatcher.or(Matcher<? super T> other)
+
++ |
+
+ CombinableMatcher<X> |
+CombinableMatcher.CombinableEitherMatcher.or(Matcher<? super X> other)
+
++ |
+
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use SubstringMatcher | +|
|---|---|
| org.hamcrest.core | +Fundamental matchers of objects and values, and composite matchers. | +
| +Uses of SubstringMatcher in org.hamcrest.core | +
|---|
+ +
| Subclasses of SubstringMatcher in org.hamcrest.core | +|
|---|---|
+ 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. |
+
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
|
+Classes
+
+ +AllOf + +AnyOf + +CombinableMatcher + +CombinableMatcher.CombinableBothMatcher + +CombinableMatcher.CombinableEitherMatcher + +DescribedAs + +Every + +Is + +IsAnything + +IsCollectionContaining + +IsEqual + +IsInstanceOf + +IsNot + +IsNull + +IsSame + +StringContains + +StringEndsWith + +StringStartsWith + +SubstringMatcher |
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+See:
+
+ Description
+
+ +
| +Class Summary | +|
|---|---|
| AllOf<T> | +Calculates the logical conjunction of multiple matchers. | +
| AnyOf<T> | +Calculates the logical disjunction of multiple matchers. | +
| CombinableMatcher<T> | ++ |
| CombinableMatcher.CombinableBothMatcher<X> | ++ |
| CombinableMatcher.CombinableEitherMatcher<X> | ++ |
| DescribedAs<T> | +Provides a custom description to another matcher. | +
| Every<T> | ++ |
| Is<T> | +Decorates another Matcher, retaining the behaviour but allowing tests + to be slightly more expressive. | +
| IsAnything<T> | +A matcher that always returns true. |
+
| IsCollectionContaining<T> | ++ |
| IsEqual<T> | +Is the value equal to another value, as tested by the
+ Object.equals(java.lang.Object) invokedMethod? |
+
| IsInstanceOf | +Tests whether the value is an instance of a class. | +
| IsNot<T> | +Calculates the logical negation of a matcher. | +
| IsNull<T> | +Is the value null? | +
| IsSame<T> | +Is the value the same object as another value? | +
| StringContains | +Tests if the argument is a string that contains a substring. | +
| StringEndsWith | +Tests if the argument is a string that contains a substring. | +
| StringStartsWith | +Tests if the argument is a string that contains a substring. | +
| SubstringMatcher | ++ |
+
Fundamental matchers of objects and values, and composite matchers.
++ +
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use org.hamcrest.core | +|
|---|---|
| org.hamcrest | +The stable API defining Matcher and its associated interfaces and classes. | +
| org.hamcrest.core | +Fundamental matchers of objects and values, and composite matchers. | +
| +Classes in org.hamcrest.core used by org.hamcrest | +|
|---|---|
| AnyOf
+
+ + Calculates the logical disjunction of multiple matchers. |
+|
| CombinableMatcher.CombinableBothMatcher
+
+ + |
+|
| CombinableMatcher.CombinableEitherMatcher
+
+ + |
+|
| +Classes in org.hamcrest.core used by org.hamcrest.core | +|
|---|---|
| AnyOf
+
+ + Calculates the logical disjunction of multiple matchers. |
+|
| CombinableMatcher
+
+ + |
+|
| CombinableMatcher.CombinableBothMatcher
+
+ + |
+|
| CombinableMatcher.CombinableEitherMatcher
+
+ + |
+|
| SubstringMatcher
+
+ + |
+|
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.integration.EasyMock2Adapter +
public class EasyMock2Adapter
+An adapter allowing a Hamcrest Matcher
+ to act as an EasyMock IArgumentMatcher.
+
+ +
+
| +Constructor Summary | +|
|---|---|
EasyMock2Adapter(Matcher<?> matcher)
+
++ |
+|
| +Method Summary | +|
|---|---|
+static org.easymock.IArgumentMatcher |
+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. |
+
+ void |
+appendTo(java.lang.StringBuffer buffer)
+
++ |
+
+ boolean |
+matches(java.lang.Object argument)
+
++ |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public EasyMock2Adapter(Matcher<?> matcher)+
| +Method Detail | +
|---|
+public static org.easymock.IArgumentMatcher adapt(Matcher<?> matcher)+
Matcher to act as an
+ EasyMock IArgumentMatcher and
+ report it to EasyMock so it can be kept track of.
++
+public boolean matches(java.lang.Object argument)+
matches in interface org.easymock.IArgumentMatcher+public void appendTo(java.lang.StringBuffer buffer)+
appendTo in interface org.easymock.IArgumentMatcher
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.integration.JMock1Adapter +
public class JMock1Adapter
+An adapter allowing a Hamcrest Matcher
+ to act as an jMock1 Constraint.
+ Note, this is not necessary for jMock2 as it supports Hamcrest
+ out of the box.
+
+ +
+
| +Constructor Summary | +|
|---|---|
JMock1Adapter(Matcher<?> matcher)
+
++ |
+|
| +Method Summary | +|
|---|---|
+static org.jmock.core.Constraint |
+adapt(Matcher<?> matcher)
+
++ Convenience factory method that will adapt a + Hamcrest Matcher to act as an
+ jMock Constraint. |
+
+ java.lang.StringBuffer |
+describeTo(java.lang.StringBuffer buffer)
+
++ |
+
+ boolean |
+eval(java.lang.Object o)
+
++ |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public JMock1Adapter(Matcher<?> matcher)+
| +Method Detail | +
|---|
+public static org.jmock.core.Constraint adapt(Matcher<?> matcher)+
Matcher to act as an
+ jMock Constraint.
++
+public boolean eval(java.lang.Object o)+
eval in interface org.jmock.core.Constraint+public java.lang.StringBuffer describeTo(java.lang.StringBuffer buffer)+
describeTo in interface org.jmock.core.SelfDescribing
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
|
+Classes
+
+ +EasyMock2Adapter + +JMock1Adapter |
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Class Summary | +|
|---|---|
| EasyMock2Adapter | +An adapter allowing a Hamcrest Matcher
+ to act as an EasyMock IArgumentMatcher. |
+
| JMock1Adapter | +An adapter allowing a Hamcrest Matcher
+ to act as an jMock1 Constraint. |
+
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.internal.ArrayIterator +
public class ArrayIterator
+
| +Constructor Summary | +|
|---|---|
ArrayIterator(java.lang.Object array)
+
++ |
+|
| +Method Summary | +|
|---|---|
+ boolean |
+hasNext()
+
++ |
+
+ java.lang.Object |
+next()
+
++ |
+
+ void |
+remove()
+
++ |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public ArrayIterator(java.lang.Object array)+
| +Method Detail | +
|---|
+public boolean hasNext()+
hasNext in interface java.util.Iterator<java.lang.Object>+public java.lang.Object next()+
next in interface java.util.Iterator<java.lang.Object>+public void remove()+
remove in interface java.util.Iterator<java.lang.Object>
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.internal.ReflectiveTypeFinder +
public class ReflectiveTypeFinder
+
| +Constructor Summary | +|
|---|---|
ReflectiveTypeFinder(java.lang.String methodName,
+ int expectedNumberOfParameters,
+ int typedParameter)
+
++ |
+|
| +Method Summary | +|
|---|---|
+protected boolean |
+canObtainExpectedTypeFrom(java.lang.reflect.Method method)
+
++ |
+
+protected java.lang.Class<?> |
+expectedTypeFrom(java.lang.reflect.Method method)
+
++ |
+
+ java.lang.Class<?> |
+findExpectedType(java.lang.Class<?> fromClass)
+
++ |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public ReflectiveTypeFinder(java.lang.String methodName, + int expectedNumberOfParameters, + int typedParameter)+
| +Method Detail | +
|---|
+public java.lang.Class<?> findExpectedType(java.lang.Class<?> fromClass)+
+protected boolean canObtainExpectedTypeFrom(java.lang.reflect.Method method)+
method - The method to examine.
++protected java.lang.Class<?> expectedTypeFrom(java.lang.reflect.Method method)+
method - The method from which to extract
+
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.internal.SelfDescribingValue<T> +
public class SelfDescribingValue<T>
+
| +Constructor Summary | +|
|---|---|
SelfDescribingValue(T value)
+
++ |
+|
| +Method Summary | +|
|---|---|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public SelfDescribingValue(T value)+
| +Method Detail | +
|---|
+public void describeTo(Description description)+
SelfDescribing+
describeTo in interface SelfDescribingdescription - The description to be built or appended to.
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.internal.SelfDescribingValueIterator<T> +
public class SelfDescribingValueIterator<T>
+
| +Constructor Summary | +|
|---|---|
SelfDescribingValueIterator(java.util.Iterator<T> values)
+
++ |
+|
| +Method Summary | +|
|---|---|
+ boolean |
+hasNext()
+
++ |
+
+ SelfDescribing |
+next()
+
++ |
+
+ void |
+remove()
+
++ |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public SelfDescribingValueIterator(java.util.Iterator<T> values)+
| +Method Detail | +
|---|
+public boolean hasNext()+
hasNext in interface java.util.Iterator<SelfDescribing>+public SelfDescribing next()+
next in interface java.util.Iterator<SelfDescribing>+public void remove()+
remove in interface java.util.Iterator<SelfDescribing>
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use ReflectiveTypeFinder | +|
|---|---|
| org.hamcrest | +The stable API defining Matcher and its associated interfaces and classes. | +
| +Uses of ReflectiveTypeFinder in org.hamcrest | +
|---|
+ +
| Constructors in org.hamcrest with parameters of type ReflectiveTypeFinder | +|
|---|---|
TypeSafeDiagnosingMatcher(ReflectiveTypeFinder typeFinder)
+
++ Use this constructor if the subclass that implements matchesSafely
+ is not the class that binds <T> to a type. |
+|
TypeSafeMatcher(ReflectiveTypeFinder typeFinder)
+
++ Use this constructor if the subclass that implements matchesSafely
+ is not the class that binds <T> to a type. |
+|
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
|
+Classes
+
+ +ArrayIterator + +ReflectiveTypeFinder + +SelfDescribingValue + +SelfDescribingValueIterator |
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Class Summary | +|
|---|---|
| ArrayIterator | ++ |
| ReflectiveTypeFinder | ++ |
| SelfDescribingValue<T> | ++ |
| SelfDescribingValueIterator<T> | ++ |
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use org.hamcrest.internal | +|
|---|---|
| org.hamcrest | +The stable API defining Matcher and its associated interfaces and classes. | +
| +Classes in org.hamcrest.internal used by org.hamcrest | +|
|---|---|
| ReflectiveTypeFinder
+
+ + |
+|
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<java.math.BigDecimal> +
org.hamcrest.number.BigDecimalCloseTo +
public class BigDecimalCloseTo
+
| +Constructor Summary | +|
|---|---|
BigDecimalCloseTo(java.math.BigDecimal value,
+ java.math.BigDecimal error)
+
++ |
+|
| +Method Summary | +|
|---|---|
+static Matcher<java.math.BigDecimal> |
+closeTo(java.math.BigDecimal operand,
+ java.math.BigDecimal error)
+
++ Creates a matcher of BigDecimals that matches when an examined BigDecimal is equal
+ to the specified operand, within a range of +/- error. |
+
+ void |
+describeMismatchSafely(java.math.BigDecimal item,
+ Description mismatchDescription)
+
++ Subclasses should override this. |
+
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+
+ boolean |
+matchesSafely(java.math.BigDecimal item)
+
++ Subclasses should implement this. |
+
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public BigDecimalCloseTo(java.math.BigDecimal value, + java.math.BigDecimal error)+
| +Method Detail | +
|---|
+public boolean matchesSafely(java.math.BigDecimal item)+
TypeSafeMatcher+
matchesSafely in class TypeSafeMatcher<java.math.BigDecimal>+public void describeMismatchSafely(java.math.BigDecimal item, + Description mismatchDescription)+
TypeSafeMatcher+
describeMismatchSafely in class TypeSafeMatcher<java.math.BigDecimal>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static Matcher<java.math.BigDecimal> closeTo(java.math.BigDecimal operand, + java.math.BigDecimal error)+
BigDecimals that matches when an examined BigDecimal is equal
+ to the specified operand, within a range of +/- error. The comparison for equality
+ is done by BigDecimals BigDecimal.compareTo(java.math.BigDecimal) method.
+
+ For example:
+ assertThat(new BigDecimal("1.03"), is(closeTo(new BigDecimal("1.0"), new BigDecimal("0.03"))))
++
operand - the expected value of matching BigDecimalserror - the delta (+/-) within which matches will be allowed
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<java.lang.Double> +
org.hamcrest.number.IsCloseTo +
public class IsCloseTo
+Is the value a number equal to a value within some range of + acceptable error? +
+ +
+
| +Constructor Summary | +|
|---|---|
IsCloseTo(double value,
+ double error)
+
++ |
+|
| +Method Summary | +|
|---|---|
+static Matcher<java.lang.Double> |
+closeTo(double operand,
+ double error)
+
++ Creates a matcher of Doubles that matches when an examined double is equal
+ to the specified operand, within a range of +/- error. |
+
+ void |
+describeMismatchSafely(java.lang.Double item,
+ Description mismatchDescription)
+
++ Subclasses should override this. |
+
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+
+ boolean |
+matchesSafely(java.lang.Double item)
+
++ Subclasses should implement this. |
+
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsCloseTo(double value, + double error)+
| +Method Detail | +
|---|
+public boolean matchesSafely(java.lang.Double item)+
TypeSafeMatcher+
matchesSafely in class TypeSafeMatcher<java.lang.Double>+public void describeMismatchSafely(java.lang.Double item, + Description mismatchDescription)+
TypeSafeMatcher+
describeMismatchSafely in class TypeSafeMatcher<java.lang.Double>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static Matcher<java.lang.Double> closeTo(double operand, + double error)+
Doubles that matches when an examined double is equal
+ to the specified operand, within a range of +/- error.
+
+ For example:
+ assertThat(1.03, is(closeTo(1.0, 0.03)))+
+
operand - the expected value of matching doubleserror - the delta (+/-) within which matches will be allowed
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<T> +
org.hamcrest.number.OrderingComparison<T> +
public class OrderingComparison<T extends java.lang.Comparable<T>>
+
| +Method Summary | +||
|---|---|---|
+static
+ |
+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. |
+|
+ void |
+describeMismatchSafely(T actual,
+ Description mismatchDescription)
+
++ Subclasses should override this. |
+|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+static
+ |
+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
+ |
+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
+ |
+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
+ |
+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. |
+|
+ boolean |
+matchesSafely(T actual)
+
++ Subclasses should implement this. |
+|
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Method Detail | +
|---|
+public boolean matchesSafely(T actual)+
TypeSafeMatcher+
matchesSafely in class TypeSafeMatcher<T extends java.lang.Comparable<T>>+public void describeMismatchSafely(T actual, + Description mismatchDescription)+
TypeSafeMatcher+
describeMismatchSafely in class TypeSafeMatcher<T extends java.lang.Comparable<T>>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <T extends java.lang.Comparable<T>> Matcher<T> comparesEqualTo(T value)+
Comparable object that matches when the examined object is
+ equal to the specified value, as reported by the compareTo method of the
+ examined object.
+
+ For example:
+ assertThat(1, comparesEqualTo(1))+
+
value - the value which, when passed to the compareTo method of the examined object, should return zero+public static <T extends java.lang.Comparable<T>> Matcher<T> greaterThan(T value)+
Comparable object that matches when the examined object is
+ greater than the specified value, as reported by the compareTo method of the
+ examined object.
+
+ For example:
+ assertThat(2, greaterThan(1))+
+
value - the value which, when passed to the compareTo method of the examined object, should return greater
+ than zero+public static <T extends java.lang.Comparable<T>> Matcher<T> greaterThanOrEqualTo(T value)+
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.
+
+ For example:
+ assertThat(1, greaterThanOrEqualTo(1))+
+
value - the value which, when passed to the compareTo method of the examined object, should return greater
+ than or equal to zero+public static <T extends java.lang.Comparable<T>> Matcher<T> lessThan(T value)+
Comparable object that matches when the examined object is
+ less than the specified value, as reported by the compareTo method of the
+ examined object.
+
+ For example:
+ assertThat(1, lessThan(2))+
+
value - the value which, when passed to the compareTo method of the examined object, should return less
+ than zero+public static <T extends java.lang.Comparable<T>> Matcher<T> lessThanOrEqualTo(T value)+
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.
+
+ For example:
+ assertThat(1, lessThanOrEqualTo(1))+
+
value - the value which, when passed to the compareTo method of the examined object, should return less
+ than or equal to zero
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
|
+Classes
+
+ +BigDecimalCloseTo + +IsCloseTo + +OrderingComparison |
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+See:
+
+ Description
+
+ +
| +Class Summary | +|
|---|---|
| BigDecimalCloseTo | ++ |
| IsCloseTo | +Is the value a number equal to a value within some range of + acceptable error? | +
| OrderingComparison<T extends Comparable<T>> | ++ |
+
Matchers that perform numeric comparisons.
++ +
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeDiagnosingMatcher<T> +
org.hamcrest.FeatureMatcher<T,java.lang.String> +
org.hamcrest.object.HasToString<T> +
public class HasToString<T>
+
| +Constructor Summary | +|
|---|---|
HasToString(Matcher<? super java.lang.String> toStringMatcher)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+protected java.lang.String |
+featureValueOf(T actual)
+
++ Implement this to extract the interesting feature. |
+|
+static
+ |
+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(java.lang.String expectedToString)
+
++ Creates a matcher that matches any examined object whose toString method
+ returns a value equalTo the specified string. |
+|
| Methods inherited from class org.hamcrest.FeatureMatcher | +
|---|
describeTo, matchesSafely |
+
| Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public HasToString(Matcher<? super java.lang.String> toStringMatcher)+
| +Method Detail | +
|---|
+protected java.lang.String featureValueOf(T actual)+
FeatureMatcher+
featureValueOf in class FeatureMatcher<T,java.lang.String>actual - the target object
++public static <T> Matcher<T> hasToString(Matcher<? super java.lang.String> toStringMatcher)+
toString method
+ returns a value that satisfies the specified matcher.
+
+ For example:
+ assertThat(true, hasToString(equalTo("TRUE")))
++
toStringMatcher - the matcher used to verify the toString result+public static <T> Matcher<T> hasToString(java.lang.String expectedToString)+
toString method
+ returns a value equalTo the specified string.
+
+ For example:
+ assertThat(true, hasToString("TRUE"))
++
expectedToString - the expected toString result
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<java.lang.Class<?>> +
org.hamcrest.object.IsCompatibleType<T> +
public class IsCompatibleType<T>
+
| +Constructor Summary | +|
|---|---|
IsCompatibleType(java.lang.Class<T> type)
+
++ |
+|
| +Method Summary | +||
|---|---|---|
+ void |
+describeMismatchSafely(java.lang.Class<?> cls,
+ Description mismatchDescription)
+
++ Subclasses should override this. |
+|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+|
+ boolean |
+matchesSafely(java.lang.Class<?> cls)
+
++ Subclasses should implement this. |
+|
+static
+ |
+typeCompatibleWith(java.lang.Class<T> baseType)
+
++ Creates a matcher of Class that matches when the specified baseType is
+ assignable from the examined class. |
+|
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsCompatibleType(java.lang.Class<T> type)+
| +Method Detail | +
|---|
+public boolean matchesSafely(java.lang.Class<?> cls)+
TypeSafeMatcher+
matchesSafely in class TypeSafeMatcher<java.lang.Class<?>>+public void describeMismatchSafely(java.lang.Class<?> cls, + Description mismatchDescription)+
TypeSafeMatcher+
describeMismatchSafely in class TypeSafeMatcher<java.lang.Class<?>>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static <T> Matcher<java.lang.Class<?>> typeCompatibleWith(java.lang.Class<T> baseType)+
Class that matches when the specified baseType is
+ assignable from the examined class.
+
+ For example:
+ assertThat(Integer.class, typeCompatibleWith(Number.class))+
+
baseType - the base class to examine classes against
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeDiagnosingMatcher<java.util.EventObject> +
org.hamcrest.object.IsEventFrom +
public class IsEventFrom
+Tests if the value is an event announced by a specific object. +
+ +
+
| +Constructor Summary | +|
|---|---|
IsEventFrom(java.lang.Class<?> eventClass,
+ java.lang.Object source)
+
++ |
+|
| +Method Summary | +|
|---|---|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+
+static Matcher<java.util.EventObject> |
+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> |
+eventFrom(java.lang.Object source)
+
++ Creates a matcher of EventObject that matches any EventObject
+ announced by source. |
+
+ boolean |
+matchesSafely(java.util.EventObject item,
+ Description mismatchDescription)
+
++ Subclasses should implement this. |
+
| Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsEventFrom(java.lang.Class<?> eventClass, + java.lang.Object source)+
| +Method Detail | +
|---|
+public boolean matchesSafely(java.util.EventObject item, + Description mismatchDescription)+
TypeSafeDiagnosingMatcher+
matchesSafely in class TypeSafeDiagnosingMatcher<java.util.EventObject>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static Matcher<java.util.EventObject> eventFrom(java.lang.Class<? extends java.util.EventObject> eventClass, + java.lang.Object source)+
EventObject that matches any object
+ derived from eventClass announced by source.
+
+ For example:
+ assertThat(myEvent, is(eventFrom(PropertyChangeEvent.class, myBean)))+
+
eventClass - the class of the event to match onsource - the source of the event+public static Matcher<java.util.EventObject> eventFrom(java.lang.Object source)+
EventObject that matches any EventObject
+ announced by source.
+
+ For example:
+ assertThat(myEvent, is(eventFrom(myBean)))+
+
source - the source of the event
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
|
+Classes
+
+ +HasToString + +IsCompatibleType + +IsEventFrom |
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+See:
+
+ Description
+
+ +
| +Class Summary | +|
|---|---|
| HasToString<T> | ++ |
| IsCompatibleType<T> | ++ |
| IsEventFrom | +Tests if the value is an event announced by a specific object. | +
+
Matchers that inspect objects and classes.
++ +
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
|
+Interfaces
+
+ +Condition.Step + +Description + +Matcher + +SelfDescribing |
+
|
+Classes
+
+ +BaseDescription + +BaseMatcher + +Condition + +CoreMatchers + +CustomMatcher + +CustomTypeSafeMatcher + +Description.NullDescription + +DiagnosingMatcher + +EasyMock2Matchers + +FeatureMatcher + +JavaLangMatcherAssert + +JMock1Matchers + +MatcherAssert + +Matchers + +StringDescription + +TypeSafeDiagnosingMatcher + +TypeSafeMatcher |
+
|
+Annotation Types
+
+ +Factory |
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+See:
+
+ Description
+
+ +
| +Interface Summary | +|
|---|---|
| Condition.Step<I,O> | ++ |
| Description | +A description of a Matcher. | +
| Matcher<T> | +A matcher over acceptable values. | +
| SelfDescribing | +The ability of an object to describe itself. | +
+ +
| +Class Summary | +|
|---|---|
| BaseDescription | +A Description that is stored as a string. |
+
| BaseMatcher<T> | +BaseClass for all Matcher implementations. | +
| Condition<T> | +A Condition implements part of a multi-step match. | +
| CoreMatchers | ++ |
| CustomMatcher<T> | +Utility class for writing one off matchers. | +
| CustomTypeSafeMatcher<T> | +Utility class for writing one off matchers. | +
| Description.NullDescription | ++ |
| DiagnosingMatcher<T> | +TODO(ngd): Document. | +
| EasyMock2Matchers | ++ |
| FeatureMatcher<T,U> | +Supporting class for matching a feature of an object. | +
| JavaLangMatcherAssert | +Integration method for use with Java's assert keyword. |
+
| JMock1Matchers | ++ |
| MatcherAssert | ++ |
| Matchers | ++ |
| StringDescription | +A Description that is stored as a string. |
+
| 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. | +
| TypeSafeMatcher<T> | +Convenient base class for Matchers that require a non-null value of a specific type. | +
+ +
| +Annotation Types Summary | +|
|---|---|
| Factory | +Marks a Hamcrest static factory method so tools recognise them. | +
+
The stable API defining Matcher and its associated interfaces and classes. + Hamcrest sub-projects define their convenience classes in the org.hamcrest package. +
++ +
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| +Packages that use org.hamcrest | +|
|---|---|
| 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.internal | ++ |
| org.hamcrest.number | +Matchers that perform numeric comparisons. | +
| org.hamcrest.object | +Matchers that inspect objects and classes. | +
| org.hamcrest.text | +Matchers that perform text comparisons. | +
| org.hamcrest.xml | +Matchers of XML documents. | +
| +Classes in org.hamcrest used by org.hamcrest | +|
|---|---|
| BaseDescription
+
+ + A Description that is stored as a string. |
+|
| BaseMatcher
+
+ + BaseClass for all Matcher implementations. |
+|
| Condition
+
+ + A Condition implements part of a multi-step match. |
+|
| Condition.Step
+
+ + |
+|
| Description
+
+ + A description of a Matcher. |
+|
| Matcher
+
+ + A matcher over acceptable values. |
+|
| SelfDescribing
+
+ + The ability of an object to describe itself. |
+|
| TypeSafeDiagnosingMatcher
+
+ + 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. |
+|
| TypeSafeMatcher
+
+ + Convenient base class for Matchers that require a non-null value of a specific type. |
+|
| +Classes in org.hamcrest used by org.hamcrest.beans | +|
|---|---|
| BaseMatcher
+
+ + BaseClass for all Matcher implementations. |
+|
| Description
+
+ + A description of a Matcher. |
+|
| DiagnosingMatcher
+
+ + TODO(ngd): Document. |
+|
| Factory
+
+ + Marks a Hamcrest static factory method so tools recognise them. |
+|
| Matcher
+
+ + A matcher over acceptable values. |
+|
| SelfDescribing
+
+ + The ability of an object to describe itself. |
+|
| TypeSafeDiagnosingMatcher
+
+ + 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. |
+|
| TypeSafeMatcher
+
+ + Convenient base class for Matchers that require a non-null value of a specific type. |
+|
| +Classes in org.hamcrest used by org.hamcrest.collection | +|
|---|---|
| BaseMatcher
+
+ + BaseClass for all Matcher implementations. |
+|
| Description
+
+ + A description of a Matcher. |
+|
| Factory
+
+ + Marks a Hamcrest static factory method so tools recognise them. |
+|
| FeatureMatcher
+
+ + Supporting class for matching a feature of an object. |
+|
| Matcher
+
+ + A matcher over acceptable values. |
+|
| SelfDescribing
+
+ + The ability of an object to describe itself. |
+|
| TypeSafeDiagnosingMatcher
+
+ + 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. |
+|
| TypeSafeMatcher
+
+ + Convenient base class for Matchers that require a non-null value of a specific type. |
+|
| +Classes in org.hamcrest used by org.hamcrest.core | +|
|---|---|
| BaseMatcher
+
+ + BaseClass for all Matcher implementations. |
+|
| Description
+
+ + A description of a Matcher. |
+|
| DiagnosingMatcher
+
+ + TODO(ngd): Document. |
+|
| Factory
+
+ + Marks a Hamcrest static factory method so tools recognise them. |
+|
| Matcher
+
+ + A matcher over acceptable values. |
+|
| SelfDescribing
+
+ + The ability of an object to describe itself. |
+|
| TypeSafeDiagnosingMatcher
+
+ + 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. |
+|
| TypeSafeMatcher
+
+ + Convenient base class for Matchers that require a non-null value of a specific type. |
+|
| +Classes in org.hamcrest used by org.hamcrest.integration | +|
|---|---|
| Matcher
+
+ + A matcher over acceptable values. |
+|
| +Classes in org.hamcrest used by org.hamcrest.internal | +|
|---|---|
| Description
+
+ + A description of a Matcher. |
+|
| SelfDescribing
+
+ + The ability of an object to describe itself. |
+|
| +Classes in org.hamcrest used by org.hamcrest.number | +|
|---|---|
| BaseMatcher
+
+ + BaseClass for all Matcher implementations. |
+|
| Description
+
+ + A description of a Matcher. |
+|
| Factory
+
+ + Marks a Hamcrest static factory method so tools recognise them. |
+|
| Matcher
+
+ + A matcher over acceptable values. |
+|
| SelfDescribing
+
+ + The ability of an object to describe itself. |
+|
| TypeSafeMatcher
+
+ + Convenient base class for Matchers that require a non-null value of a specific type. |
+|
| +Classes in org.hamcrest used by org.hamcrest.object | +|
|---|---|
| BaseMatcher
+
+ + BaseClass for all Matcher implementations. |
+|
| Description
+
+ + A description of a Matcher. |
+|
| Factory
+
+ + Marks a Hamcrest static factory method so tools recognise them. |
+|
| FeatureMatcher
+
+ + Supporting class for matching a feature of an object. |
+|
| Matcher
+
+ + A matcher over acceptable values. |
+|
| SelfDescribing
+
+ + The ability of an object to describe itself. |
+|
| TypeSafeDiagnosingMatcher
+
+ + 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. |
+|
| TypeSafeMatcher
+
+ + Convenient base class for Matchers that require a non-null value of a specific type. |
+|
| +Classes in org.hamcrest used by org.hamcrest.text | +|
|---|---|
| BaseMatcher
+
+ + BaseClass for all Matcher implementations. |
+|
| Description
+
+ + A description of a Matcher. |
+|
| Factory
+
+ + Marks a Hamcrest static factory method so tools recognise them. |
+|
| Matcher
+
+ + A matcher over acceptable values. |
+|
| SelfDescribing
+
+ + The ability of an object to describe itself. |
+|
| TypeSafeMatcher
+
+ + Convenient base class for Matchers that require a non-null value of a specific type. |
+|
| +Classes in org.hamcrest used by org.hamcrest.xml | +|
|---|---|
| BaseMatcher
+
+ + BaseClass for all Matcher implementations. |
+|
| Description
+
+ + A description of a Matcher. |
+|
| Factory
+
+ + Marks a Hamcrest static factory method so tools recognise them. |
+|
| Matcher
+
+ + A matcher over acceptable values. |
+|
| SelfDescribing
+
+ + The ability of an object to describe itself. |
+|
| TypeSafeDiagnosingMatcher
+
+ + 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. |
+|
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<java.lang.String> +
org.hamcrest.text.IsEmptyString +
public final class IsEmptyString
+Matches empty Strings (and null). +
+ +
+
| +Constructor Summary | +|
|---|---|
IsEmptyString()
+
++ |
+|
| +Method Summary | +|
|---|---|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+
+static Matcher<java.lang.String> |
+isEmptyOrNullString()
+
++ Creates a matcher of String that matches when the examined string is null, or
+ has zero length. |
+
+static Matcher<java.lang.String> |
+isEmptyString()
+
++ Creates a matcher of String that matches when the examined string has zero length. |
+
+ boolean |
+matches(java.lang.Object item)
+
++ Evaluates the matcher for argument item. |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsEmptyString()+
| +Method Detail | +
|---|
+public boolean matches(java.lang.Object item)+
Matcher+
item - the object against which the matcher is evaluated.
+true if item matches, otherwise false.BaseMatcher+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static Matcher<java.lang.String> isEmptyString()+
String that matches when the examined string has zero length.
+
+ For example:
+ assertThat("", isEmptyString())
++
+public static Matcher<java.lang.String> isEmptyOrNullString()+
String that matches when the examined string is null, or
+ has zero length.
+
+ For example:
+ assertThat(((String)null), isEmptyString())+
+
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<java.lang.String> +
org.hamcrest.text.IsEqualIgnoringCase +
public class IsEqualIgnoringCase
+Tests if a string is equal to another string, regardless of the case. +
+ +
+
| +Constructor Summary | +|
|---|---|
IsEqualIgnoringCase(java.lang.String string)
+
++ |
+|
| +Method Summary | +|
|---|---|
+ void |
+describeMismatchSafely(java.lang.String item,
+ Description mismatchDescription)
+
++ Subclasses should override this. |
+
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+
+static Matcher<java.lang.String> |
+equalToIgnoringCase(java.lang.String expectedString)
+
++ Creates a matcher of String that matches when the examined string is equal to
+ the specified expectedString, ignoring case. |
+
+ boolean |
+matchesSafely(java.lang.String item)
+
++ Subclasses should implement this. |
+
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsEqualIgnoringCase(java.lang.String string)+
| +Method Detail | +
|---|
+public boolean matchesSafely(java.lang.String item)+
TypeSafeMatcher+
matchesSafely in class TypeSafeMatcher<java.lang.String>+public void describeMismatchSafely(java.lang.String item, + Description mismatchDescription)+
TypeSafeMatcher+
describeMismatchSafely in class TypeSafeMatcher<java.lang.String>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static Matcher<java.lang.String> equalToIgnoringCase(java.lang.String expectedString)+
String that matches when the examined string is equal to
+ the specified expectedString, ignoring case.
+
+ For example:
+ assertThat("Foo", equalToIgnoringCase("FOO"))
++
expectedString - the expected value of matched strings
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<java.lang.String> +
org.hamcrest.text.IsEqualIgnoringWhiteSpace +
public class IsEqualIgnoringWhiteSpace
+Tests if a string is equal to another string, ignoring any changes in whitespace. +
+ +
+
| +Constructor Summary | +|
|---|---|
IsEqualIgnoringWhiteSpace(java.lang.String string)
+
++ |
+|
| +Method Summary | +|
|---|---|
+ void |
+describeMismatchSafely(java.lang.String item,
+ Description mismatchDescription)
+
++ Subclasses should override this. |
+
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+
+static Matcher<java.lang.String> |
+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. |
+
+ boolean |
+matchesSafely(java.lang.String item)
+
++ Subclasses should implement this. |
+
+ java.lang.String |
+stripSpace(java.lang.String toBeStripped)
+
++ |
+
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public IsEqualIgnoringWhiteSpace(java.lang.String string)+
| +Method Detail | +
|---|
+public boolean matchesSafely(java.lang.String item)+
TypeSafeMatcher+
matchesSafely in class TypeSafeMatcher<java.lang.String>+public void describeMismatchSafely(java.lang.String item, + Description mismatchDescription)+
TypeSafeMatcher+
describeMismatchSafely in class TypeSafeMatcher<java.lang.String>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public java.lang.String stripSpace(java.lang.String toBeStripped)+
+public static Matcher<java.lang.String> equalToIgnoringWhiteSpace(java.lang.String expectedString)+
String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored. To be
+ exact, the following whitespace rules are applied:
+ assertThat(" my\tfoo bar ", equalToIgnoringWhiteSpace(" my foo bar"))
++
expectedString - the expected value of matched strings
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeMatcher<java.lang.String> +
org.hamcrest.text.StringContainsInOrder +
public class StringContainsInOrder
+
| +Constructor Summary | +|
|---|---|
StringContainsInOrder(java.lang.Iterable<java.lang.String> substrings)
+
++ |
+|
| +Method Summary | +|
|---|---|
+ void |
+describeMismatchSafely(java.lang.String item,
+ Description mismatchDescription)
+
++ Subclasses should override this. |
+
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+
+ boolean |
+matchesSafely(java.lang.String s)
+
++ Subclasses should implement this. |
+
+static Matcher<java.lang.String> |
+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. |
+
| Methods inherited from class org.hamcrest.TypeSafeMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Constructor Detail | +
|---|
+public StringContainsInOrder(java.lang.Iterable<java.lang.String> substrings)+
| +Method Detail | +
|---|
+public boolean matchesSafely(java.lang.String s)+
TypeSafeMatcher+
matchesSafely in class TypeSafeMatcher<java.lang.String>+public void describeMismatchSafely(java.lang.String item, + Description mismatchDescription)+
TypeSafeMatcher+
describeMismatchSafely in class TypeSafeMatcher<java.lang.String>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static Matcher<java.lang.String> stringContainsInOrder(java.lang.Iterable<java.lang.String> substrings)+
String that matches when the examined string contains all of
+ the specified substrings, regardless of the order of their appearance.
+
+ For example:
+ assertThat("myfoobarbaz", stringContainsInOrder(Arrays.asList("bar", "foo")))
++
substrings - the substrings that must be contained within matching strings
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
|
+Classes
+
+ +IsEmptyString + +IsEqualIgnoringCase + +IsEqualIgnoringWhiteSpace + +StringContainsInOrder |
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+See:
+
+ Description
+
+ +
| +Class Summary | +|
|---|---|
| IsEmptyString | +Matches empty Strings (and null). | +
| IsEqualIgnoringCase | +Tests if a string is equal to another string, regardless of the case. | +
| IsEqualIgnoringWhiteSpace | +Tests if a string is equal to another string, ignoring any changes in whitespace. | +
| StringContainsInOrder | ++ |
+
Matchers that perform text comparisons.
++ +
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+java.lang.Object ++org.hamcrest.BaseMatcher<T> +
org.hamcrest.TypeSafeDiagnosingMatcher<org.w3c.dom.Node> +
org.hamcrest.xml.HasXPath +
public class HasXPath
+Applies a Matcher to a given XML Node in an existing XML Node tree, specified by an XPath expression. +
+ +
+
| +Field Summary | +|
|---|---|
+static javax.xml.namespace.NamespaceContext |
+NO_NAMESPACE_CONTEXT
+
++ |
+
| +Constructor Summary | +|
|---|---|
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)
+
++ |
+|
| +Method Summary | +|
|---|---|
+ void |
+describeTo(Description description)
+
++ Generates a description of the object. |
+
+static Matcher<org.w3c.dom.Node> |
+hasXPath(java.lang.String xPath)
+
++ Creates a matcher of Nodes that matches when the examined node contains a node
+ at the specified xPath, with any content. |
+
+static Matcher<org.w3c.dom.Node> |
+hasXPath(java.lang.String xPath,
+ Matcher<java.lang.String> valueMatcher)
+
++ Creates a matcher of Nodes 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(java.lang.String xPath,
+ javax.xml.namespace.NamespaceContext namespaceContext)
+
++ Creates a matcher of Nodes 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(java.lang.String xPath,
+ javax.xml.namespace.NamespaceContext namespaceContext,
+ Matcher<java.lang.String> valueMatcher)
+
++ Creates a matcher of Nodes that matches when the examined node has a value at the
+ specified xPath, within the specified namespaceContext, that satisfies
+ the specified valueMatcher. |
+
+ boolean |
+matchesSafely(org.w3c.dom.Node item,
+ Description mismatch)
+
++ Subclasses should implement this. |
+
| Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher | +
|---|
describeMismatch, matches |
+
| Methods inherited from class org.hamcrest.BaseMatcher | +
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
+
| Methods inherited from class java.lang.Object | +
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
+
| +Field Detail | +
|---|
+public static final javax.xml.namespace.NamespaceContext NO_NAMESPACE_CONTEXT+
| +Constructor Detail | +
|---|
+public HasXPath(java.lang.String xPathExpression, + Matcher<java.lang.String> valueMatcher)+
xPathExpression - XPath expression.valueMatcher - Matcher to use at given XPath.
+ May be null to specify that the XPath must exist but the value is irrelevant.+public HasXPath(java.lang.String xPathExpression, + javax.xml.namespace.NamespaceContext namespaceContext, + Matcher<java.lang.String> valueMatcher)+
xPathExpression - XPath expression.namespaceContext - Resolves XML namespace prefixes in the XPath expressionvalueMatcher - Matcher to use at given XPath.
+ May be null to specify that the XPath must exist but the value is irrelevant.| +Method Detail | +
|---|
+public boolean matchesSafely(org.w3c.dom.Node item, + Description mismatch)+
TypeSafeDiagnosingMatcher+
matchesSafely in class TypeSafeDiagnosingMatcher<org.w3c.dom.Node>+public void describeTo(Description description)+
SelfDescribing+
description - The description to be built or appended to.+public static Matcher<org.w3c.dom.Node> hasXPath(java.lang.String xPath, + Matcher<java.lang.String> valueMatcher)+
Nodes that matches when the examined node has a value at the
+ specified xPath that satisfies the specified valueMatcher.
+
+ For example:
+ assertThat(xml, hasXPath("/root/something[2]/cheese", equalTo("Cheddar")))
++
xPath - the target xpathvalueMatcher - matcher for the value at the specified xpath+public static Matcher<org.w3c.dom.Node> hasXPath(java.lang.String xPath, + javax.xml.namespace.NamespaceContext namespaceContext, + Matcher<java.lang.String> valueMatcher)+
Nodes that matches when the examined node has a value at the
+ specified xPath, within the specified namespaceContext, that satisfies
+ the specified valueMatcher.
+
+ For example:
+ assertThat(xml, hasXPath("/root/something[2]/cheese", myNs, equalTo("Cheddar")))
++
xPath - the target xpathnamespaceContext - the namespace for matching nodesvalueMatcher - matcher for the value at the specified xpath+public static Matcher<org.w3c.dom.Node> hasXPath(java.lang.String xPath)+
Nodes that matches when the examined node contains a node
+ at the specified xPath, with any content.
+
+ For example:
+ assertThat(xml, hasXPath("/root/something[2]/cheese"))
++
xPath - the target xpath+public static Matcher<org.w3c.dom.Node> hasXPath(java.lang.String xPath, + javax.xml.namespace.NamespaceContext namespaceContext)+
Nodes that matches when the examined node contains a node
+ at the specified xPath within the specified namespace context, with any content.
+
+ For example:
+ assertThat(xml, hasXPath("/root/something[2]/cheese", myNs))
++
xPath - the target xpathnamespaceContext - the namespace for matching nodes
+
+
|
++ + | +|||||||||
| + PREV CLASS + NEXT CLASS | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + SUMMARY: NESTED | FIELD | CONSTR | METHOD | ++DETAIL: FIELD | CONSTR | METHOD | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
|
+Classes
+
+ +HasXPath |
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+See:
+
+ Description
+
+ +
| +Class Summary | +|
|---|---|
| HasXPath | +Applies a Matcher to a given XML Node in an existing XML Node tree, specified by an XPath expression. | +
+
Matchers of XML documents.
++ +
+
+
+
|
++ + | +|||||||||
| + PREV PACKAGE + NEXT PACKAGE | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
| + | +
|---|
| All Classes
+
+
+Packages
+ |
+
+ + + diff --git a/javadoc/1.3/overview-summary.html b/javadoc/1.3/overview-summary.html new file mode 100644 index 000000000..74687e8d0 --- /dev/null +++ b/javadoc/1.3/overview-summary.html @@ -0,0 +1,221 @@ + + + +
+ +
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+See:
+
+ Description
+
+ +
| +Hamcrest API and Utility Classes | +|
|---|---|
| org.hamcrest | +The stable API defining Matcher and its associated interfaces and classes. | +
+ +
| +Matcher Library | +|
|---|---|
| org.hamcrest.beans | +Matchers of Java Bean properties and their values. | +
| org.hamcrest.collection | +Matchers of arrays and collections. | +
| org.hamcrest.core | +Fundamental matchers of objects and values, and composite matchers. | +
| org.hamcrest.internal | ++ |
| org.hamcrest.number | +Matchers that perform numeric comparisons. | +
| org.hamcrest.object | +Matchers that inspect objects and classes. | +
| org.hamcrest.text | +Matchers that perform text comparisons. | +
| org.hamcrest.xml | +Matchers of XML documents. | +
+ +
| +Integration | +|
|---|---|
| org.hamcrest.integration | ++ |
+
Hamcrest is a library of matchers, which can be combined in +to create flexible expressions of intent in tests.
+ +Documentation can be found at: http://hamcrest.org/.
++ +
+
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
+
+
|
++ + | +|||||||||
| + PREV + NEXT | ++ FRAMES + NO FRAMES + + + + + | +|||||||||
Java Hamcrest
+
+
+
From 8d60eda719d8a293c18f835fbdb1eb5dd0e7aa2a Mon Sep 17 00:00:00 2001
From: scarytom
Java Hamcrest