diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 000000000..34477c7e2
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,7 @@
+version: 2
+updates:
+- package-ecosystem: gradle
+ directory: "/"
+ schedule:
+ interval: daily
+ open-pull-requests-limit: 10
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 000000000..83fbd7fa6
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,33 @@
+name: Gradle Build
+
+on: [push, pull_request]
+
+concurrency:
+ group: ${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ build:
+ name: Java ${{ matrix.java }} build
+ runs-on: ubuntu-latest
+ continue-on-error: ${{ matrix.experimental }}
+ strategy:
+ fail-fast: true
+ matrix:
+ java: [ 8 ]
+ experimental: [false]
+ include:
+ - java: 17
+ experimental: true
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - name: Set up JDK ${{ matrix.java }}
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ matrix.java }}
+ distribution: 'temurin'
+ cache: gradle
+ - name: Build with Gradle
+ run: ./gradlew clean build javadoc
diff --git a/.gitignore b/.gitignore
index a6dd54ba1..725179b25 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,15 +1,18 @@
-/build
-/classes
-/bin
-/out
+build/
+classes/
+bin/
+out/
.DS_Store
*~
*.swp
-/.idea
+.idea/
*.iws
*.ipr
*.iml
+.classpath
.gradle
-
+.project
+.settings/
gradle.properties
release-key.asc
+grade-wrapper.properties
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index f3e8ca3b6..000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-language: java
-
-jdk:
- - openjdk7
- - oraclejdk7
- - oraclejdk8
-
-script:
- - ./gradlew clean build javadoc
diff --git a/BUILDING.txt b/BUILDING.txt
deleted file mode 100644
index b5af7f6f9..000000000
--- a/BUILDING.txt
+++ /dev/null
@@ -1,17 +0,0 @@
- **********************
-********************* Building Hamcrest *********************
- **********************
-
---[ Build requirements ]-------------------------------------
-
-* JDK 1.7
-
---[ Building from the command line ]-------------------------
-
-Execute Gradle target:
- ./gradlew clean build javadoc
-
-This will download the correct version of Gradle, do a full
-clean build, run all tests and (if successful) package up
-a distribution. The resulting builds reside in the 'build'
-directory.
diff --git a/CHANGES.md b/CHANGES.md
new file mode 100644
index 000000000..851be4dc3
--- /dev/null
+++ b/CHANGES.md
@@ -0,0 +1,192 @@
+# Hamcrest Changes
+
+## Version 3.1 (Unreleased)
+
+### Breaking Changes
+
+* As a result of the bugfix to allow matching against polymorphic collections
+([PR #422](https://github.com/hamcrest/JavaHamcrest/pull/422)), the signature of the
+`hasItem` and `hasItems` methods has changed. Code relying on the exact signature of
+these methods will need to be updated. The following methods are affected:
+ * `org.hamcrest.CoreMatchers.hasItem`
+ * `org.hamcrest.CoreMatchers.hasItems`
+ * `org.hamcrest.Matchers.hasItem`
+ * `org.hamcrest.Matchers.hasItems`
+ * `org.hamcrest.core.IsCollectionContaining.hasItem`
+ * `org.hamcrest.core.IsCollectionContaining.hasItems`
+ * `org.hamcrest.core.IsIterableContaining.hasItem`
+ * `org.hamcrest.core.IsIterableContaining.hasItems`
+ * TODO: decide if these breaking changes should trigger a major version upgrade (i.e v4.0)
+
+### New Features
+
+* Optional matchers ([PR #421](https://github.com/hamcrest/JavaHamcrest/pull/421))
+* Matchers for thrown exceptions ([PR #423](https://github.com/hamcrest/JavaHamcrest/pull/423))
+
+### Improvements
+
+* Javadoc improvements and cleanup ([PR #420](https://github.com/hamcrest/JavaHamcrest/pull/420),
+[#427](https://github.com/hamcrest/JavaHamcrest/issues/427),
+[PR #428](https://github.com/hamcrest/JavaHamcrest/pull/428))
+* Derive version from git tags ([PR #419](https://github.com/hamcrest/JavaHamcrest/pull/419))
+* Migrate all tests to JUnit Jupiter ([PR #424](https://github.com/hamcrest/JavaHamcrest/pull/424))
+
+### Bugfixes
+
+* Allow matching against polymorphic collections ([#252](https://github.com/hamcrest/JavaHamcrest/issues/252),
+ [PR #422](https://github.com/hamcrest/JavaHamcrest/pull/422))
+
+## Version 3.0 (1st August 2024)
+
+### Breaking Changes
+
+* From version 3.0, the jar distributed to Maven Central is now compiled to Java 1.8 bytecode,
+ and is not compatible with previous versions of Java. See
+ [Issue #331](https://github.com/hamcrest/JavaHamcrest/issues/331) and
+ [PR #411](https://github.com/hamcrest/JavaHamcrest/issues/411) for details. Developers who use Java 1.7 earlier can still
+ depend upon `hamcrest-2.2.jar`.
+
+### Improvements
+
+* FileMatchersTest simplification ([PR #389](https://github.com/hamcrest/JavaHamcrest/issues/389))
+* License cleanup ([PR #414](https://github.com/hamcrest/JavaHamcrest/issues/414),
+ [PR #415](https://github.com/hamcrest/JavaHamcrest/issues/415), see also
+ [#264](https://github.com/hamcrest/JavaHamcrest/issues/264),
+ [#355](https://github.com/hamcrest/JavaHamcrest/issues/355),
+ [#396](https://github.com/hamcrest/JavaHamcrest/issues/396),and
+ [#399](https://github.com/hamcrest/JavaHamcrest/issues/399))
+
+
+## Version 2.2 (17th October 2019)
+
+### Improvements
+
+* AllOf/AnyOf: Pass the matchers to constructor using varargs ([Issue #245](https://github.com/hamcrest/JavaHamcrest/pull/245))
+* Matchers.anyOf: Fix generic bounds compatibility for JDK 11 ([Issue #256](https://github.com/hamcrest/JavaHamcrest/issues/256), [Issue #257](https://github.com/hamcrest/JavaHamcrest/issues/257))
+* AssertionError message is unhelpful when match fails for byte type ([Issue #254](https://github.com/hamcrest/JavaHamcrest/issues/254), [Issue #255](https://github.com/hamcrest/JavaHamcrest/issues/255))
+* Use platform specific line breaks ([PR #267](https://github.com/hamcrest/JavaHamcrest/pull/267))
+* Build now checks for consistent use of spaces ([PR #217](https://github.com/hamcrest/JavaHamcrest/pull/217))
+
+### Bugfixes
+* Fix compatibility issue for development with Android D8 ([Issue #246](https://github.com/hamcrest/JavaHamcrest/issues/246))
+* Fix typo in license name ([Issue #247](https://github.com/hamcrest/JavaHamcrest/pull/247))
+* 1.3 compatible constructors for string matchers ([Issue #259](https://github.com/hamcrest/JavaHamcrest/issues/259), [Issue #260](https://github.com/hamcrest/JavaHamcrest/issues/260))
+* Fix for split packages with Java 9 modules ([Issue #269](https://github.com/hamcrest/JavaHamcrest/issues/269), [PR #270](https://github.com/hamcrest/JavaHamcrest/pull/270))
+
+
+## Version 2.1 (21st December 2018)
+
+### Overview for 2.1
+
+After a long hiatus without releases, this version simplifies the packaging of
+Hamcrest into a single jar: `hamcrest-.jar`. Other big changes include
+Java 9 module compatibility, migrating the code repository from Google Code to
+GitHub, along with numerous other new features, improvements and bug fixes.
+
+### Breaking Changes for 2.1
+
+* The way that the project is packaged has changed. This may cause problems with
+ correctly upgrading transitive dependencies. Refer to the
+ [Hamcrest Distributables](http://hamcrest.org/JavaHamcrest/distributables.html)
+ documentation for more information, and in particular,
+ [Upgrading from Hamcrest 1.x](http://hamcrest.org/JavaHamcrest/distributables.html#upgrading-from-hamcrest-1.x)
+* `org.hamcrest.Factory` has been removed. This was only used in old implementations
+ of the hamcrest build toolchain, and can safely be deleted from client code without
+ any effect.
+
+### Changes for 2.1
+
+* Documentation updates
+* Several JavaDoc improvements and corrections
+* Fix JavaDoc examples
+* Upgraded to Java 7
+* Build with Gradle
+* Publish a single jar `hamcrest-2.1.jar`
+* Publish pom-only artifacts for `hamcrest-core` and `hamcrest-library`.
+* Add implementation for CharSequence length matcher
+* Fix for TypeSafeDiagnosingMatcher can't detect generic types for subclass
+* Make Hamcrest an OSGI bundle
+* Add StringRegularExpression matcher
+* Fix StringContainsInOrder to detect if a repeated pattern is missing
+* Add ArrayAsIterableMatcher
+* Fix description for IsEqualIgnoringCase
+* Removed deprecated methods from previous release
+* Improve mismatch description of hasItem/hasItems
+* General improvements to mismatch descriptions
+* Deprecated several matcher factory methods of the for "isXyz"
+* Fix [GH issue #75](https://github.com/hamcrest/JavaHamcrest/issues/75) - address doclint errors reported in JDK 1.8
+* Fix [GH issue #69](https://github.com/hamcrest/JavaHamcrest/issues/69) - Iterable contains in order is null-safe
+* Fix [GH issue #59](https://github.com/hamcrest/JavaHamcrest/issues/59) - added equalToObject() (i.e. unchecked) method
+* Fix [GH issue #25](https://github.com/hamcrest/JavaHamcrest/issues/25) - arrayContaining(null, null) cause NullPointerException
+* Fix [GH issue #36](https://github.com/hamcrest/JavaHamcrest/issues/36) - string matching on regular expressions
+* Fix [GH issue #8](https://github.com/hamcrest/JavaHamcrest/issues/8) - isCloseTo() shows wrong delta in mismatch description
+* Fix [GH issue #59](https://github.com/hamcrest/JavaHamcrest/issues/59) - add untyped version of equalTo, named equalToObject
+* Fix [GC issue #131](https://code.google.com/archive/p/hamcrest/issues/131) - Implement IsEmptyMap, IsMapWithSize
+* Fix [GC issue #187](https://code.google.com/archive/p/hamcrest/issues/187) - IsArray.describeMismatchSafely() should use Matcher.describeMismatch
+* Fix [GC issue #155](https://code.google.com/archive/p/hamcrest/issues/155) - Add Matcher implementation for files
+* Fix [GC issue #69](https://code.google.com/archive/p/hamcrest/issues/69) - fix NPE in IsIterableContainingInOrder
+
+## Version 1.3 (9th July 2012)
+
+* Introduce Condition class to ease the implementation of multi-step matches
+* Upgrade qdox (included in the generator) to the latest stable version
+* Correct inadvertent deprecation of the Is.isA factory method
+* Fix [issue #179](https://code.google.com/archive/p/hamcrest/issues/179) - AllOf does not output mismatch description
+* Fix [issue #177](https://code.google.com/archive/p/hamcrest/issues/177) - Introduced closeTo matcher for BigDecimals
+* Fix [issue #152](https://code.google.com/archive/p/hamcrest/issues/152) - Factory classes missing from matchers.xml
+* Fix [issue #144](https://code.google.com/archive/p/hamcrest/issues/144) - OrderingComparison doesn't describe mismatch of comparables that return values other than (-1,0,1)
+* Fix [issue #134](https://code.google.com/archive/p/hamcrest/issues/134) - DescribedAs does not delegate describeMismatch
+* Fix [issue #106](https://code.google.com/archive/p/hamcrest/issues/106) - deprecation warning when writing custom matchers
+* Fix [issue #101](https://code.google.com/archive/p/hamcrest/issues/101) - Added theInstance alias for sameInstance factory method
+
+## Version 1.3 RC2 (22nd October 2010)
+
+* Added FeatureMatcher
+* distinguish between instanceOf() and any()
+
+## Version 1.2 (16th May 2009)
+
+* Added mismatch reporting
+* Added WithSamePropertyValuesAs matcher
+* Moved any() from IsAnything to IsInstanceOf. It now checks the type of the matched object
+* Moved MatcherAssert from integration to core
+* Tightened up generics.
+* Added IsMapContainingKey and IsMapContainingValue matchers to resolve a
+ generics bug in hasKey and hasValue static factories previously declared
+ in IsMapContaining (ngd)
+* Added IsCollectionOnlyContaining and IsArrayOnlyContaining which matches
+ collections (and arrays) where all match a given matcher. E.g onlyContains(3,4,5)
+ or onlyContains(lessThan(9))
+* text module moved to separate project, hamcrest-text-patterns
+* added more colection matchers: xContainingInAnyOrder, xContainingInOrder, xWithSize
+* new text Matcher: IsEmptyString
+* hamcrest generator uses method return type
+
+## Version 1.1 (30th June 2007)
+
+* Hamcrest Generator now includes JavaDoc and parameter names in generated code
+ by using QDox to parse the source code.
+* Created hamcrest-core.jar (and removed hamcrest-api.jar).
+ Moved core set of matchers (and, eq, not, etc)
+ to this package to make it more practical for external libraries
+ to embed Hamcrest.
+* Created CoreMatchers (static import sugar) in hamcrest-core.jar.
+* StringBuilder can use any Appendable (not just StringBuffer).
+* Added sensible toString() method to BaseMatcher.
+* Created StringDescription.asString() alias (because toString() caused issues
+ with static imports).
+* Relaxed isInstanceOf() matcher generic type so it can be used on any kind of
+ object. e.g. assertThat(someUnknownObject, isInstanceOf(String.class));
+* Added any(Class), null(Class) and notNull(Class) matchers, which returns
+ Matcher. Helpful when the compiler struggles with type inference.
+* Modified anyOf() and allOf() to accept mixed-types.
+* TypeSafeMatcher.matchesSafely() is now public.
+* Generator recognizes @Factory methods that return subclass of Matcher.
+ (Fix by David Saff)
+
+## Version 1.0 (15th December 2006)
+
+Initial release.
+
+* Support for namespaces in HasXPath
+* Bug fix for matching empty elements with HasXPath
diff --git a/CHANGES.txt b/CHANGES.txt
deleted file mode 100644
index f0a392b95..000000000
--- a/CHANGES.txt
+++ /dev/null
@@ -1,135 +0,0 @@
-== Version 2.0.0.0 ==
-
-A new beginning...
-
-* Upgraded to Java 7
-
-* Build with Gradle
-
-* Publish a single jar java-hamcrest-x.x.x.x.jar
-
-* Removed deprecated methods from previous release
-
-* Improve mismatch description of hasItem/hasItems
-
-* General improvements to mismatch descriptions
-
-* Several JavaDoc improvements and corrections
-
-* Fix gh issue #69 - Iterable contains in order is null-safe
-
-* Fix gh issue #59 - added equalToObject() (i.e. unchecked) method
-
-* Fix gh issue #25 - arrayContaining(null, null) cause NullPointerException
-
-* Fix gh issue #36 - string matching on regular expressions
-
-* Fix gh issue #8 - isCloseTo() shows wrong delta in mismatch description
-
-* Fix issue 131 - Implement IsEmptyMap, IsMapWithSize
-
-* Fix issue 155 - Deprecated several matcher factory methods of the for "isXyz"
-
-* Fix issue 187 - IsArray.describeMismatchSafely() should use Matcher.describeMismatch
-
-* Fix issue 155 - Add Matcher implementation for files
-
-* Fix issue 59 - add untyped version of equalTo, named equalToObject
-
-* Fix issue 69 - fix NPE in IsIterableContainingInOrder
-
-* Fix issue 75 - address doclint errors reported in JDK 1.8
-
-== Version 1.3: Released July 09 2012 ==
-
-* Introduce Condition class to ease the implementation of multi-step matches
-
-* Upgrade qdox (included in the generator) to the latest stable version
-
-* Correct inadvertent deprecation of the Is.isA factory method
-
-* Fix issue 179 - AllOf does not output mismatch description
-
-* Fix issue 177 - Introduced closeTo matcher for BigDecimals
-
-* Fix issue 152 - Factory classes missing from matchers.xml
-
-* Fix issue 144 - OrderingComparison doesn't describe mismatch of comparables that return values other than (-1,0,1)
-
-* Fix issue 134 - DescribedAs does not delegate describeMismatch
-
-* Fix issue 106 - deprecation warning when writing custom matchers
-
-* Fix issue 101 - Added theInstance alias for sameInstance factory method
-
-== Version 1.3 RC2: Released October 22 2010 ==
-
-* Added FeatureMatcher
-
-* distinguish between instanceOf() and any()
-
-== Version 1.2: Released May 16 2009 ==
-
-* Added mismatch reporting
-
-* Added WithSamePropertyValuesAs matcher
-
-* Moved any() from IsAnything to IsInstanceOf. It now checks the type of the matched object
-
-* Moved MatcherAssert from integration to core
-
-* Tightened up generics.
-
-* Added IsMapContainingKey and IsMapContainingValue matchers to resolve a
- generics bug in hasKey and hasValue static factories previously declared
- in IsMapContaining (ngd)
-
-* Added IsCollectionOnlyContaining and IsArrayOnlyContaining which matches
- collections (and arrays) where all match a given matcher. E.g onlyContains(3,4,5)
- or onlyContains(lessThan(9))
-
-* text module moved to separate project, hamcrest-text-patterns
-
-* added more colection matchers: xContainingInAnyOrder, xContainingInOrder, xWithSize
-
-* new text Matcher: IsEmptyString
-
-* hamcrest generator uses method return type
-
-== Version 1.1: Released Jun 30 2007 ==
-
-* Hamcrest Generator now includes JavaDoc and parameter names in generated code
- by using QDox to parse the source code.
-
-* Created hamcrest-core.jar (and removed hamcrest-api.jar).
- Moved core set of matchers (and, eq, not, etc)
- to this package to make it more practical for external libraries
- to embed Hamcrest.
-
-* Created CoreMatchers (static import sugar) in hamcrest-core.jar.
-
-* StringBuilder can use any Appendable (not just StringBuffer).
-
-* Added sensible toString() method to BaseMatcher.
-
-* Created StringDescription.asString() alias (because toString() caused issues
- with static imports).
-
-* Relaxed isInstanceOf() matcher generic type so it can be used on any kind of
- object. e.g. assertThat(someUnknownObject, isInstanceOf(String.class));
-
-* Added any(Class), null(Class) and notNull(Class) matchers, which returns
- Matcher. Helpful when the compiler struggles with type inference.
-
-* Modified anyOf() and allOf() to accept mixed-types.
-
-* TypeSafeMatcher.matchesSafely() is now public.
-
-* Generator recognizes @Factory methods that return subclass of Matcher.
- (Fix by David Saff)
-
-== Version 1.0: Released Dec 15 2006 ==
-
-Initial release.
-* Support for namespaces in HasXPath
-* Bug fix for matching empty elements with HasXPath
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000..5a57af22a
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,29 @@
+BSD 3-Clause License
+
+Copyright (c) 2000-2024, www.hamcrest.org
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/LICENSE.txt b/LICENSE.txt
deleted file mode 100644
index 1b8690275..000000000
--- a/LICENSE.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-BSD License
-
-Copyright (c) 2000-2015 www.hamcrest.org
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-Redistributions of source code must retain the above copyright notice, this list of
-conditions and the following disclaimer. Redistributions in binary form must reproduce
-the above copyright notice, this list of conditions and the following disclaimer in
-the documentation and/or other materials provided with the distribution.
-
-Neither the name of Hamcrest nor the names of its contributors may be used to endorse
-or promote products derived from this software without specific prior written
-permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
-WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGE.
diff --git a/README.md b/README.md
index c1e1e0f57..009fdefff 100644
--- a/README.md
+++ b/README.md
@@ -1,63 +1,68 @@

-[](https://travis-ci.org/hamcrest/JavaHamcrest)
+[](https://github.com/hamcrest/JavaHamcrest/actions/workflows/build.yml)
+[](https://search.maven.org/artifact/org.hamcrest/hamcrest)
+[](LICENSE)
-Java Hamcrest
-=============
-Licensed under [BSD License][].
-What is Hamcrest?
------------------
+# Java Hamcrest
+
+## What is Hamcrest?
+
Hamcrest is a library of matchers, which can be combined in to create flexible expressions of intent in tests.
They've also been used for other purposes.
-Downloads
----------
-You can obtain Hamcrest binaries from [maven central][], or from [google code downloads][].
+The [tutorial](http://hamcrest.org/JavaHamcrest/tutorial) is good place to see how Hamcrest can be used.
-Extensions
-----------
+## Downloads
-For Hamcrest extension projects see the [hamcrest extensions page][].
+You can obtain Hamcrest binaries from [maven central](https://search.maven.org/artifact/org.hamcrest/hamcrest). If you
+are using build tooling such as Maven, Gradle, etc, you can simply add a dependency declaration to your build
+definition. Learn more at [Hamcrest Distributables](http://hamcrest.org/JavaHamcrest/distributables).
-Documentation
--------------
-Documentation can be found on the [Hamcrest site](http://hamcrest.org).
+## Documentation
-Reporting Bugs/Issues
----------------------
-If you find an issue with Java Hamcrest, please report it via the
-[GitHub issue tracker](https://github.com/hamcrest/JavaHamcrest/issues),
-after first checking that it hasn't been raised already.
+Documentation can be found on the [Hamcrest site](http://hamcrest.org). For a detailed list of recent changes,
+see [CHANGES.md](CHANGES.md)
-Source
-------
-To build, please read BUILDING.txt
+## Reporting Bugs/Issues
-Acknowledgements
-----------------
-Developers:
+If you find an issue with Java Hamcrest, please report it via the
+[GitHub issue tracker](https://github.com/hamcrest/JavaHamcrest/issues),
+after first checking that it hasn't been raised already.
- * Joe Walnes
- * Nat Pryce
- * Steve Freeman
+## Build from Source
-Contributors:
+Building Hamcrest from source requires a minimum of JDK 1.8.
+
+Clone the repository, and from the top level directory in the repo workspace
+run the following command:
- * Robert Chatley
- * Tom White
- * Neil Dunn
- * Dan North
- * Magne Rasmussen
- * David Saff
- * Tom Denley
+```shell
+./gradlew clean build javadoc
+```
+This will download the correct version of Gradle, do a full clean build,
+run all tests and (if successful) package the compiled classes in a jar
+file. The resulting look under the `hamcrest/build/libs` directory.
-Also, thanks to everyone who has worked on DynaMock, nMock, jMock, EasyMock and MiniMock! These libraries inspired Hamcrest.
+## Acknowledgements
+Developers:
+
+* Joe Walnes
+* Nat Pryce
+* Steve Freeman
+
+Contributors:
-[logo]: https://raw.github.com/hamcrest/JavaHamcrest/master/doc/images/logo.jpg
-[website]: https://github.com/hamcrest/JavaHamcrest
-[BSD License]: http://opensource.org/licenses/BSD-3-Clause
-[Maven central]: http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.hamcrest
-[hamcrest extensions page]: https://github.com/hamcrest/JavaHamcrest/wiki/Related-Projects
-[GitHub issue tracker]: https://github.com/hamcrest/JavaHamcrest/issues
+* Robert Chatley
+* Tom White
+* Neil Dunn
+* Dan North
+* Magne Rasmussen
+* David Saff
+* Tom Denley
+* Joe Schmetzer
+
+Also, thanks to everyone who has worked on DynaMock, nMock, jMock, EasyMock
+and MiniMock! These libraries inspired Hamcrest.
diff --git a/RELEASING.md b/RELEASING.md
new file mode 100644
index 000000000..b7bbae55c
--- /dev/null
+++ b/RELEASING.md
@@ -0,0 +1,137 @@
+# Release Procedure
+
+These instructions are a how-to guide for Hamcrest maintainers. They describe
+how to release a new version of Hamcrest to Maven Central.
+
+## Signing Key Setup
+
+The Gradle `signing` plugin is used to cryptographically sign the published
+artifacts. You will need to add details of your private keys to allow
+the plugin to work. Follow the instructions at
+https://docs.gradle.org/current/userguide/signing_plugin.html.
+
+You can store the signing properties in a file called `gradle.properties`
+as a sibling of the top level `build.gradle` file. This file will be ignored
+by `git`, and so will not be accidentally checked in. Alternatively, you
+can put the `gradle.properties` file in the `GRADLE_USER_HOME` directory
+(usually `~/.gradle`)
+
+## Sonatype Account Setup
+
+Before you can perform a release, you will need:
+* An account on the Maven Central staging server at https://oss.sonatype.org/
+* Permissions in the `org.hamcrest` group
+
+### Register an Account
+
+You will need to register an account with https://central.sonatype.com/.
+Follow the instructions at https://central.sonatype.org/register/legacy/#create-an-account
+for actually creating an account. Do not follow the instructions to
+"Create a Namespace". `org.hamcrest` is already managed through the legacy
+project infrastructure. That may change in the future, but for now
+(July 2024) these instructions work as described below.
+
+### Request to be Added to `org.hamcrest`
+
+Sonatype needs to be notified that you have access to publish to
+`org.hamcrest`. This must be done by one of the current publishers
+(e.g. `@tumbarumba` or `@sf105`). Ask one of those people to follow
+the instructions at https://central.sonatype.org/register/legacy/#contact-central-support-at-sonatype.
+This may take up to 2 days before your permissions are applied.
+
+### Configure Access Tokens
+
+https://oss.sonatype.org/ will no longer accept a username and password
+when publishing. Rather, you will need to create an access token. Follow
+the instructions at https://central.sonatype.org/publish/generate-token/,
+and store the values in `ossrhUsername` and `ossrhPassword` in the same
+`gradle.properties` file used to hold the signing keys.
+
+In the end, you should have a `gradle.properties` file with (at least) the
+following keys:
+
+```properties
+signing.keyId=...
+signing.password=...
+signing.secretKeyRingFile=...
+ossrhUsername=...
+ossrhPassword=...
+```
+
+## Publishing Process
+
+### Update Version
+
+The version is defined as a property at the top of the `build.gradle` file
+in the root of the repository. Normally, this has a `-SNAPSHOT` suffix. When
+doing a release, the `-SNAPSHOT` suffix is removed.
+
+Edit the file to set the `version` property to the actual version required.
+Save the file and test out the publishing process locally by running the
+command:
+
+```shell
+./gradlew clean jar publishToMavenLocal
+```
+
+To check the local publish worked correctly, look in the directory
+`~/.m2/repository/org/hamcrest/hamcrest` and verify the versioned files
+are all present and correct.
+
+When you are satisfied that the build is working correctly, you can commit
+the change, tag the repository, and push to GitHub.
+
+e.g. this is the commands for version 3.0:
+
+```shell
+git add build.gradle
+git commit -m "Version 3.0"
+git tag v3.0
+git push origin --tags
+```
+
+### Publishing to Sonatype Staging
+
+When ready, run the command:
+
+```shell
+./gradlew publishAllPublicationsToMavenRepository
+```
+
+Wait.
+
+Wait a bit more. Sometimes it times out. Sometimes you will get 502 errors.
+Keep on trying. It will eventually work.
+
+
+### Release to Maven Central
+
+Look at the staging repositories: https://oss.sonatype.org/#stagingRepositories
+and find the published artifacts. Make sure that everything is present
+and accounted for.
+
+When you are happy, you will need to "Close" the repository - you won't be
+able to publish any more artifacts to this repository, but you will then
+be able to release the repository.
+
+Once it is closed, you will be able to "Release" the repository, which will
+transfer all artifacts to Maven Central. It can take up to half an hour
+for the jars to appear. Look in https://mvnrepository.com/artifact/org.hamcrest/hamcrest
+and check for the new version.
+
+### Prepare for Next Snapshot
+
+Edit the `build.gradle` file, and change the version back to the next
+snapshot version. For example, if you just published version `3.0`, the
+next version will be `3.1-SNAPSHOT`.
+
+Commit this change and push to GitHub.
+
+### Share and Enjoy
+
+Put a message out on the mailing lists to give people the good news.
+
+# Future Improvements
+
+Look at https://github.com/gradle-nexus/publish-plugin/ to automate all
+this.
diff --git a/build.gradle b/build.gradle
index dbc65583d..0a6791b6d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,120 +1,178 @@
-import static org.gradle.api.JavaVersion.VERSION_1_7
-
-apply plugin: 'java'
-apply plugin: 'maven'
-apply plugin: 'signing'
-
-sourceCompatibility = VERSION_1_7
-targetCompatibility = VERSION_1_7
-archivesBaseName = "java-hamcrest"
+plugins {
+ id "signing"
+ id "maven-publish"
+}
+apply from: "gradle/versioning.gradle"
group = "org.hamcrest"
-version = "2.0.0.0"
+version = getMavenVersion()
+
+tasks.register("showVersion") {
+ group = "Build"
+ description = "Show the version, as derived from git tags"
+ doLast {
+ println("git version: " + getGitVersion())
+ println("mvn version: " + getMavenVersion())
+ }
+}
+subprojects {
+ apply plugin: 'checkstyle'
+ apply plugin: 'java-library'
-repositories {
- mavenCentral()
-}
+ group = rootProject.group
+ version = rootProject.version
-dependencies {
- testCompile(group: 'junit', name: 'junit', version: '4.12') {
- transitive = false
+ java {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
}
-}
-sourceSets {
- main {
- java {
- srcDirs 'hamcrest-core/src/main/java', 'hamcrest-library/src/main/java'
+ repositories {
+ mavenCentral()
+ }
+
+ checkstyle {
+
+ project.ext.checkstyleVersion = '9.3'
+ //works with a JDK 7 version which is supposed to be supported although
+ //deprecated, see https://github.com/hamcrest/JavaHamcrest/pull/211 for
+ //the discussion about the support
+
+ sourceSets = [ project.sourceSets.main, project.sourceSets.test ]
+ ignoreFailures = false
+ configFile = file("${project.rootDir}/checkstyle.xml")
+
+ configurations {
+ checkstyle
}
+ dependencies{
+ assert project.hasProperty("checkstyleVersion")
+ checkstyle "com.puppycrawl.tools:checkstyle:${checkstyleVersion}"
+ }
}
+
test {
- java {
- srcDirs 'hamcrest-core/src/test/java', 'hamcrest-library/src/test/java'
+ testLogging {
+ exceptionFormat = 'full'
}
}
-}
-jar {
- manifest {
- attributes 'Implementation-Title': 'hamcrest-all',
- 'Implementation-Vendor': 'hamcrest.org',
- 'Implementation-Version': version
+ jar {
+ metaInf {
+ from rootProject.file('LICENSE')
+ }
}
-}
-task sourcesJar(type: Jar) {
- classifier = 'sources'
- from sourceSets.main.allSource
-}
+ task sourcesJar(type: Jar) {
+ archiveClassifier = 'sources'
+ from sourceSets.main.allSource
+ }
-task javadocJar(type: Jar) {
- classifier = 'javadoc'
- from javadoc
+ task javadocJar(type: Jar) {
+ archiveClassifier = 'javadoc'
+ from javadoc
+ }
}
-artifacts {
- archives sourcesJar, javadocJar
+allprojects {
+ tasks.withType(JavaCompile) {
+ options.compilerArgs << '-Xlint:-options'
+ }
}
-signing {
- required { gradle.taskGraph.hasTask("uploadArchives") }
- sign configurations.archives
-}
+def pomConfigurationFor(String pomName, String pomDescription) {
+ return {
+ name = pomName
+ description = pomDescription
+ url = 'http://hamcrest.org/JavaHamcrest/'
-uploadArchives {
- if (hasProperty('ossrhUsername') && hasProperty('ossrhPassword')) {
- repositories {
- mavenDeployer {
- beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
+ scm {
+ connection = 'scm:git:https://github.com/hamcrest/JavaHamcrest.git'
+ developerConnection = 'scm:git:ssh://github.com/hamcrest/JavaHamcrest.git'
+ url = 'https://github.com/hamcrest/JavaHamcrest'
+ }
- repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
- authentication(userName: ossrhUsername, password: ossrhPassword)
- }
+ licenses {
+ license {
+ name = 'BSD-3-Clause'
+ url = 'https://raw.githubusercontent.com/hamcrest/JavaHamcrest/master/LICENSE'
+ }
+ }
- snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
- authentication(userName: ossrhUsername, password: ossrhPassword)
- }
+ developers {
+ developer {
+ id = 'joewalnes'
+ name = 'Joe Walnes'
+ }
+ developer {
+ id = 'npryce'
+ name = 'Nat Pryce'
+ }
+ developer {
+ id = 'sf105'
+ name = 'Steve Freeman'
+ }
+ }
+ }
+}
+
+def publishToOssrh = project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')
+
+publishing {
+ publications {
+ def hamcrestProject = project(':hamcrest')
+ hamcrest(MavenPublication) {
+ from hamcrestProject.components.java
+ artifactId hamcrestProject.name
+ artifact hamcrestProject.sourcesJar
+ artifact hamcrestProject.javadocJar
+ pom pomConfigurationFor(
+ 'Hamcrest',
+ 'Core API and libraries of hamcrest matcher framework.')
+ }
- pom.project {
- name 'Java Hamcrest'
- packaging 'jar'
- description 'Hamcrest matcher library for Java'
- url 'http://hamcrest.org/JavaHamcrest/'
-
- scm {
- connection 'git@github.com:hamcrest/JavaHamcrest.git'
- url 'https://github.com/hamcrest/JavaHamcrest'
- }
-
- licenses {
- license {
- name 'BSD Licence 3'
- url 'http://opensource.org/licenses/BSD-3-Clause'
- }
- }
-
- developers {
- developer {
- id 'joewalnes'
- name 'Joe Walnes'
- }
- developer {
- id 'npryce'
- name 'Nat Pryce'
- }
- developer {
- id 'sf105'
- name 'Steve Freeman'
- }
- }
+ def hamcrestCoreProject = project(':hamcrest-core')
+ hamcrestCore(MavenPublication) {
+ from hamcrestCoreProject.components.java
+ artifactId hamcrestCoreProject.name
+ artifact hamcrestCoreProject.sourcesJar
+ artifact hamcrestCoreProject.javadocJar
+ pom pomConfigurationFor(
+ 'Hamcrest Core',
+ 'Core Hamcrest API - deprecated, please use "hamcrest" instead')
+ }
+
+ def hamcrestLibraryProject = project(':hamcrest-library')
+ hamcrestLibrary(MavenPublication) {
+ from hamcrestLibraryProject.components.java
+ artifactId hamcrestLibraryProject.name
+ artifact hamcrestLibraryProject.sourcesJar
+ artifact hamcrestLibraryProject.javadocJar
+ pom pomConfigurationFor(
+ 'Hamcrest Library',
+ 'A library of Hamcrest matchers - deprecated, please use "hamcrest" instead')
+ }
+ }
+ repositories {
+ if (publishToOssrh) {
+ maven {
+ def snapshotRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
+ def stagingRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
+ url = version.contains('SNAPSHOT') ? snapshotRepoUrl : stagingRepoUrl
+ credentials {
+ username = ossrhUsername
+ password = ossrhPassword
}
}
}
}
}
-task wrapper(type: Wrapper) {
- gradleVersion = '2.3'
+signing {
+ required { publishToOssrh }
+ sign publishing.publications.hamcrest
+ sign publishing.publications.hamcrestCore
+ sign publishing.publications.hamcrestLibrary
}
diff --git a/build.xml.original b/build.xml.original
deleted file mode 100644
index 95662ee07..000000000
--- a/build.xml.original
+++ /dev/null
@@ -1,289 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/checkstyle.xml b/checkstyle.xml
new file mode 100644
index 000000000..c1dbabf32
--- /dev/null
+++ b/checkstyle.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
diff --git a/docs/_config.yml b/docs/_config.yml
new file mode 100644
index 000000000..10e6731ad
--- /dev/null
+++ b/docs/_config.yml
@@ -0,0 +1 @@
+markdown: kramdown
diff --git a/docs/_includes/head.html b/docs/_includes/head.html
new file mode 100644
index 000000000..84c2c4f68
--- /dev/null
+++ b/docs/_includes/head.html
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+ {{ page.title }}
+
+
+
+
diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html
new file mode 100644
index 000000000..a3369dfd6
--- /dev/null
+++ b/docs/_layouts/default.html
@@ -0,0 +1,18 @@
+
+
+
+ {% include head.html %}
+
+
+
+ {{ content }}
+
+
+ Fork me on GitHub
+
+
diff --git a/docs/css/hamcrest.css b/docs/css/hamcrest.css
new file mode 100644
index 000000000..c456ed902
--- /dev/null
+++ b/docs/css/hamcrest.css
@@ -0,0 +1,44 @@
+@import url(https://fonts.googleapis.com/css?family=Cabin+Sketch);
+@import url(https://fonts.googleapis.com/css?family=Alegreya);
+body {
+ font-family: "Alegreya";
+ margin: 40px auto;
+ width: 700px;
+}
+.content {
+ position: relative;
+}
+footer {
+ padding: 2em 0 1em 0;
+ font-size: 12px;
+}
+h1 {
+ font-size: 80px;
+ margin-top: .3em;
+ margin-bottom: 0;
+}
+h1 + h2 {
+ margin-top: 0;
+}
+h2 {
+ font-weight: 400;
+ font-size: 20px;
+}
+h1, h2 {
+ font-family: "Cabin Sketch";
+ text-rendering: optimizeLegibility;
+}
+.content > p {
+ line-height: 1.5em;
+ text-rendering: optimizeLegibility;
+}
+.logo {
+ height: 60px;
+ padding-left: 0px;
+ padding-right: 40px;
+}
+pre.highlight {
+ border: 1px solid #ccc;
+ background-color: #eee;
+ padding: 0.5em;
+}
\ No newline at end of file
diff --git a/docs/css/pygments-default.css b/docs/css/pygments-default.css
new file mode 100644
index 000000000..8070f2fb6
--- /dev/null
+++ b/docs/css/pygments-default.css
@@ -0,0 +1,61 @@
+.highlight .hll { background-color: #ffffcc }
+.highlight .c { color: #408080; font-style: italic } /* Comment */
+.highlight .err { border: 1px solid #FF0000 } /* Error */
+.highlight .k { color: #008000; font-weight: bold } /* Keyword */
+.highlight .o { color: #666666 } /* Operator */
+.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */
+.highlight .cp { color: #BC7A00 } /* Comment.Preproc */
+.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */
+.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */
+.highlight .gd { color: #A00000 } /* Generic.Deleted */
+.highlight .ge { font-style: italic } /* Generic.Emph */
+.highlight .gr { color: #FF0000 } /* Generic.Error */
+.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.highlight .gi { color: #00A000 } /* Generic.Inserted */
+.highlight .go { color: #808080 } /* Generic.Output */
+.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
+.highlight .gs { font-weight: bold } /* Generic.Strong */
+.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.highlight .gt { color: #0040D0 } /* Generic.Traceback */
+.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
+.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
+.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
+.highlight .kp { color: #008000 } /* Keyword.Pseudo */
+.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #B00040 } /* Keyword.Type */
+.highlight .m { color: #666666 } /* Literal.Number */
+.highlight .s { color: #BA2121 } /* Literal.String */
+.highlight .na { color: #7D9029 } /* Name.Attribute */
+.highlight .nb { color: #008000 } /* Name.Builtin */
+.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */
+.highlight .no { color: #880000 } /* Name.Constant */
+.highlight .nd { color: #AA22FF } /* Name.Decorator */
+.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
+.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
+.highlight .nf { color: #0000FF } /* Name.Function */
+.highlight .nl { color: #A0A000 } /* Name.Label */
+.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
+.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
+.highlight .nv { color: #19177C } /* Name.Variable */
+.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
+.highlight .mf { color: #666666 } /* Literal.Number.Float */
+.highlight .mh { color: #666666 } /* Literal.Number.Hex */
+.highlight .mi { color: #666666 } /* Literal.Number.Integer */
+.highlight .mo { color: #666666 } /* Literal.Number.Oct */
+.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */
+.highlight .sc { color: #BA2121 } /* Literal.String.Char */
+.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
+.highlight .s2 { color: #BA2121 } /* Literal.String.Double */
+.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
+.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */
+.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
+.highlight .sx { color: #008000 } /* Literal.String.Other */
+.highlight .sr { color: #BB6688 } /* Literal.String.Regex */
+.highlight .s1 { color: #BA2121 } /* Literal.String.Single */
+.highlight .ss { color: #19177C } /* Literal.String.Symbol */
+.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
+.highlight .vc { color: #19177C } /* Name.Variable.Class */
+.highlight .vg { color: #19177C } /* Name.Variable.Global */
+.highlight .vi { color: #19177C } /* Name.Variable.Instance */
+.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
diff --git a/docs/distributables.md b/docs/distributables.md
new file mode 100644
index 000000000..daf06c2d4
--- /dev/null
+++ b/docs/distributables.md
@@ -0,0 +1,151 @@
+---
+title: Hamcrest Distributables
+layout: default
+---
+[Java Hamcrest Home](index)
+
+# Hamcrest Distributables
+{:.no_toc}
+
+## Introduction
+{:.no_toc}
+
+This document describes the current and previous versions of the various Hamcrest
+distributables, and the functionality contained in each of them.
+
+The latest version of Hamcrest consists of a single jar file which contains base
+classes and a library of useful matcher implementations. This is different from
+older versions.
+
+Older versions of Hamcrest consisted of a number of different jars matching the
+different needs of applications. The change in the jar packaging requires care
+when upgrading.
+
+## Table of Contents
+{:.no_toc}
+
+* TOC
+{:toc}
+
+## The Hamcrest Jar
+
+All the base classes and standard matcher implementations are contained in a
+single jar file called `hamcrest-3.0.jar`.
+
+### Using Hamcrest in a Gradle Project
+
+Add `"org.hamcrest:hamcrest:3.0"` to the dependencies section of your
+`build.gradle`, for example:
+
+```gradle
+apply plugin: 'java'
+
+dependencies {
+ testImplementation 'org.hamcrest:hamcrest:3.0'
+}
+```
+
+Note: older versions of Gradle use the `testCompile` configuration
+instead of the `testImplementation` configuration.
+
+### Using Hamcrest in a Maven Project
+
+Add the following to the `` section in your `pom.xml`:
+
+```xml
+
+ org.hamcrest
+ hamcrest
+ 3.0
+ test
+
+```
+
+### Download the Hamcrest Jar
+
+You can download the jars directly from Maven Central. You can find the jars by searching Maven Central for groupId `org.hamcrest`
+using the following link:
+
+> [https://search.maven.org/artifact/org.hamcrest/hamcrest](https://search.maven.org/artifact/org.hamcrest/hamcrest)
+
+## Previous Versions of Hamcrest
+
+Prior to version 2.x, Hamcrest was distributed through multiple jars, described
+below.
+
+* **`hamcrest-core.jar`**: This was the core API to be used by third-party framework
+providers. This includes a foundation set of matcher implementations for common
+operations. This library was used as a dependency for many third-party libraries,
+including JUnit 4.x. From Hamcrest version 2.x, all the classes in
+`hamcrest-core.jar` were moved into `hamcrest.jar`.
+* **`hamcrest-library.jar`**: The library of Matcher implementations which are based
+on the core functionality in hamcrest-core.jar. From Hamcrest version 2.x, all the
+classes in `hamcrest-core.jar` were moved into `hamcrest.jar`.
+* **`hamcrest-integration.jar`**: Provides integration between Hamcrest and other
+testing tools, such as jMock and EasyMock. It depends upon `hamcrest-core.jar` and
+`hamcrest-library.jar`. There are no new releases of this library since version 1.3.
+* **`hamcrest-generator.jar`**: A tool to allow many Matcher implementations to be
+combined into a single class with static methods returning the different matchers
+so users don't have to remember many classes/packages to import. Generates code.
+This library is only used internally at compile time. It is not necessary for the
+use of any of the other hamcrest libraries at runtime. There are no new releases of
+this library since version 1.3.
+* **`hamcrest-all.jar`**: One jar containing all classes of all the other jars.
+There are no new releases of this library since version 1.3. Please use the single
+`hamcrest.jar` instead.
+
+### Upgrading from Hamcrest 1.x
+
+Care must be taken when upgrading from Hamcrest 1.3 or earlier. Due to the change in
+packaging, the version conflict resolution that happens in dependency management
+tools won't happen automatically. A common example is projects that depend upon
+JUnit 4. JUnit 4 declares a transitive dependency upon `hamcrest-core-1.3.jar`.
+Because `hamcrest-core` is not the same artifact as `hamcrest`, it will not be
+upgraded.
+
+To address this issue, Hamcrest 2.1 and later also publish artifacts for
+`hamcrest-core` and `hamcrest-library`. Although these jars contain no classes,
+they trigger the version conflict upgrade in the dependency manager, and correctly
+declare transitive dependencies upon the new `hamcrest` packaging. Users can
+directly declare a dependency upon these shim jars to force the upgrade.
+
+#### Gradle Upgrade Example
+
+```gradle
+apply plugin: 'java'
+
+dependencies {
+ testImplementation 'org.hamcrest:hamcrest:3.0'
+ testImplementation 'org.hamcrest:hamcrest-library:3.0'
+ testImplementation 'junit:junit:4.13.2'
+}
+```
+
+#### Maven Upgrade Example
+
+**Warning**:
+Maven users should declare a dependency upon `hamcrest-library` **before** other
+dependencies, otherwise the older version will take precedence.
+
+```xml
+
+
+ org.hamcrest
+ hamcrest
+ 3.0
+ test
+
+
+ org.hamcrest
+ hamcrest-library
+ 3.0
+ test
+
+
+ junit
+ junit
+ 4.13.2
+ test
+
+
+```
diff --git a/doc/images/logo.jpg b/docs/images/logo.jpg
similarity index 100%
rename from doc/images/logo.jpg
rename to docs/images/logo.jpg
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 000000000..1af974b46
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,25 @@
+---
+title: Java Hamcrest
+layout: default
+---
+# {:.logo}Java Hamcrest
+
+## Matchers that can be combined to create flexible expressions of intent
+
+### Documentation
+
+* [Getting Started](tutorial)
+* [API Documentation (JavaDoc)](javadoc/)
+
+### Downloads
+
+* [Distributables and Dependency Configuration](distributables)
+* [Source Repository](http://github.com/hamcrest/JavaHamcrest)
+* [Project License](http://opensource.org/licenses/BSD-3-Clause)
+* [Extensions and Related Projects](related)
+
+### User Support
+
+* [Hamcrest Java Users Mailing List](https://groups.google.com/forum/?fromgroups#!forum/hamcrest-java)
+* [Hamcrest Developer Mailing List](https://groups.google.com/forum/?fromgroups#!forum/hamcrest-dev)
+* [Issue Tracker](https://github.com/hamcrest/JavaHamcrest/issues)
diff --git a/docs/javadoc/1.3/allclasses-frame.html b/docs/javadoc/1.3/allclasses-frame.html
new file mode 100644
index 000000000..63ba802ba
--- /dev/null
+++ b/docs/javadoc/1.3/allclasses-frame.html
@@ -0,0 +1,181 @@
+
+
+
+
+
+
+All Classes (Hamcrest)
+
+
+
+
+
+
+
+
+
+
+
+All Classes
+
+
+
+This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+Overview
+
+
+
+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.
+
+Package
+
+
+
+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:
+
Interfaces (italic)
Classes
Enums
Exceptions
Errors
Annotation Types
+
+
+Class/Interface
+
+
+
+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:
+
Class inheritance diagram
Direct Subclasses
All Known Subinterfaces
All Known Implementing Classes
Class/interface declaration
Class/interface description
+
+
Nested Class Summary
Field Summary
Constructor Summary
Method Summary
+
+
Field Detail
Constructor Detail
Method Detail
+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
+
+
+
+Each annotation type has its own separate page with the following sections:
+
Annotation Type declaration
Annotation Type description
Required Element Summary
Optional Element Summary
Element Detail
+
+
+
+Enum
+
+
+
+Each enum has its own separate page with the following sections:
+
Enum declaration
Enum description
Enum Constant Summary
Enum Constant Detail
+
+
+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.
+
When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+
+
+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.
+
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.
+
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.
+
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.
+
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.
+
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified list of matchers.
+
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified list of matchers.
+
Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
+
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.
+
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.
+
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.
+
Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
+
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.
+
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.
+
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.
+
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.
+
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
+
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.
+
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.
+
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.
+
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.
+
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
+
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.
+
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.
+
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.
+
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.
+
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.
+
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.
+
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.
+
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.
+
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.
+
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.
+
Creates a matcher of String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored.
+
Creates a matcher of String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored.
+
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.
+
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.
+
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.
+
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.
+
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.
+
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.
+
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.
+
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
+
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified keyand whose value equals the
+ specified value.
+
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified keyand whose value equals the
+ specified value.
+
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
+
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.
+
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.
+
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.
+
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.
+
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.
+
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.
+
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.
+
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.
+
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.
+
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.
+
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.
+
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.
+
Creates a matcher that matches when the examined object has a JavaBean property
+ with the specified name whose value satisfies the specified matcher.
+
Creates a matcher that matches when the examined object has a JavaBean property
+ with the specified name whose value satisfies the specified matcher.
+
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.
+
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.
+
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.
+
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.
+
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.
+
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.
+
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.
+
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
+
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.
+
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
+
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.
+
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.
+
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.
+
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.
+
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.
+
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.
+
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.
+
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, regardless of the order of their appearance.
+
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, regardless of the order of their appearance.
+
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.
appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ T... values)
+
+
+ Appends a list of values to the description.
Append the String str to the description.
+ The default implementation passes every character to append(char).
+ Override in subclasses to provide an efficient implementation.
+
This method simply acts a friendly reminder not to implement Matcher directly and
+ instead extend BaseMatcher. It's easy to ignore JavaDoc, but a bit harder to ignore
+ compile errors .
+
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
+
+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
+
allOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ALL of the specified 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.
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.
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.
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.
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.
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.
anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
anyOf(Matcher<T> first,
+ Matcher<? super T> second)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified 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.
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.
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.
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.
anything(java.lang.String description)
+
+
+ Creates a matcher that always matches, regardless of the examined object, but describes
+ itself with the specified String.
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.
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.
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.
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.
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.
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.
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.
Wraps an existing matcher, overriding its description with that specified. All other functions are
+ delegated to the decorated matcher, including its mismatch description.
+
+ For example:
+
describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())
+
+
+
Parameters:
description - the new description for the wrapped matcher
matcher - the matcher to wrap
values - optional values to insert into the tokenised description
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.
+
+ For example:
+
Creates a matcher that always matches, regardless of the examined object, but describes
+ itself with the specified String.
+
+
+
Parameters:
description - a meaningful String used when describing itself
+
+
+
+
+
+hasItem
+
+public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+
+ For example:
+
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)
+
+
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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+
+ For example:
+
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. Whilst matching, each traversal of the
+ examined Iterable will stop as soon as a matching item is found.
+
+ For example:
+
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)
+
+
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. Whilst matching, each traversal of
+ the examined Iterable will stop as soon as a matching item is found.
+
+ For example:
+
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.
+
+
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.
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.
+
+
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))
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.
+
+
The created matcher assumes no relationship between specified type and the examined object.
+Utility class for writing one off matchers.
+ For example:
+
+ Matcher<String> aNonEmptyString = new CustomMatcher<String>("a non empty string") {
+ public boolean matches(Object object) {
+ return ((object instanceof String) && !((String) object).isEmpty();
+ }
+ };
+
+
+ This class is designed for scenarios where an anonymous inner class
+ matcher makes sense. It should not be used by API designers implementing
+ matchers.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
+Utility class for writing one off matchers.
+ For example:
+
+ 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.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
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.
appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ T... values)
+
+
+ Appends a list of values to the 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.
appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ T... values)
+
+
+ Appends a list of values to the description.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
+
Parameters:
item - the object against which the matcher is evaluated.
+
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
+A matcher over acceptable values.
+ A matcher is able to describe itself to give feedback when it fails.
+
+ Matcher implementations should NOT directly implement this interface.
+ Instead, extend the 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.
+
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
+
+
+
+
Parameters:
item - the object against which the matcher is evaluated.
+
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
+
+
+
+
+
+
Parameters:
item - The item that the Matcher has rejected.
mismatchDescription - The description to be built or appended to.
This method simply acts a friendly reminder not to implement Matcher directly and
+ instead extend BaseMatcher. It's easy to ignore JavaDoc, but a bit harder to ignore
+ compile errors .
+
allOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ALL of the specified 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.
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.
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.
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.
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.
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.
anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
anyOf(Matcher<T> first,
+ Matcher<? super T> second)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified 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.
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.
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.
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.
anything(java.lang.String description)
+
+
+ Creates a matcher that always matches, regardless of the examined object, but describes
+ itself with the specified String.
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.
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.
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.
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.
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.
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.
arrayWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
+
+
+ Creates a matcher for arrays that matches when the length of the array
+ satisfies the specified matcher.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
equalToIgnoringCase(java.lang.String expectedString)
+
+
+ Creates a matcher of String that matches when the examined string is equal to
+ the specified expectedString, ignoring case.
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.
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.
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.
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.
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.
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 keyand whose value equals the
+ specified value.
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 keyMatcherand whose
+ value satisfies the specified valueMatcher.
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.
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.
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.
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.
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.
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.
hasProperty(java.lang.String propertyName)
+
+
+ Creates a matcher that matches when the examined object has a JavaBean property
+ with the specified name.
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.
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.
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.
hasToString(java.lang.String expectedToString)
+
+
+ Creates a matcher that matches any examined object whose toString method
+ returns a value equalTo the specified string.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
typeCompatibleWith(java.lang.Class<T> baseType)
+
+
+ Creates a matcher of Class that matches when the specified baseType is
+ assignable from the examined class.
Wraps an existing matcher, overriding its description with that specified. All other functions are
+ delegated to the decorated matcher, including its mismatch description.
+
+ For example:
+
describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())
+
+
+
Parameters:
description - the new description for the wrapped matcher
matcher - the matcher to wrap
values - optional values to insert into the tokenised description
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.
+
+ For example:
+
Creates a matcher that always matches, regardless of the examined object, but describes
+ itself with the specified String.
+
+
+
Parameters:
description - a meaningful String used when describing itself
+
+
+
+
+
+hasItem
+
+public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+
+ For example:
+
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)
+
+
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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+
+ For example:
+
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. Whilst matching, each traversal of the
+ examined Iterable will stop as soon as a matching item is found.
+
+ For example:
+
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)
+
+
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. Whilst matching, each traversal of
+ the examined Iterable will stop as soon as a matching item is found.
+
+ For example:
+
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.
+
+
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.
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.
+
+
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))
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.
+
+
The created matcher assumes no relationship between specified type and the examined object.
Creates a matcher that matches if the examined String ends with the specified
+ String.
+
+ For example:
+
assertThat("myStringOfNote", endsWith("Note"))
+
+
+
Parameters:
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)
+
+
Creates a matcher that matches arrays whose elements are satisfied by the specified matchers. Matches
+ positively only if the number of matchers specified is equal to the length of the examined array and
+ each matcher[i] is satisfied by array[i].
+
+ For example:
+
A shortcut to the frequently used hasItemInArray(equalTo(x)).
+
+ For example:
+
assertThat(hasItemInArray(x))
+ instead of:
+
assertThat(hasItemInArray(equalTo(x)))
+
+
+
Parameters:
element - the element that should be present in examined arrays
+
+
+
+
+
+hasItemInArray
+
+public 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. Whilst matching, the traversal
+ of the examined array will stop as soon as a matching element is found.
+
+ For example:
+
elementMatcher - the matcher to apply to elements in examined arrays
+
+
+
+
+
+arrayContaining
+
+public 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. For a positive match, the examined array
+ must be of the same length as the specified list of matchers.
+
+ For example:
+
Creates a matcher for arrays that matcheswhen each item in the examined array is
+ logically equal to the corresponding item in the specified items. For a positive match,
+ the examined array must be of the same length as the number of specified items.
+
+ For example:
+
items - the items that must equal the items within an examined array
+
+
+
+
+
+arrayContaining
+
+public 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. For a positive match, the examined array
+ must be of the same length as the number of specified matchers.
+
+ For example:
+
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.
+ For a positive match, the examined array 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
+ array.
+
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)
+
+
Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
+ For a positive match, the examined array 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
+ array.
+
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)
+
+
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.
+ For a positive match, the examined array 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 array.
+
+public 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. For a positive match, the examined iterable
+ must be of the same length as the number of specified matchers.
+
+ For example:
+
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. For a positive match, the examined iterable
+ must be of the same length as the number of specified items.
+
+ For example:
+
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)
+
+
Creates a matcher for 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:
+
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)
+
+
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. For a positive match, the examined iterable
+ must be of the same length as the specified list of matchers.
+
+ For example:
+
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. 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:
+
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)
+
+
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. 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:
+
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)
+
+
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. 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:
+
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)
+
+
Deprecated.use contains(Matcher super E> itemMatcher) instead
+
+
Creates a matcher for 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:
+
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)
+
+
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
+
+ For example:
+
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.
+
+ For example:
+
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified keyand whose value equals the
+ specified value.
+
+ For example:
+
assertThat(myMap, hasEntry("bar", "foo"))
+
+
+
Parameters:
key - the key that, in combination with the value, must be describe at least one entry
value - 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)
+
+
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
+
+ For example:
+
Creates a matcher of 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"))))
+
+
+
Parameters:
operand - the expected value of matching BigDecimals
error - the delta (+/-) within which matches will be allowed
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.
+
+ For example:
+
assertThat(1, comparesEqualTo(1))
+
+
+
Parameters:
value - the value which, when passed to the compareTo method of the examined object, should return zero
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.
+
+ For example:
+
assertThat(2, greaterThan(1))
+
+
+
Parameters:
value - the value which, when passed to the compareTo method of the examined object, should return greater
+ than zero
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.
+
+ For example:
+
assertThat(1, greaterThanOrEqualTo(1))
+
+
+
Parameters:
value - the value which, when passed to the compareTo method of the examined object, should return greater
+ than or equal to zero
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.
+
+ For example:
+
assertThat(1, lessThan(2))
+
+
+
Parameters:
value - the value which, when passed to the compareTo method of the examined object, should return less
+ than zero
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.
+
+ For example:
+
assertThat(1, lessThanOrEqualTo(1))
+
+
+
Parameters:
value - the value which, when passed to the compareTo method of the examined object, should return less
+ than or equal to zero
Creates a matcher of 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:
+
+
all leading and trailing whitespace of both the expectedString and the examined string are ignored
+
any remaining whitespace, appearing within either string, is collapsed to a single space before comparison
+
+
+ For example:
+
assertThat(" my\tfoo bar ", equalToIgnoringWhiteSpace(" my foo bar"))
+
+
+
Parameters:
expectedString - the expected value of matched strings
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, regardless of the order of their appearance.
+
+ For example:
+
Creates a matcher that matches when the examined object has a JavaBean property
+ with the specified name whose value satisfies the specified matcher.
+
+ For example:
+
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.
+
+ For example:
+
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.
+
+ For example:
+
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.
+
+ For example:
+
Creates a matcher of Nodes that matches when the examined node has a value at the
+ specified xPath that satisfies the specified valueMatcher.
+
+ For example:
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
Append the String str to the description.
+ The default implementation passes every character to BaseDescription.append(char).
+ Override in subclasses to provide an efficient implementation.
+
+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
TypeSafeDiagnosingMatcher(java.lang.Class<?> expectedType)
+
+
+ Use this constructor if the subclass that implements matchesSafely
+ is not the class that binds <T> to a type.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
+
Parameters:
item - the object against which the matcher is evaluated.
+
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
+
+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.
+
+
+
+
+
Author:
+
Joe Walnes, Steve Freeman, Nat Pryce
+
+
+
+
+
+
+
+
+
+
+
+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.
Subclasses should override this. The item will already have been checked for
+ the specific type and will never be null.
+
+
+
+
+
+
+
+
+matches
+
+public final boolean matches(java.lang.Object item)
+
+
Methods made final to prevent accidental override.
+ If you need to override this, there's no point on extending TypeSafeMatcher.
+ Instead, extend the BaseMatcher.
+
+
+
Parameters:
item - the object against which the matcher is evaluated.
+
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
+
+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.
+
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
+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.
+
+
Example Usage
+ Consider the situation where we have a class representing a person, which
+ follows the basic JavaBean convention of having get() and possibly set()
+ methods for it's 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:
+
+
+ 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
+
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
Creates a matcher that matches when the examined object has a JavaBean property
+ with the specified name whose value satisfies the specified matcher.
+
+ For example:
+
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
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
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.
+
+ For example:
+
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.
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.appendValueList(java.lang.String start,
+ java.lang.String separator,
+ java.lang.String end,
+ T... values)
+
+
+ Appends a list of values to the description.
Matcher.describeMismatch(java.lang.Object item,
+ Description mismatchDescription)
+
+
+ Generate a description of why the matcher has not accepted the item.
HasProperty.hasProperty(java.lang.String propertyName)
+
+
+ Creates a matcher that matches when the examined object has a JavaBean property
+ with the specified name.
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.
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.
IsArray.array(Matcher<? super T>... elementMatchers)
+
+
+ Creates a matcher that matches arrays whose elements are satisfied by the specified matchers.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 keyand whose value equals the
+ specified value.
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 keyMatcherand whose
+ value satisfies the specified valueMatcher.
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.
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.
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.
IsCollectionWithSize.hasSize(int size)
+
+
+ Creates a matcher for Collections that matches when the size() method returns
+ a value equal to the specified size.
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.
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.
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.
IsIn.isIn(java.util.Collection<T> collection)
+
+
+ Creates a matcher that matches when the examined object is found within the
+ specified collection.
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.
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.
AllOf.allOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ALL of the specified matchers.
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.
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.
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.
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.
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.
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.
AnyOf.anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
AnyOf.anyOf(Matcher<T> first,
+ Matcher<? super T> second)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
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.
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.
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.
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.
IsAnything.anything(java.lang.String description)
+
+
+ Creates a matcher that always matches, regardless of the examined object, but describes
+ itself with the specified String.
CombinableMatcher.both(Matcher<? super LHS> matcher)
+
+
+ Creates a matcher that matches when both of the specified matchers match the examined object.
StringContains.containsString(java.lang.String substring)
+
+
+ Creates a matcher that matches if the examined String contains the specified
+ String anywhere.
CombinableMatcher.either(Matcher<? super LHS> matcher)
+
+
+ Creates a matcher that matches when either of the specified matchers match the examined object.
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.
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.
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.
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.
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.
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.
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.
IsSame.sameInstance(T target)
+
+
+ Creates a matcher that matches only when the examined object is the same instance as
+ the specified target object.
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.
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.
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.
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.
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.
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.
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.
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.
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.
HasToString.hasToString(java.lang.String expectedToString)
+
+
+ Creates a matcher that matches any examined object whose toString method
+ returns a value equalTo the specified string.
IsCompatibleType.typeCompatibleWith(java.lang.Class<T> baseType)
+
+
+ Creates a matcher of Class that matches when the specified baseType is
+ assignable from the examined class.
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.
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.
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.
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.
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.
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.
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.
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.
Matchers.allOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ALL of the specified matchers.
CoreMatchers.allOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ALL of the specified matchers.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Matchers.anything(java.lang.String description)
+
+
+ Creates a matcher that always matches, regardless of the examined object, but describes
+ itself with the specified String.
CoreMatchers.anything(java.lang.String description)
+
+
+ Creates a matcher that always matches, regardless of the examined object, but describes
+ itself with the specified String.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Matchers.containsString(java.lang.String substring)
+
+
+ Creates a matcher that matches if the examined String contains the specified
+ String anywhere.
CoreMatchers.containsString(java.lang.String substring)
+
+
+ Creates a matcher that matches if the examined String contains the specified
+ String anywhere.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 keyand whose value equals the
+ specified value.
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 keyMatcherand whose
+ value satisfies the specified valueMatcher.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Matchers.hasProperty(java.lang.String propertyName)
+
+
+ Creates a matcher that matches when the examined object has a JavaBean property
+ with the specified name.
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.
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.
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.
Matchers.hasToString(java.lang.String expectedToString)
+
+
+ Creates a matcher that matches any examined object whose toString method
+ returns a value equalTo the specified string.
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.
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.
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.
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.
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.
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.
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.
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.
Matchers.isIn(java.util.Collection<T> collection)
+
+
+ Creates a matcher that matches when the examined object is found within the
+ specified collection.
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.
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.
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.
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.
Matchers.sameInstance(T target)
+
+
+ Creates a matcher that matches only when the examined object is the same instance as
+ the specified target object.
CoreMatchers.sameInstance(T target)
+
+
+ Creates a matcher that matches only when the examined object is the same instance as
+ the specified target object.
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.
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.
Matchers.theInstance(T target)
+
+
+ Creates a matcher that matches only when the examined object is the same instance as
+ the specified target object.
CoreMatchers.theInstance(T target)
+
+
+ Creates a matcher that matches only when the examined object is the same instance as
+ the specified target object.
Matchers.typeCompatibleWith(java.lang.Class<T> baseType)
+
+
+ Creates a matcher of Class that matches when the specified baseType is
+ assignable from the examined class.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Matchers.anyOf(Matcher<T> first,
+ Matcher<? super T> second)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
Matchers.anyOf(Matcher<T> first,
+ Matcher<? super T> second)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
CoreMatchers.anyOf(Matcher<T> first,
+ Matcher<? super T> second)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
CoreMatchers.anyOf(Matcher<T> first,
+ Matcher<? super T> second)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Matchers.array(Matcher<? super T>... elementMatchers)
+
+
+ Creates a matcher that matches arrays whose elements are satisfied by the specified matchers.
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.
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.
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
+
+
+
+<T> void
+
+
+
+
MatcherAssert.assertThat(java.lang.String reason,
+ T actual,
+ Matcher<? super T> matcher)
+
+
+
+
+
+
+static
+
+
+
+<T> void
+
+
+
+
MatcherAssert.assertThat(T actual,
+ Matcher<? super T> matcher)
+
+
+
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.
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.
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.
CoreMatchers.either(Matcher<? super LHS> matcher)
+
+
+ Creates a matcher that matches when either of the specified matchers match the examined object.
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.
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.
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 keyMatcherand whose
+ value satisfies the specified valueMatcher.
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 keyMatcherand whose
+ value satisfies the specified valueMatcher.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Matchers.allOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ALL of the specified matchers.
CoreMatchers.allOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ALL of the specified matchers.
Matchers.anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
CoreMatchers.anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
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.
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.
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.
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.
HasProperty.hasProperty(java.lang.String propertyName)
+
+
+ Creates a matcher that matches when the examined object has a JavaBean property
+ with the specified name.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 keyand whose value equals the
+ specified value.
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 keyMatcherand whose
+ value satisfies the specified valueMatcher.
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.
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.
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.
IsCollectionWithSize.hasSize(int size)
+
+
+ Creates a matcher for Collections that matches when the size() method returns
+ a value equal to the specified size.
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.
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.
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.
IsIn.isIn(java.util.Collection<T> collection)
+
+
+ Creates a matcher that matches when the examined object is found within the
+ specified collection.
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.
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.
IsArray.array(Matcher<? super T>... elementMatchers)
+
+
+ Creates a matcher that matches arrays whose elements are satisfied by the specified matchers.
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.
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.
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.
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.
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.
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.
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 keyMatcherand whose
+ value satisfies the specified valueMatcher.
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 keyMatcherand whose
+ value satisfies the specified valueMatcher.
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.
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.
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.
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.
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.
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.
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.
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.
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.
AllOf.allOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ALL of the specified matchers.
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.
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.
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.
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.
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.
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.
IsAnything.anything(java.lang.String description)
+
+
+ Creates a matcher that always matches, regardless of the examined object, but describes
+ itself with the specified String.
StringContains.containsString(java.lang.String substring)
+
+
+ Creates a matcher that matches if the examined String contains the specified
+ String anywhere.
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.
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.
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.
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.
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.
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.
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.
IsSame.sameInstance(T target)
+
+
+ Creates a matcher that matches only when the examined object is the same instance as
+ the specified target object.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
AnyOf.anyOf(Matcher<T> first,
+ Matcher<? super T> second)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
AnyOf.anyOf(Matcher<T> first,
+ Matcher<? super T> second)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
CombinableMatcher.both(Matcher<? super LHS> matcher)
+
+
+ Creates a matcher that matches when both of the specified matchers match the examined object.
CombinableMatcher.either(Matcher<? super LHS> matcher)
+
+
+ Creates a matcher that matches when either of the specified matchers match the examined object.
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.
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.
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.
AllOf.allOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ALL of the specified matchers.
AnyOf.anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
HasToString.hasToString(java.lang.String expectedToString)
+
+
+ Creates a matcher that matches any examined object whose toString method
+ returns a value equalTo the specified string.
IsCompatibleType.typeCompatibleWith(java.lang.Class<T> baseType)
+
+
+ Creates a matcher of Class that matches when the specified baseType is
+ assignable from the examined class.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
+
+
+
+
+
+descriptionStart
+
+protected java.lang.String descriptionStart()
+
+
Returns the string that starts the description.
+
+ Can be overridden in subclasses to customise how the matcher is
+ described.
+
Returns the string that separates the elements in the description.
+
+ Can be overridden in subclasses to customise how the matcher is
+ described.
+
+
+
+
+
+
+
+
+descriptionEnd
+
+protected java.lang.String descriptionEnd()
+
+
Returns the string that ends the description.
+
+ Can be overridden in subclasses to customise how the matcher is
+ described.
+
+
+
+
+
+
+
+
+array
+
+public static <T> IsArray<T> array(Matcher<? super T>... elementMatchers)
+
+
Creates a matcher that matches arrays whose elements are satisfied by the specified matchers. Matches
+ positively only if the number of matchers specified is equal to the length of the examined array and
+ each matcher[i] is satisfied by array[i].
+
+ For example:
+
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
+
+
+
+
+
+hasItemInArray
+
+public 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. Whilst matching, the traversal
+ of the examined array will stop as soon as a matching element is found.
+
+ For example:
+
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.
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
+
+
+
+
+
+arrayContainingInAnyOrder
+
+public 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.
+ For a positive match, the examined array 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
+ array.
+
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)
+
+
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.
+ For a positive match, the examined array 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 array.
+
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.
+ For a positive match, the examined array 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
+ array.
+
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.
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
Creates a matcher for arrays that matcheswhen each item in the examined array is
+ logically equal to the corresponding item in the specified items. For a positive match,
+ the examined array must be of the same length as the number of specified items.
+
+ For example:
+
items - the items that must equal the items within an examined array
+
+
+
+
+
+arrayContaining
+
+public 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. For a positive match, the examined array
+ must be of the same length as the number of specified matchers.
+
+ For example:
+
itemMatchers - the matchers that must be satisfied by the items in the examined array
+
+
+
+
+
+arrayContaining
+
+public 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. For a positive match, the examined array
+ must be of the same length as the specified list of matchers.
+
+ For example:
+
arrayWithSize(Matcher<? super java.lang.Integer> sizeMatcher)
+
+
+ Creates a matcher for arrays that matches when the length of the array
+ satisfies the specified matcher.
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
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
+
Parameters:
o - the object against which the matcher is evaluated.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
buffer - The description to be built or appended to.
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.
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
Deprecated.use contains(Matcher super E> itemMatcher) instead
+
+
Creates a matcher for 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:
+
itemMatcher - the matcher that must be satisfied by the single item provided by an
+ examined Iterable
+
+
+
+
+
+containsInAnyOrder
+
+public 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. 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:
+
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. 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:
+
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)
+
+
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. 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:
+
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.
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.
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
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. For a positive match, the examined iterable
+ must be of the same length as the number of specified items.
+
+ For example:
+
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)
+
+
Creates a matcher for 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:
+
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(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. For a positive match, the examined iterable
+ must be of the same length as the number of specified matchers.
+
+ For example:
+
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(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. For a positive match, the examined iterable
+ must be of the same length as the specified list of matchers.
+
+ For example:
+
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.
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
+public 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.
+
+ For example:
+
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.
+
+ For example:
+
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 keyand whose value equals the
+ specified value.
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 keyMatcherand whose
+ value satisfies the specified valueMatcher.
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
+
+
+
+
+
+hasEntry
+
+public 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 keyMatcherand whose
+ value satisfies the specified valueMatcher.
+
+ For example:
+
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified keyand whose value equals the
+ specified value.
+
+ For example:
+
assertThat(myMap, hasEntry("bar", "foo"))
+
+
+
Parameters:
key - the key that, in combination with the value, must be describe at least one entry
value - the value that, in combination with the key, must be describe at least one entry
+
+
+
+
+
+hasKey
+
+public 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.
+
+ For example:
+
assertThat(myMap, hasKey(equalTo("bar")))
+
+
+
Parameters:
keyMatcher - the matcher that must be satisfied by at least one key
Matchers.array(Matcher<? super T>... elementMatchers)
+
+
+ Creates a matcher that matches arrays whose elements are satisfied by the specified matchers.
IsArray.array(Matcher<? super T>... elementMatchers)
+
+
+ Creates a matcher that matches arrays whose elements are satisfied by the specified matchers.
+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)
+
+
+
allOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ALL of the specified 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.
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.
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.
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
+
+
+
+
+
+allOf
+
+public 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.
+
+ For example:
+
+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)
+
+
+
anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
anyOf(Matcher<T> first,
+ Matcher<? super T> second)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified 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.
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.
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.
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.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
+
Parameters:
o - the object against which the matcher is evaluated.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
+
Wraps an existing matcher, overriding its description with that specified. All other functions are
+ delegated to the decorated matcher, including its mismatch description.
+
+ For example:
+
describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())
+
+
+
Parameters:
description - the new description for the wrapped matcher
matcher - the matcher to wrap
values - optional values to insert into the tokenised description
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
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.
+
+ For example:
+
+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)))
+
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
+
Parameters:
arg - the object against which the matcher is evaluated.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
+
anything(java.lang.String description)
+
+
+ Creates a matcher that always matches, regardless of the examined object, but describes
+ itself with the specified String.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
+
Parameters:
o - the object against which the matcher is evaluated.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
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.
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.
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
+
+
+
+
+
+hasItem
+
+public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+
+ For example:
+
itemMatcher - the matcher to apply to items provided by the examined Iterable
+
+
+
+
+
+hasItem
+
+public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+
+ For example:
+
item - the item to compare against the items provided by the examined Iterable
+
+
+
+
+
+hasItems
+
+public 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. Whilst matching, each traversal of
+ the examined Iterable will stop as soon as a matching item is found.
+
+ For example:
+
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. Whilst matching, each traversal of the
+ examined Iterable will stop as soon as a matching item is found.
+
+ For example:
+
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
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
+
Parameters:
actualValue - the object against which the matcher is evaluated.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
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.
+
+
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.
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
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.
+
+
The created matcher assumes no relationship between specified type and the examined object.
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.
+
+
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))
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
+
Parameters:
arg - the object against which the matcher is evaluated.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
+
Parameters:
o - the object against which the matcher is evaluated.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
+
Parameters:
arg - the object against which the matcher is evaluated.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
Matchers.anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
CoreMatchers.anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
Matchers.anyOf(Matcher<T> first,
+ Matcher<? super T> second)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
CoreMatchers.anyOf(Matcher<T> first,
+ Matcher<? super T> second)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
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.
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.
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.
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.
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.
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.
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.
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.
AnyOf.anyOf(java.lang.Iterable<Matcher<? super T>> matchers)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
AnyOf.anyOf(Matcher<T> first,
+ Matcher<? super T> second)
+
+
+ Creates a matcher that matches if the examined object matches ANY of the specified matchers.
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.
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.
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.
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.
CombinableMatcher.both(Matcher<? super LHS> matcher)
+
+
+ Creates a matcher that matches when both of the specified matchers match the examined object.
CoreMatchers.either(Matcher<? super LHS> matcher)
+
+
+ Creates a matcher that matches when either of the specified matchers match the examined object.
CombinableMatcher.either(Matcher<? super LHS> matcher)
+
+
+ Creates a matcher that matches when either of the specified matchers match the examined object.
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.
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.
+
+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.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
TypeSafeMatcher(ReflectiveTypeFinder typeFinder)
+
+
+ Use this constructor if the subclass that implements matchesSafely
+ is not the class that binds <T> to a type.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
Creates a matcher of 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"))))
+
+
+
Parameters:
operand - the expected value of matching BigDecimals
error - the delta (+/-) within which matches will be allowed
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
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.
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.
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.
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
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.
+
+ For example:
+
assertThat(1, comparesEqualTo(1))
+
+
+
Parameters:
value - the value which, when passed to the compareTo method of the examined object, should return zero
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.
+
+ For example:
+
assertThat(2, greaterThan(1))
+
+
+
Parameters:
value - the value which, when passed to the compareTo method of the examined object, should return greater
+ than zero
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.
+
+ For example:
+
assertThat(1, greaterThanOrEqualTo(1))
+
+
+
Parameters:
value - the value which, when passed to the compareTo method of the examined object, should return greater
+ than or equal to zero
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.
+
+ For example:
+
assertThat(1, lessThan(2))
+
+
+
Parameters:
value - the value which, when passed to the compareTo method of the examined object, should return less
+ than zero
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.
+
+ For example:
+
assertThat(1, lessThanOrEqualTo(1))
+
+
+
Parameters:
value - the value which, when passed to the compareTo method of the examined object, should return less
+ than or equal to zero
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.
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
typeCompatibleWith(java.lang.Class<T> baseType)
+
+
+ Creates a matcher of Class that matches when the specified baseType is
+ assignable from the examined class.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
Marks a Hamcrest static factory method so tools recognise them.
+
+
+
+
+
+
+Package org.hamcrest Description
+
+
+
+
The stable API defining Matcher and its associated interfaces and classes.
+ Hamcrest sub-projects define their convenience classes in the org.hamcrest package.
+
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.
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.
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.
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.
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.
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.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
+
Parameters:
item - the object against which the matcher is evaluated.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
Creates a matcher of 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:
+
+
all leading and trailing whitespace of both the expectedString and the examined string are ignored
+
any remaining whitespace, appearing within either string, is collapsed to a single space before comparison
+
+
+ For example:
+
assertThat(" my\tfoo bar ", equalToIgnoringWhiteSpace(" my foo bar"))
+
+
+
Parameters:
expectedString - the expected value of matched strings
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, regardless of the order of their appearance.
+
+ For example:
+
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.
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.
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
+
Parameters:
description - The description to be built or appended to.
Creates a matcher of Nodes that matches when the examined node has a value at the
+ specified xPath that satisfies the specified valueMatcher.
+
+ For example:
+
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.
+
+ For example:
+
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.
+
+ For example:
+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
+
+
Overview
+
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.
+
+
+
Package
+
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
+
+
Interfaces (italic)
+
Classes
+
Enums
+
Exceptions
+
Errors
+
Annotation Types
+
+
+
+
Class/Interface
+
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:
+
+
Class inheritance diagram
+
Direct Subclasses
+
All Known Subinterfaces
+
All Known Implementing Classes
+
Class/interface declaration
+
Class/interface description
+
+
+
Nested Class Summary
+
Field Summary
+
Constructor Summary
+
Method Summary
+
+
+
Field Detail
+
Constructor Detail
+
Method Detail
+
+
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
+
Each annotation type has its own separate page with the following sections:
+
+
Annotation Type declaration
+
Annotation Type description
+
Required Element Summary
+
Optional Element Summary
+
Element Detail
+
+
+
+
Enum
+
Each enum has its own separate page with the following sections:
+
+
Enum declaration
+
Enum description
+
Enum Constant Summary
+
Enum Constant Detail
+
+
+
+
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.
+
+
When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
+
When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+
+
+
+
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.
+
+
+
All Classes
+
The All Classes link shows all classes and interfaces except non-static nested types.
+
+
+
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.
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.
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.
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.
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified list of matchers.
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified list of matchers.
+ Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
+ 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.
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.
+ Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
+ 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.
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.
Creates a matcher of T object that matches when the examined object is
+ equal to the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
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.
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.
+ 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.
+ 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.
+ 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.
+ 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.
+ 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.
+ 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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
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.
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.
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.
Creates a matcher of String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored.
Creates a matcher of String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored.
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.
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.
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.
Creates a matcher of T object that matches when the examined object is
+ greater than the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
Creates a matcher of T object that matches when the examined object is
+ greater than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified keyand whose value equals the
+ specified value.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified keyand whose value equals the
+ specified value.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
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.
Creates a matcher of T object that matches when the examined object is
+ less than the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
Creates a matcher of T object that matches when the examined object is
+ less than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
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.
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.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to Non-frame version.
Append the String str to the description.
+ The default implementation passes every character to append(char).
+ Override in subclasses to provide an efficient implementation.
This method simply acts a friendly reminder not to implement Matcher directly and
+ instead extend BaseMatcher. It's easy to ignore JavaDoc, but a bit harder to ignore
+ compile errors .
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
public abstract class Condition<T>
+extends java.lang.Object
+
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
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.
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.
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.
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.
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.
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.
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.
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.
Wraps an existing matcher, overriding its description with that specified. All other functions are
+ delegated to the decorated matcher, including its mismatch description.
+ For example:
+
describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())
+
+
Parameters:
+
description - the new description for the wrapped matcher
+
matcher - the matcher to wrap
+
values - optional values to insert into the tokenised description
public static <U> Matcher<java.lang.Iterable<? extends 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.
+ For example:
+
public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
@SafeVarargs
+public 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. Whilst matching, each traversal of
+ the examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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. Whilst matching, each traversal of the
+ examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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.
+
+
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.
public 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.
+
+
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))
public 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.
+
+
The created matcher assumes no relationship between specified type and the examined object.
public abstract class CustomMatcher<T>
+extends BaseMatcher<T>
+
Utility class for writing one off matchers.
+ For example:
+
+ Matcher<String> aNonEmptyString = new CustomMatcher<String>("a non empty string") {
+ public boolean matches(Object object) {
+ return ((object instanceof String) && !((String) object).isEmpty();
+ }
+ };
+
+
+ This class is designed for scenarios where an anonymous inner class
+ matcher makes sense. It should not be used by API designers implementing
+ matchers.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public abstract class CustomTypeSafeMatcher<T>
+extends TypeSafeMatcher<T>
+
Utility class for writing one off matchers.
+ For example:
+
+ 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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
item - the object against which the matcher is evaluated.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
+ A matcher over acceptable values.
+ A matcher is able to describe itself to give feedback when it fails.
+
+
+ Matcher implementations should NOT directly implement this interface.
+ Instead, extend the BaseMatcher abstract class,
+ which will ensure that the Matcher API can grow to support
+ new features and remain compatible with all Matcher implementations.
+
+
+ N.B. Well designed matchers should be immutable.
+
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
item - the object against which the matcher is evaluated.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
+
+
Parameters:
+
item - The item that the Matcher has rejected.
+
mismatchDescription - The description to be built or appended to.
This method simply acts a friendly reminder not to implement Matcher directly and
+ instead extend BaseMatcher. It's easy to ignore JavaDoc, but a bit harder to ignore
+ compile errors .
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.
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified list of matchers.
+ 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.
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.
+ Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
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.
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
+ 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.
+ 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.
+ 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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
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.
Creates a matcher of String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored.
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.
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.
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.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified keyand whose value equals the
+ specified value.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
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.
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.
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.
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.
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.
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
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.
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.
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.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
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)
+
Creates a matcher that matches if the examined object matches ALL of the specified matchers.
+ For example:
+
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)
+
Creates a matcher that matches if the examined object matches ALL of the specified matchers.
+ For example:
+
Wraps an existing matcher, overriding its description with that specified. All other functions are
+ delegated to the decorated matcher, including its mismatch description.
+ For example:
+
describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())
+
+
Parameters:
+
description - the new description for the wrapped matcher
+
matcher - the matcher to wrap
+
values - optional values to insert into the tokenised description
public static <U> Matcher<java.lang.Iterable<? extends 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.
+ For example:
+
public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
public 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. Whilst matching, each traversal of
+ the examined Iterable will stop as soon as a matching item is found.
+ For example:
+
public 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. Whilst matching, each traversal of the
+ examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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.
+
+
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.
public 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.
+
+
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))
public 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.
+
+
The created matcher assumes no relationship between specified type and the examined object.
public static <T> IsArray<T> array(Matcher<? super T>... elementMatchers)
+
Creates a matcher that matches arrays whose elements are satisfied by the specified matchers. Matches
+ positively only if the number of matchers specified is equal to the length of the examined array and
+ each matcher[i] is satisfied by array[i].
+ For example:
+
public 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. Whilst matching, the traversal
+ of the examined array will stop as soon as a matching element is found.
+ For example:
+
public static <E> Matcher<E[]> arrayContaining(E... items)
+
Creates a matcher for arrays that matches when each item in the examined array is
+ logically equal to the corresponding item in the specified items. For a positive match,
+ the examined array must be of the same length as the number of specified items.
+ For example:
+
public 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. For a positive match, the examined array
+ must be of the same length as the number of specified matchers.
+ For example:
+
public 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. For a positive match, the examined array
+ must be of the same length as the specified list of matchers.
+ For example:
+
public 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.
+ For a positive match, the examined array 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
+ array.
+
public 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.
+ For a positive match, the examined array 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 array.
+
public 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.
+ For a positive match, the examined array 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
+ array.
+
public 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. For a positive match, the examined iterable
+ must be of the same length as the number of specified items.
+ For example:
+
public 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.
+ For a positive match, the examined iterable must only yield one item.
+ For example:
+
public 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. For a positive match, the examined iterable
+ must be of the same length as the number of specified matchers.
+ For example:
+
public 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. For a positive match, the examined iterable
+ must be of the same length as the specified list of matchers.
+ For example:
+
public 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. 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.
+
public 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. 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.
+
public 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. 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.
+
public static <E> Matcher<java.lang.Iterable<? extends E>> containsInRelativeOrder(E... items)
+
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
+
public static <E> Matcher<java.lang.Iterable<? extends E>> containsInRelativeOrder(Matcher<? super E>... itemMatchers)
+
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
+ For example:
+
public static <E> Matcher<java.lang.Iterable<? extends E>> containsInRelativeOrder(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, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
+ For example:
+
public 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.
+ For example:
+
public 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.
+ For example:
+
public 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 keyMatcherand whose
+ value satisfies the specified valueMatcher.
+ For example:
+
public 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 keyand whose value equals the
+ specified value.
+ For example:
+
assertThat(myMap, hasEntry("bar", "foo"))
+
+
Parameters:
+
key - the key that, in combination with the value, must be describe at least one entry
+
value - the value that, in combination with the key, must be describe at least one entry
public 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. 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"))))
+
+
Parameters:
+
operand - the expected value of matching BigDecimals
+
error - the delta (+/-) within which matches will be allowed
public 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.
+ For example:
+
assertThat(1, comparesEqualTo(1))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(2, greaterThan(1))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(1, greaterThanOrEqualTo(1))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(1, lessThan(2))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(1, lessThanOrEqualTo(1))
+
+
Parameters:
+
value - the value which, when passed to the compareTo method of the examined object, should return less
+ than or equal to zero
public 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. To be
+ exact, the following whitespace rules are applied:
+
+
all leading and trailing whitespace of both the expectedString and the examined string are ignored
+
any remaining whitespace, appearing within either string, is collapsed to a single space before comparison
+
+ For example:
+
assertThat(" my\tfoo bar ", equalToIgnoringWhiteSpace(" my foo bar"))
+
+
Parameters:
+
expectedString - the expected value of matched strings
public static Matcher<java.lang.String> blankOrNullString()
+
Creates a matcher of String that matches when the examined string is null, or
+ contains zero or more whitespace characters and nothing else.
+ For example:
+
public 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, considering the order of their appearance.
+ For example:
+
public static Matcher<java.lang.String> stringContainsInOrder(java.lang.String... substrings)
+
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
+ For example:
+
public 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.
+ For example:
+
public 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.
+ For example:
+
public 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.
+ For example:
+
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.
+ For example:
+
public 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.
+ For example:
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Append the String str to the description.
+ The default implementation passes every character to BaseDescription.append(char).
+ Override in subclasses to provide an efficient implementation.
public abstract class TypeSafeDiagnosingMatcher<T>
+extends BaseMatcher<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
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
item - the object against which the matcher is evaluated.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
public abstract class TypeSafeMatcher<T>
+extends BaseMatcher<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.
public final boolean matches(java.lang.Object item)
+
Methods made final to prevent accidental override.
+ If you need to override this, there's no point on extending TypeSafeMatcher.
+ Instead, extend the BaseMatcher.
+
+
Parameters:
+
item - the object against which the matcher is evaluated.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
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.
+
+
+
Example Usage
+ Consider the situation where we have a class representing a person, which
+ follows the basic JavaBean convention of having get() and possibly set()
+ methods for it's 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:
+
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
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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.
+ For example:
+
public class PropertyUtil
+extends java.lang.Object
+
Utility class for accessing properties on JavaBean objects.
+ See http://java.sun.com/products/javabeans/docs/index.html for
+ more information on JavaBeans.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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.
+ For example:
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public static <T> IsArray<T> array(Matcher<? super T>... elementMatchers)
+
Creates a matcher that matches arrays whose elements are satisfied by the specified matchers. Matches
+ positively only if the number of matchers specified is equal to the length of the examined array and
+ each matcher[i] is satisfied by array[i].
+ For example:
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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. Whilst matching, the traversal
+ of the examined array will stop as soon as a matching element is found.
+ For example:
+
+ 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.
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.
+ Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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.
+ For a positive match, the examined array 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
+ array.
+
public 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.
+ For a positive match, the examined array 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 array.
+
public 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.
+ For a positive match, the examined array 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
+ array.
+
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified list of matchers.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public static <E> Matcher<E[]> arrayContaining(E... items)
+
Creates a matcher for arrays that matches when each item in the examined array is
+ logically equal to the corresponding item in the specified items. For a positive match,
+ the examined array must be of the same length as the number of specified items.
+ For example:
+
public 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. For a positive match, the examined array
+ must be of the same length as the number of specified matchers.
+ For example:
+
public 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. For a positive match, the examined array
+ must be of the same length as the specified list of matchers.
+ For example:
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
o - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
buffer - The description to be built or appended to.
+ 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.
+ 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.
+ 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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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. 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.
+
public 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. 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.
+
public 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. 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.
+
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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. For a positive match, the examined iterable
+ must be of the same length as the number of specified items.
+ For example:
+
public 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.
+ For a positive match, the examined iterable must only yield one item.
+ For example:
+
public 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. For a positive match, the examined iterable
+ must be of the same length as the number of specified matchers.
+ For example:
+
public 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. For a positive match, the examined iterable
+ must be of the same length as the specified list of matchers.
+ For example:
+
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public static <E> Matcher<java.lang.Iterable<? extends E>> containsInRelativeOrder(E... items)
+
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
+
public static <E> Matcher<java.lang.Iterable<? extends E>> containsInRelativeOrder(Matcher<? super E>... itemMatchers)
+
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
+ For example:
+
public static <E> Matcher<java.lang.Iterable<? extends E>> containsInRelativeOrder(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, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
+ For example:
+
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
public 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.
+ For example:
+
public 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.
+ For example:
+
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified keyand whose value equals the
+ specified value.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
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)
+
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
+ For example:
+
public 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 keyand whose value equals the
+ specified value.
+ For example:
+
assertThat(myMap, hasEntry("bar", "foo"))
+
+
Parameters:
+
key - the key that, in combination with the value, must be describe at least one entry
+
value - the value that, in combination with the key, must be describe at least one entry
Creates a matcher of T object that matches when the examined object is
+ equal to the specified value, as reported by the Comparator used to
+ create this builder.
Creates a matcher of T object that matches when the examined object is
+ greater than the specified value, as reported by the Comparator used to
+ create this builder.
Creates a matcher of T object that matches when the examined object is
+ greater than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
Creates a matcher of T object that matches when the examined object is
+ less than the specified value, as reported by the Comparator used to
+ create this builder.
Creates a matcher of T object that matches when the examined object is
+ less than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
Creates a matcher of T object that matches when the examined object is
+ equal to the specified value, as reported by the Comparator used to
+ create this builder.
+ For example:
+
Creates a matcher of T object that matches when the examined object is
+ greater than the specified value, as reported by the Comparator used to
+ create this builder.
+ For example:
+
Creates a matcher of T object that matches when the examined object is
+ greater than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
+ For example:
+
Creates a matcher of T object that matches when the examined object is
+ less than the specified value, as reported by the Comparator used to
+ create this builder.
+ For example:
+
Creates a matcher of T object that matches when the examined object is
+ less than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
+ For example:
+
Calculates the logical conjunction of multiple matchers. Evaluation is shortcut, so
+ subsequent matchers are not called if an earlier matcher returns false.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Calculates the logical disjunction of multiple matchers. Evaluation is shortcut, so
+ subsequent matchers are not called if an earlier matcher returns true.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
o - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
Wraps an existing matcher, overriding its description with that specified. All other functions are
+ delegated to the decorated matcher, including its mismatch description.
+ For example:
+
describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())
+
+
Parameters:
+
description - the new description for the wrapped matcher
+
matcher - the matcher to wrap
+
values - optional values to insert into the tokenised description
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public static <U> Matcher<java.lang.Iterable<? extends 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.
+ For example:
+
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)))
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
arg - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
o - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
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.
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.
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
@SafeVarargs
+public 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. Whilst matching, each traversal of
+ the examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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. Whilst matching, each traversal of the
+ examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
actualValue - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
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.
+
+
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.
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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.
+
+
The created matcher assumes no relationship between specified type and the examined object.
public 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.
+
+
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))
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
arg - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
o - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
arg - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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. 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"))))
+
+
Parameters:
+
operand - the expected value of matching BigDecimals
+
error - the delta (+/-) within which matches will be allowed
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
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.
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.
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.
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.
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.
public 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.
+ For example:
+
assertThat(1, comparesEqualTo(1))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(2, greaterThan(1))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(1, greaterThanOrEqualTo(1))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(1, lessThan(2))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(1, lessThanOrEqualTo(1))
+
+
Parameters:
+
value - the value which, when passed to the compareTo method of the examined object, should return less
+ than or equal to zero
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public static Matcher<java.lang.String> blankOrNullString()
+
Creates a matcher of String that matches when the examined string is null, or
+ contains zero or more whitespace characters and nothing else.
+ For example:
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Creates a matcher of String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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. To be
+ exact, the following whitespace rules are applied:
+
+
all leading and trailing whitespace of both the expectedString and the examined string are ignored
+
any remaining whitespace, appearing within either string, is collapsed to a single space before comparison
+
+ For example:
+
assertThat(" my\tfoo bar ", equalToIgnoringWhiteSpace(" my foo bar"))
+
+
Parameters:
+
expectedString - the expected value of matched strings
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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, considering the order of their appearance.
+ For example:
+
public static Matcher<java.lang.String> stringContainsInOrder(java.lang.String... substrings)
+
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
+ For example:
+
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
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)
+
Creates a matcher of Nodes that matches when the examined node has a value at the
+ specified xPath that satisfies the specified valueMatcher.
+ For example:
+
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.
+ For example:
+
public 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.
+ For example:
+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
+
+
Overview
+
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.
+
+
+
Package
+
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
+
+
Interfaces (italic)
+
Classes
+
Enums
+
Exceptions
+
Errors
+
Annotation Types
+
+
+
+
Class/Interface
+
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:
+
+
Class inheritance diagram
+
Direct Subclasses
+
All Known Subinterfaces
+
All Known Implementing Classes
+
Class/interface declaration
+
Class/interface description
+
+
+
Nested Class Summary
+
Field Summary
+
Constructor Summary
+
Method Summary
+
+
+
Field Detail
+
Constructor Detail
+
Method Detail
+
+
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
+
Each annotation type has its own separate page with the following sections:
+
+
Annotation Type declaration
+
Annotation Type description
+
Required Element Summary
+
Optional Element Summary
+
Element Detail
+
+
+
+
Enum
+
Each enum has its own separate page with the following sections:
+
+
Enum declaration
+
Enum description
+
Enum Constant Summary
+
Enum Constant Detail
+
+
+
+
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.
+
+
When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
+
When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+
+
+
+
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.
+
+
+
All Classes
+
The All Classes link shows all classes and interfaces except non-static nested types.
+
+
+
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.
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.
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.
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.
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified list of matchers.
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified list of matchers.
+ Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
+ 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.
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.
+ Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
+ 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.
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.
Creates a matcher of T object that matches when the examined object is
+ equal to the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
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.
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.
+ 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.
+ 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.
+ 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.
+ 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.
+ 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.
+ 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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
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.
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.
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.
Creates a matcher of String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored.
Creates a matcher of String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored.
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.
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.
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.
Creates a matcher of T object that matches when the examined object is
+ greater than the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
Creates a matcher of T object that matches when the examined object is
+ greater than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified keyand whose value equals the
+ specified value.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified keyand whose value equals the
+ specified value.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Creates a matcher that matches when the examined object is a graph of
+ JavaBean objects that can be navigated along the declared dot-separated path
+ and the final element of that path is a JavaBean property whose value satisfies the
+ specified matcher.
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.
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.
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.
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.
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
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.
Creates a matcher of T object that matches when the examined object is
+ less than the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
Creates a matcher of T object that matches when the examined object is
+ less than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
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.
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.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to Non-frame version.
Append the String str to the description.
+ The default implementation passes every character to append(char).
+ Override in subclasses to provide an efficient implementation.
This method simply acts a friendly reminder not to implement Matcher directly and
+ instead extend BaseMatcher. It's easy to ignore JavaDoc, but a bit harder to ignore
+ compile errors .
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
public abstract class Condition<T>
+extends java.lang.Object
+
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
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.
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.
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.
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.
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.
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.
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.
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.
Wraps an existing matcher, overriding its description with that specified. All other functions are
+ delegated to the decorated matcher, including its mismatch description.
+ For example:
+
describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())
+
+
Parameters:
+
description - the new description for the wrapped matcher
+
matcher - the matcher to wrap
+
values - optional values to insert into the tokenised description
public static <U> Matcher<java.lang.Iterable<? extends 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.
+ For example:
+
public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
@SafeVarargs
+public 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. Whilst matching, each traversal of
+ the examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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. Whilst matching, each traversal of the
+ examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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.
+
+
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.
public 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.
+
+
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))
public 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.
+
+
The created matcher assumes no relationship between specified type and the examined object.
public abstract class CustomMatcher<T>
+extends BaseMatcher<T>
+
Utility class for writing one off matchers.
+ For example:
+
+ Matcher<String> aNonEmptyString = new CustomMatcher<String>("a non empty string") {
+ public boolean matches(Object object) {
+ return ((object instanceof String) && !((String) object).isEmpty();
+ }
+ };
+
+
+ This class is designed for scenarios where an anonymous inner class
+ matcher makes sense. It should not be used by API designers implementing
+ matchers.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public abstract class CustomTypeSafeMatcher<T>
+extends TypeSafeMatcher<T>
+
Utility class for writing one off matchers.
+ For example:
+
+ 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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
item - the object against which the matcher is evaluated.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
+ A matcher over acceptable values.
+ A matcher is able to describe itself to give feedback when it fails.
+
+
+ Matcher implementations should NOT directly implement this interface.
+ Instead, extend the BaseMatcher abstract class,
+ which will ensure that the Matcher API can grow to support
+ new features and remain compatible with all Matcher implementations.
+
+
+ When using Hamcrest, there is no guarantee as to how often matches() or
+ describeMismatch() will be called, so the objects passed as
+ actual arguments should not change when referenced. If you're testing a
+ stream, a good practice is to collect the contents of the stream before matching.
+
+
+ N.B. Well designed matchers should be immutable.
+
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
actual - the object against which the matcher is evaluated.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
+
+
Parameters:
+
actual - The item that the Matcher has rejected.
+
mismatchDescription - The description to be built or appended to.
This method simply acts a friendly reminder not to implement Matcher directly and
+ instead extend BaseMatcher. It's easy to ignore JavaDoc, but a bit harder to ignore
+ compile errors .
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.
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified list of matchers.
+ 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.
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.
+ Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
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.
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
+ 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.
+ 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.
+ 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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
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.
Creates a matcher of String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored.
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.
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.
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.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified keyand whose value equals the
+ specified value.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
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.
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.
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.
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.
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.
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
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.
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.
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.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
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)
+
Creates a matcher that matches if the examined object matches ALL of the specified matchers.
+ For example:
+
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)
+
Creates a matcher that matches if the examined object matches ALL of the specified matchers.
+ For example:
+
Wraps an existing matcher, overriding its description with that specified. All other functions are
+ delegated to the decorated matcher, including its mismatch description.
+ For example:
+
describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())
+
+
Parameters:
+
description - the new description for the wrapped matcher
+
matcher - the matcher to wrap
+
values - optional values to insert into the tokenized description
public static <U> Matcher<java.lang.Iterable<? extends 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.
+ For example:
+
public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
@SafeVarargs
+public 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. Whilst matching, each traversal of
+ the examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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. Whilst matching, each traversal of the
+ examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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.
+
+
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.
public 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.
+
+
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))
public 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.
+
+
The created matcher assumes no relationship between specified type and the examined object.
@SafeVarargs
+public static <T> IsArray<T> array(Matcher<? super T>... elementMatchers)
+
Creates a matcher that matches arrays whose elements are satisfied by the specified matchers. Matches
+ positively only if the number of matchers specified is equal to the length of the examined array and
+ each matcher[i] is satisfied by array[i].
+ For example:
+
public 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. Whilst matching, the traversal
+ of the examined array will stop as soon as a matching element is found.
+ For example:
+
Creates a matcher for arrays that matches when each item in the examined array is
+ logically equal to the corresponding item in the specified items. For a positive match,
+ the examined array must be of the same length as the number of specified items.
+ For example:
+
@SafeVarargs
+public 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. For a positive match, the examined array
+ must be of the same length as the number of specified matchers.
+ For example:
+
public 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. For a positive match, the examined array
+ must be of the same length as the specified list of matchers.
+ For example:
+
@SafeVarargs
+public 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.
+ For a positive match, the examined array 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
+ array.
+
public 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.
+ For a positive match, the examined array 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 array.
+
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.
+ For a positive match, the examined array 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
+ array.
+
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. For a positive match, the examined iterable
+ must be of the same length as the number of specified items.
+ For example:
+
public 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.
+ For a positive match, the examined iterable must only yield one item.
+ For example:
+
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. For a positive match, the examined iterable
+ must be of the same length as the number of specified matchers.
+ For example:
+
public 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. For a positive match, the examined iterable
+ must be of the same length as the specified list of matchers.
+ For example:
+
+ 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. 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.
+
+ 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. 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.
+
public 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. 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.
+
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
+
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
+ For example:
+
public static <E> Matcher<java.lang.Iterable<? extends E>> containsInRelativeOrder(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, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
+ For example:
+
public 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.
+ For example:
+
public 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.
+ For example:
+
public 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 keyMatcherand whose
+ value satisfies the specified valueMatcher.
+ For example:
+
public 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 keyand whose value equals the
+ specified value.
+ For example:
+
assertThat(myMap, hasEntry("bar", "foo"))
+
+
Parameters:
+
key - the key that, in combination with the value, must be describe at least one entry
+
value - the value that, in combination with the key, must be describe at least one entry
public 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. 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"))))
+
+
Parameters:
+
operand - the expected value of matching BigDecimals
+
error - the delta (+/-) within which matches will be allowed
public 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.
+ For example:
+
assertThat(1, comparesEqualTo(1))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(2, greaterThan(1))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(1, greaterThanOrEqualTo(1))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(1, lessThan(2))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(1, lessThanOrEqualTo(1))
+
+
Parameters:
+
value - the value which, when passed to the compareTo method of the examined object, should return less
+ than or equal to zero
public static Matcher<java.lang.String> equalToCompressingWhiteSpace(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. To be
+ exact, the following whitespace rules are applied:
+
+
all leading and trailing whitespace of both the expectedString and the examined string are ignored
+
any remaining whitespace, appearing within either string, is collapsed to a single space before comparison
+
+ For example:
+
assertThat(" my\tfoo bar ", equalToIgnoringWhiteSpace(" my foo bar"))
+
+
Parameters:
+
expectedString - the expected value of matched strings
public static Matcher<java.lang.String> blankOrNullString()
+
Creates a matcher of String that matches when the examined string is null, or
+ contains zero or more whitespace characters and nothing else.
+ For example:
+
public 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, considering the order of their appearance.
+ For example:
+
public static Matcher<java.lang.String> stringContainsInOrder(java.lang.String... substrings)
+
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
+ For example:
+
public 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.
+ For example:
+
public static <B> Matcher<B> samePropertyValuesAs(B expectedBean,
+ java.lang.String... ignoredProperties)
+
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. If any properties are marked as ignored, they will be dropped from
+ both the expected and actual bean. Note that the ignored properties use JavaBean
+ display names, for example
public 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.
+ For example:
+
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.
+ For example:
+
public 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.
+ For example:
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Append the String str to the description.
+ The default implementation passes every character to BaseDescription.append(char).
+ Override in subclasses to provide an efficient implementation.
public abstract class TypeSafeDiagnosingMatcher<T>
+extends BaseMatcher<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
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
item - the object against which the matcher is evaluated.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
public abstract class TypeSafeMatcher<T>
+extends BaseMatcher<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.
public final boolean matches(java.lang.Object item)
+
Methods made final to prevent accidental override.
+ If you need to override this, there's no point on extending TypeSafeMatcher.
+ Instead, extend the BaseMatcher.
+
+
Parameters:
+
item - the object against which the matcher is evaluated.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
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.
+
+
+
Example Usage
+ Consider the situation where we have a class representing a person, which
+ follows the basic JavaBean convention of having get() and possibly set()
+ methods for it's 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:
+
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
+
Creates a matcher that matches when the examined object is a graph of
+ JavaBean objects that can be navigated along the declared dot-separated path
+ and the final element of that path is a JavaBean property whose value satisfies the
+ specified matcher.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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.
+ For example:
+
public static <T> Matcher<T> hasPropertyAtPath(java.lang.String path,
+ Matcher<T> valueMatcher)
+
Creates a matcher that matches when the examined object is a graph of
+ JavaBean objects that can be navigated along the declared dot-separated path
+ and the final element of that path is a JavaBean property whose value satisfies the
+ specified matcher.
+ For example:
+
public class PropertyUtil
+extends java.lang.Object
+
Utility class for accessing properties on JavaBean objects.
+ See http://java.sun.com/products/javabeans/docs/index.html for
+ more information on JavaBeans.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public static <B> Matcher<B> samePropertyValuesAs(B expectedBean,
+ java.lang.String... ignoredProperties)
+
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. If any properties are marked as ignored, they will be dropped from
+ both the expected and actual bean. Note that the ignored properties use JavaBean
+ display names, for example
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified list of matchers.
+ 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.
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.
+ Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
public 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. Whilst matching, the traversal
+ of the examined array will stop as soon as a matching element is found.
+ For example:
+
@SafeVarargs
+public 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.
+ For a positive match, the examined array 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
+ array.
+
public 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.
+ For a positive match, the examined array 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 array.
+
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.
+ For a positive match, the examined array 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
+ array.
+
Creates a matcher for arrays that matches when each item in the examined array is
+ logically equal to the corresponding item in the specified items. For a positive match,
+ the examined array must be of the same length as the number of specified items.
+ For example:
+
@SafeVarargs
+public 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. For a positive match, the examined array
+ must be of the same length as the number of specified matchers.
+ For example:
+
public 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. For a positive match, the examined array
+ must be of the same length as the specified list of matchers.
+ For example:
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public static <T> IsArray<T> array(Matcher<? super T>... elementMatchers)
+
Creates a matcher that matches arrays whose elements are satisfied by the specified matchers. Matches
+ positively only if the number of matchers specified is equal to the length of the examined array and
+ each matcher[i] is satisfied by array[i].
+ For example:
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
+ For a positive match, the examined array 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
+ array.
+
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.
+ For a positive match, the examined array 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 array.
+
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.
+ For a positive match, the examined array 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
+ array.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Creates a matcher for arrays that matcheswhen each item in the examined array is
+ logically equal to the corresponding item in the specified items. For a positive match,
+ the examined array must be of the same length as the number of specified items.
+
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified matchers. For a positive match, the examined array
+ must be of the same length as the number of specified matchers.
+
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified list of matchers. For a positive match, the examined array
+ must be of the same length as the specified list of matchers.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
o - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
buffer - The description to be built or appended to.
+ 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.
+ 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.
+ 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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
+ 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. 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.
+
+ 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. 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.
+
public 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. 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.
+
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
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. For a positive match, the examined iterable
+ must be of the same length as the number of specified items.
+ For example:
+
public 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.
+ For a positive match, the examined iterable must only yield one item.
+ For example:
+
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. For a positive match, the examined iterable
+ must be of the same length as the number of specified matchers.
+ For example:
+
public 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. For a positive match, the examined iterable
+ must be of the same length as the specified list of matchers.
+ For example:
+
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
+
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
+ For example:
+
public static <E> Matcher<java.lang.Iterable<? extends E>> containsInRelativeOrder(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, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
+ For example:
+
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
public 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.
+ For example:
+
public 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.
+ For example:
+
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified keyand whose value equals the
+ specified value.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
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)
+
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
+ For example:
+
public 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 keyand whose value equals the
+ specified value.
+ For example:
+
assertThat(myMap, hasEntry("bar", "foo"))
+
+
Parameters:
+
key - the key that, in combination with the value, must be describe at least one entry
+
value - the value that, in combination with the key, must be describe at least one entry
Creates a matcher of T object that matches when the examined object is
+ equal to the specified value, as reported by the Comparator used to
+ create this builder.
Creates a matcher of T object that matches when the examined object is
+ greater than the specified value, as reported by the Comparator used to
+ create this builder.
Creates a matcher of T object that matches when the examined object is
+ greater than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
Creates a matcher of T object that matches when the examined object is
+ less than the specified value, as reported by the Comparator used to
+ create this builder.
Creates a matcher of T object that matches when the examined object is
+ less than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
Creates a matcher of T object that matches when the examined object is
+ equal to the specified value, as reported by the Comparator used to
+ create this builder.
+ For example:
+
Creates a matcher of T object that matches when the examined object is
+ greater than the specified value, as reported by the Comparator used to
+ create this builder.
+ For example:
+
Creates a matcher of T object that matches when the examined object is
+ greater than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
+ For example:
+
Creates a matcher of T object that matches when the examined object is
+ less than the specified value, as reported by the Comparator used to
+ create this builder.
+ For example:
+
Creates a matcher of T object that matches when the examined object is
+ less than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
+ For example:
+
Calculates the logical conjunction of multiple matchers. Evaluation is shortcut, so
+ subsequent matchers are not called if an earlier matcher returns false.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Calculates the logical disjunction of multiple matchers. Evaluation is shortcut, so
+ subsequent matchers are not called if an earlier matcher returns true.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
o - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
Wraps an existing matcher, overriding its description with that specified. All other functions are
+ delegated to the decorated matcher, including its mismatch description.
+ For example:
+
describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())
+
+
Parameters:
+
description - the new description for the wrapped matcher
+
matcher - the matcher to wrap
+
values - optional values to insert into the tokenised description
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public static <U> Matcher<java.lang.Iterable<? extends 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.
+ For example:
+
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)))
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
arg - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
o - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
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. Whilst matching, each traversal of
+ the examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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. Whilst matching, each traversal of the
+ examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
actualValue - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
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.
+
+
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.
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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.
+
+
The created matcher assumes no relationship between specified type and the examined object.
public 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.
+
+
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))
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.
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.
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
@SafeVarargs
+public 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. Whilst matching, each traversal of
+ the examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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. Whilst matching, each traversal of the
+ examined Iterable will stop as soon as a matching item is found.
+ For example:
+
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
arg - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
o - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
arg - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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. 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"))))
+
+
Parameters:
+
operand - the expected value of matching BigDecimals
+
error - the delta (+/-) within which matches will be allowed
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
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.
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.
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.
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.
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.
public 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.
+ For example:
+
assertThat(1, comparesEqualTo(1))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(2, greaterThan(1))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(1, greaterThanOrEqualTo(1))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(1, lessThan(2))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(1, lessThanOrEqualTo(1))
+
+
Parameters:
+
value - the value which, when passed to the compareTo method of the examined object, should return less
+ than or equal to zero
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public static Matcher<java.lang.String> blankOrNullString()
+
Creates a matcher of String that matches when the examined string is null, or
+ contains zero or more whitespace characters and nothing else.
+ For example:
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Creates a matcher of String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public static Matcher<java.lang.String> equalToCompressingWhiteSpace(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. To be
+ exact, the following whitespace rules are applied:
+
+
all leading and trailing whitespace of both the expectedString and the examined string are ignored
+
any remaining whitespace, appearing within either string, is collapsed to a single space before comparison
+
+ For example:
+
assertThat(" my\tfoo bar ", equalToCompressingWhiteSpace(" my foo bar"))
+
+
Parameters:
+
expectedString - the expected value of matched strings
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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, considering the order of their appearance.
+ For example:
+
public static Matcher<java.lang.String> stringContainsInOrder(java.lang.String... substrings)
+
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
+ For example:
+
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
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)
+
Creates a matcher of Nodes that matches when the examined node has a value at the
+ specified xPath that satisfies the specified valueMatcher.
+ For example:
+
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.
+ For example:
+
public 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.
+ For example:
+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
+
+
Overview
+
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.
+
+
+
Package
+
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
+
+
Interfaces (italic)
+
Classes
+
Enums
+
Exceptions
+
Errors
+
Annotation Types
+
+
+
+
Class/Interface
+
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:
+
+
Class inheritance diagram
+
Direct Subclasses
+
All Known Subinterfaces
+
All Known Implementing Classes
+
Class/interface declaration
+
Class/interface description
+
+
+
Nested Class Summary
+
Field Summary
+
Constructor Summary
+
Method Summary
+
+
+
Field Detail
+
Constructor Detail
+
Method Detail
+
+
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
+
Each annotation type has its own separate page with the following sections:
+
+
Annotation Type declaration
+
Annotation Type description
+
Required Element Summary
+
Optional Element Summary
+
Element Detail
+
+
+
+
Enum
+
Each enum has its own separate page with the following sections:
+
+
Enum declaration
+
Enum description
+
Enum Constant Summary
+
Enum Constant Detail
+
+
+
+
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.
+
+
When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
+
When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+
+
+
+
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.
+
+
+
All Classes
+
The All Classes link shows all classes and interfaces except non-static nested types.
+
+
+
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.
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.
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.
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.
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified list of matchers.
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified list of matchers.
+ Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
+ 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.
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.
+ Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
+ 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.
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.
Creates a matcher of T object that matches when the examined object is
+ equal to the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
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.
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.
+ 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.
+ 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.
+ 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.
+ 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.
+ 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.
+ 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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
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.
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.
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.
Creates a matcher of String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored.
Creates a matcher of String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored.
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.
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.
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.
Creates a matcher of T object that matches when the examined object is
+ greater than the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
Creates a matcher of T object that matches when the examined object is
+ greater than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified keyand whose value equals the
+ specified value.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified keyand whose value equals the
+ specified value.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Creates a matcher that matches when the examined object is a graph of
+ JavaBean objects that can be navigated along the declared dot-separated path
+ and the final element of that path is a JavaBean property whose value satisfies the
+ specified matcher.
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.
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.
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.
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.
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
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.
Creates a matcher of T object that matches when the examined object is
+ less than the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
Creates a matcher of T object that matches when the examined object is
+ less than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
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.
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.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to Non-frame version.
Append the String str to the description.
+ The default implementation passes every character to append(char).
+ Override in subclasses to provide an efficient implementation.
This method simply acts a friendly reminder not to implement Matcher directly and
+ instead extend BaseMatcher. It's easy to ignore JavaDoc, but a bit harder to ignore
+ compile errors .
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
public abstract class Condition<T>
+extends java.lang.Object
+
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
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.
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.
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.
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.
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.
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.
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.
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.
Wraps an existing matcher, overriding its description with that specified. All other functions are
+ delegated to the decorated matcher, including its mismatch description.
+ For example:
+
describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())
+
+
Parameters:
+
description - the new description for the wrapped matcher
+
matcher - the matcher to wrap
+
values - optional values to insert into the tokenised description
public static <U> Matcher<java.lang.Iterable<? extends 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.
+ For example:
+
public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
@SafeVarargs
+public 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. Whilst matching, each traversal of
+ the examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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. Whilst matching, each traversal of the
+ examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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.
+
+
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.
public 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.
+
+
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))
public 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.
+
+
The created matcher assumes no relationship between specified type and the examined object.
public abstract class CustomMatcher<T>
+extends BaseMatcher<T>
+
Utility class for writing one off matchers.
+ For example:
+
+ Matcher<String> aNonEmptyString = new CustomMatcher<String>("a non empty string") {
+ public boolean matches(Object object) {
+ return ((object instanceof String) && !((String) object).isEmpty();
+ }
+ };
+
+
+ This class is designed for scenarios where an anonymous inner class
+ matcher makes sense. It should not be used by API designers implementing
+ matchers.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public abstract class CustomTypeSafeMatcher<T>
+extends TypeSafeMatcher<T>
+
Utility class for writing one off matchers.
+ For example:
+
+ 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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
item - the object against which the matcher is evaluated.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
+ A matcher over acceptable values.
+ A matcher is able to describe itself to give feedback when it fails.
+
+
+ Matcher implementations should NOT directly implement this interface.
+ Instead, extend the BaseMatcher abstract class,
+ which will ensure that the Matcher API can grow to support
+ new features and remain compatible with all Matcher implementations.
+
+
+ When using Hamcrest, there is no guarantee as to how often matches() or
+ describeMismatch() will be called, so the objects passed as
+ actual arguments should not change when referenced. If you're testing a
+ stream, a good practice is to collect the contents of the stream before matching.
+
+
+ N.B. Well designed matchers should be immutable.
+
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
actual - the object against which the matcher is evaluated.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
+
+
Parameters:
+
actual - The item that the Matcher has rejected.
+
mismatchDescription - The description to be built or appended to.
This method simply acts a friendly reminder not to implement Matcher directly and
+ instead extend BaseMatcher. It's easy to ignore JavaDoc, but a bit harder to ignore
+ compile errors .
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.
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified list of matchers.
+ 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.
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.
+ Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
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.
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
+ 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.
+ 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.
+ 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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
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.
Creates a matcher of String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored.
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.
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.
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.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified keyand whose value equals the
+ specified value.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
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.
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.
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.
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.
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.
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
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.
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.
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.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
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)
+
Creates a matcher that matches if the examined object matches ALL of the specified matchers.
+ For example:
+
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)
+
Creates a matcher that matches if the examined object matches ALL of the specified matchers.
+ For example:
+
public static <T> AnyOf<T> anyOf(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 ANY of the specified matchers.
+ For example:
+
public static <T> AnyOf<T> anyOf(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 ANY of the specified matchers.
+ For example:
+
Wraps an existing matcher, overriding its description with that specified. All other functions are
+ delegated to the decorated matcher, including its mismatch description.
+ For example:
+
describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())
+
+
Parameters:
+
description - the new description for the wrapped matcher
+
matcher - the matcher to wrap
+
values - optional values to insert into the tokenized description
public static <U> Matcher<java.lang.Iterable<? extends 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.
+ For example:
+
public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
@SafeVarargs
+public 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. Whilst matching, each traversal of
+ the examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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. Whilst matching, each traversal of the
+ examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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.
+
+
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.
public 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.
+
+
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))
public 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.
+
+
The created matcher assumes no relationship between specified type and the examined object.
@SafeVarargs
+public static <T> IsArray<T> array(Matcher<? super T>... elementMatchers)
+
Creates a matcher that matches arrays whose elements are satisfied by the specified matchers. Matches
+ positively only if the number of matchers specified is equal to the length of the examined array and
+ each matcher[i] is satisfied by array[i].
+ For example:
+
public 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. Whilst matching, the traversal
+ of the examined array will stop as soon as a matching element is found.
+ For example:
+
Creates a matcher for arrays that matches when each item in the examined array is
+ logically equal to the corresponding item in the specified items. For a positive match,
+ the examined array must be of the same length as the number of specified items.
+ For example:
+
@SafeVarargs
+public 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. For a positive match, the examined array
+ must be of the same length as the number of specified matchers.
+ For example:
+
public 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. For a positive match, the examined array
+ must be of the same length as the specified list of matchers.
+ For example:
+
@SafeVarargs
+public 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.
+ For a positive match, the examined array 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
+ array.
+
public 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.
+ For a positive match, the examined array 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 array.
+
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.
+ For a positive match, the examined array 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
+ array.
+
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. For a positive match, the examined iterable
+ must be of the same length as the number of specified items.
+ For example:
+
public 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.
+ For a positive match, the examined iterable must only yield one item.
+ For example:
+
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. For a positive match, the examined iterable
+ must be of the same length as the number of specified matchers.
+ For example:
+
public 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. For a positive match, the examined iterable
+ must be of the same length as the specified list of matchers.
+ For example:
+
+ 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. 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.
+
+ 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. 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.
+
public 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. 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.
+
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
+
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
+ For example:
+
public static <E> Matcher<java.lang.Iterable<? extends E>> containsInRelativeOrder(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, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
+ For example:
+
public 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.
+ For example:
+
public 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.
+ For example:
+
public 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 keyMatcherand whose
+ value satisfies the specified valueMatcher.
+ For example:
+
public 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 keyand whose value equals the
+ specified value.
+ For example:
+
assertThat(myMap, hasEntry("bar", "foo"))
+
+
Parameters:
+
key - the key that, in combination with the value, must be describe at least one entry
+
value - the value that, in combination with the key, must be describe at least one entry
public 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. 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"))))
+
+
Parameters:
+
operand - the expected value of matching BigDecimals
+
error - the delta (+/-) within which matches will be allowed
public 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.
+ For example:
+
assertThat(1, comparesEqualTo(1))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(2, greaterThan(1))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(1, greaterThanOrEqualTo(1))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(1, lessThan(2))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(1, lessThanOrEqualTo(1))
+
+
Parameters:
+
value - the value which, when passed to the compareTo method of the examined object, should return less
+ than or equal to zero
public static Matcher<java.lang.String> equalToCompressingWhiteSpace(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. To be
+ exact, the following whitespace rules are applied:
+
+
all leading and trailing whitespace of both the expectedString and the examined string are ignored
+
any remaining whitespace, appearing within either string, is collapsed to a single space before comparison
+
+ For example:
+
assertThat(" my\tfoo bar ", equalToIgnoringWhiteSpace(" my foo bar"))
+
+
Parameters:
+
expectedString - the expected value of matched strings
public static Matcher<java.lang.String> blankOrNullString()
+
Creates a matcher of String that matches when the examined string is null, or
+ contains zero or more whitespace characters and nothing else.
+ For example:
+
public 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, considering the order of their appearance.
+ For example:
+
public static Matcher<java.lang.String> stringContainsInOrder(java.lang.String... substrings)
+
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
+ For example:
+
public 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.
+ For example:
+
public static <B> Matcher<B> samePropertyValuesAs(B expectedBean,
+ java.lang.String... ignoredProperties)
+
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. If any properties are marked as ignored, they will be dropped from
+ both the expected and actual bean. Note that the ignored properties use JavaBean
+ display names, for example
public 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.
+ For example:
+
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.
+ For example:
+
public 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.
+ For example:
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Append the String str to the description.
+ The default implementation passes every character to BaseDescription.append(char).
+ Override in subclasses to provide an efficient implementation.
public abstract class TypeSafeDiagnosingMatcher<T>
+extends BaseMatcher<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
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
item - the object against which the matcher is evaluated.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
public abstract class TypeSafeMatcher<T>
+extends BaseMatcher<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.
public final boolean matches(java.lang.Object item)
+
Methods made final to prevent accidental override.
+ If you need to override this, there's no point on extending TypeSafeMatcher.
+ Instead, extend the BaseMatcher.
+
+
Parameters:
+
item - the object against which the matcher is evaluated.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
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.
+
+
+
Example Usage
+ Consider the situation where we have a class representing a person, which
+ follows the basic JavaBean convention of having get() and possibly set()
+ methods for it's 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:
+
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
+
Creates a matcher that matches when the examined object is a graph of
+ JavaBean objects that can be navigated along the declared dot-separated path
+ and the final element of that path is a JavaBean property whose value satisfies the
+ specified matcher.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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.
+ For example:
+
public static <T> Matcher<T> hasPropertyAtPath(java.lang.String path,
+ Matcher<T> valueMatcher)
+
Creates a matcher that matches when the examined object is a graph of
+ JavaBean objects that can be navigated along the declared dot-separated path
+ and the final element of that path is a JavaBean property whose value satisfies the
+ specified matcher.
+ For example:
+
public class PropertyUtil
+extends java.lang.Object
+
Utility class for accessing properties on JavaBean objects.
+ See http://java.sun.com/products/javabeans/docs/index.html for
+ more information on JavaBeans.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public static <B> Matcher<B> samePropertyValuesAs(B expectedBean,
+ java.lang.String... ignoredProperties)
+
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. If any properties are marked as ignored, they will be dropped from
+ both the expected and actual bean. Note that the ignored properties use JavaBean
+ display names, for example
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified list of matchers.
+ 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.
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.
+ Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
public 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. Whilst matching, the traversal
+ of the examined array will stop as soon as a matching element is found.
+ For example:
+
@SafeVarargs
+public 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.
+ For a positive match, the examined array 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
+ array.
+
public 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.
+ For a positive match, the examined array 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 array.
+
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.
+ For a positive match, the examined array 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
+ array.
+
Creates a matcher for arrays that matches when each item in the examined array is
+ logically equal to the corresponding item in the specified items. For a positive match,
+ the examined array must be of the same length as the number of specified items.
+ For example:
+
@SafeVarargs
+public 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. For a positive match, the examined array
+ must be of the same length as the number of specified matchers.
+ For example:
+
public 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. For a positive match, the examined array
+ must be of the same length as the specified list of matchers.
+ For example:
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public static <T> IsArray<T> array(Matcher<? super T>... elementMatchers)
+
Creates a matcher that matches arrays whose elements are satisfied by the specified matchers. Matches
+ positively only if the number of matchers specified is equal to the length of the examined array and
+ each matcher[i] is satisfied by array[i].
+ For example:
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
+ For a positive match, the examined array 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
+ array.
+
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.
+ For a positive match, the examined array 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 array.
+
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.
+ For a positive match, the examined array 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
+ array.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Creates a matcher for arrays that matcheswhen each item in the examined array is
+ logically equal to the corresponding item in the specified items. For a positive match,
+ the examined array must be of the same length as the number of specified items.
+
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified matchers. For a positive match, the examined array
+ must be of the same length as the number of specified matchers.
+
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified list of matchers. For a positive match, the examined array
+ must be of the same length as the specified list of matchers.
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
o - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
buffer - The description to be built or appended to.
+ 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.
+ 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.
+ 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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
+ 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. 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.
+
+ 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. 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.
+
public 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. 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.
+
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
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. For a positive match, the examined iterable
+ must be of the same length as the number of specified items.
+ For example:
+
public 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.
+ For a positive match, the examined iterable must only yield one item.
+ For example:
+
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. For a positive match, the examined iterable
+ must be of the same length as the number of specified matchers.
+ For example:
+
public 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. For a positive match, the examined iterable
+ must be of the same length as the specified list of matchers.
+ For example:
+
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
+
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
+ For example:
+
public static <E> Matcher<java.lang.Iterable<? extends E>> containsInRelativeOrder(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, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
+ For example:
+
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
public 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.
+ For example:
+
public 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.
+ For example:
+
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified keyand whose value equals the
+ specified value.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
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)
+
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
+ For example:
+
public 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 keyand whose value equals the
+ specified value.
+ For example:
+
assertThat(myMap, hasEntry("bar", "foo"))
+
+
Parameters:
+
key - the key that, in combination with the value, must be describe at least one entry
+
value - the value that, in combination with the key, must be describe at least one entry
Creates a matcher of T object that matches when the examined object is
+ equal to the specified value, as reported by the Comparator used to
+ create this builder.
Creates a matcher of T object that matches when the examined object is
+ greater than the specified value, as reported by the Comparator used to
+ create this builder.
Creates a matcher of T object that matches when the examined object is
+ greater than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
Creates a matcher of T object that matches when the examined object is
+ less than the specified value, as reported by the Comparator used to
+ create this builder.
Creates a matcher of T object that matches when the examined object is
+ less than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
Creates a matcher of T object that matches when the examined object is
+ equal to the specified value, as reported by the Comparator used to
+ create this builder.
+ For example:
+
Creates a matcher of T object that matches when the examined object is
+ greater than the specified value, as reported by the Comparator used to
+ create this builder.
+ For example:
+
Creates a matcher of T object that matches when the examined object is
+ greater than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
+ For example:
+
Creates a matcher of T object that matches when the examined object is
+ less than the specified value, as reported by the Comparator used to
+ create this builder.
+ For example:
+
Creates a matcher of T object that matches when the examined object is
+ less than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
+ For example:
+
Calculates the logical conjunction of multiple matchers. Evaluation is shortcut, so
+ subsequent matchers are not called if an earlier matcher returns false.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Calculates the logical disjunction of multiple matchers. Evaluation is shortcut, so
+ subsequent matchers are not called if an earlier matcher returns true.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
o - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
Wraps an existing matcher, overriding its description with that specified. All other functions are
+ delegated to the decorated matcher, including its mismatch description.
+ For example:
+
describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())
+
+
Parameters:
+
description - the new description for the wrapped matcher
+
matcher - the matcher to wrap
+
values - optional values to insert into the tokenised description
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public static <U> Matcher<java.lang.Iterable<? extends 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.
+ For example:
+
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)))
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
arg - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generate a description of why the matcher has not accepted the item.
+ The description will be part of a larger description of why a matching
+ failed, so it should be concise.
+ This method assumes that matches(item) is false, but
+ will not check this.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
o - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
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. Whilst matching, each traversal of
+ the examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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. Whilst matching, each traversal of the
+ examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
actualValue - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
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.
+
+
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.
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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.
+
+
The created matcher assumes no relationship between specified type and the examined object.
public 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.
+
+
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))
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.
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.
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
public 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. Whilst matching, the traversal of the examined Iterable
+ will stop as soon as a matching item is found.
+ For example:
+
@SafeVarargs
+public 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. Whilst matching, each traversal of
+ the examined Iterable will stop as soon as a matching item is found.
+ For example:
+
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. Whilst matching, each traversal of the
+ examined Iterable will stop as soon as a matching item is found.
+ For example:
+
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
arg - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
o - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Evaluates the matcher for argument item.
+
+ This method matches against Object, instead of the generic type T. This is
+ because the caller of the Matcher does not know at runtime what the type is
+ (because of type erasure with Java generics). It is down to the implementations
+ to check the correct type.
+
+
Parameters:
+
arg - the object against which the matcher is evaluated.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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. 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"))))
+
+
Parameters:
+
operand - the expected value of matching BigDecimals
+
error - the delta (+/-) within which matches will be allowed
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
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.
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.
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.
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.
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.
public 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.
+ For example:
+
assertThat(1, comparesEqualTo(1))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(2, greaterThan(1))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(1, greaterThanOrEqualTo(1))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(1, lessThan(2))
+
+
Parameters:
+
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)
+
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.
+ For example:
+
assertThat(1, lessThanOrEqualTo(1))
+
+
Parameters:
+
value - the value which, when passed to the compareTo method of the examined object, should return less
+ than or equal to zero
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public static Matcher<java.lang.String> blankOrNullString()
+
Creates a matcher of String that matches when the examined string is null, or
+ contains zero or more whitespace characters and nothing else.
+ For example:
+
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Creates a matcher of String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public static Matcher<java.lang.String> equalToCompressingWhiteSpace(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. To be
+ exact, the following whitespace rules are applied:
+
+
all leading and trailing whitespace of both the expectedString and the examined string are ignored
+
any remaining whitespace, appearing within either string, is collapsed to a single space before comparison
+
+ For example:
+
assertThat(" my\tfoo bar ", equalToCompressingWhiteSpace(" my foo bar"))
+
+
Parameters:
+
expectedString - the expected value of matched strings
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
description - The description to be built or appended to.
public 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, considering the order of their appearance.
+ For example:
+
public static Matcher<java.lang.String> stringContainsInOrder(java.lang.String... substrings)
+
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
+ For example:
+
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.
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.
Generates a description of the object. The description may be part of a
+ a description of a larger object of which this is just a component, so it
+ should be worded appropriately.
+
+
Parameters:
+
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)
+
Creates a matcher of Nodes that matches when the examined node has a value at the
+ specified xPath that satisfies the specified valueMatcher.
+ For example:
+
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.
+ For example:
+
public 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.
+ For example:
+
+Starting from the Overview page, you can browse the documentation using the links in each page, and in the navigation bar at the top of each page. The Index and Search box allow you to navigate to specific declarations and summary pages, including: All Packages, All Classes and Interfaces
+
+
Search
+
You can search for definitions of modules, packages, types, fields, methods, system properties and other terms defined in the API. These items can be searched using part or all of the name, optionally using "camelCase" abbreviations, or multiple search terms separated by whitespace. Some examples:
+The following sections describe the different kinds of pages in this collection.
+
+
Overview
+
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.
+
+
+
Package
+
Each package has a page that contains a list of its classes and interfaces, with a summary for each. These pages may contain the following categories:
+
+
Interfaces
+
Classes
+
Enum Classes
+
Exception Classes
+
Annotation Interfaces
+
+
+
+
Class or Interface
+
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a declaration and description, member summary tables, and detailed member descriptions. Entries in each of these sections are omitted if they are empty or not applicable.
+
+
Class Inheritance Diagram
+
Direct Subclasses
+
All Known Subinterfaces
+
All Known Implementing Classes
+
Class or Interface Declaration
+
Class or Interface Description
+
+
+
+
Nested Class Summary
+
Enum Constant Summary
+
Field Summary
+
Property Summary
+
Constructor Summary
+
Method Summary
+
Required Element Summary
+
Optional Element Summary
+
+
+
+
Enum Constant Details
+
Field Details
+
Property Details
+
Constructor Details
+
Method Details
+
Element Details
+
+
Note: Annotation interfaces have required and optional elements, but not methods. Only enum classes have enum constants. The components of a record class are displayed as part of the declaration of the record class. Properties are a feature of JavaFX.
+
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.
+
+
+
Other Files
+
Packages and modules may contain pages with additional information related to the declarations nearby.
+
+
+
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. Classes are organized by inheritance structure starting with java.lang.Object. Interfaces do not inherit from java.lang.Object.
+
+
When viewing the Overview page, clicking on TREE displays the hierarchy for all packages.
+
When viewing a particular package, class or interface page, clicking on TREE displays the hierarchy for only that package.
+
+
+
+
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 shortcomings, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+
+
+
All Packages
+
The All Packages page contains an alphabetic index of all packages contained in the documentation.
+
+
+
All Classes and Interfaces
+
The All Classes and Interfaces page contains an alphabetic index of all classes and interfaces contained in the documentation, including annotation interfaces, enum classes, and record classes.
+
+
+
Index
+
The Index contains an alphabetic index of all classes, interfaces, constructors, methods, and fields in the documentation, as well as summary pages such as All Packages, All Classes and Interfaces.
+
+
+
+This help file applies to API documentation generated by the standard doclet.
+
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.
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
+ examined object.
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
+ examined object.
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified list of matchers.
Creates a matcher for arrays that matches when each item in the examined array satisfies the
+ corresponding matcher in the specified list of matchers.
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.
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.
+ 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.
+ 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.
+ Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
+ Creates an order agnostic matcher for arrays that matches when each item in the
+ examined array satisfies one matcher anywhere in the specified matchers.
Creates a matcher of T object that matches when the examined object is
+ equal to the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
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.
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a single item that satisfies the specified matcher.
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.
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.
+ 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.
+ 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.
+ 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.
+ 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.
+ 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.
+ 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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items logically equal to the
+ corresponding item in the specified items, in the same relative order
+ For example:
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that contains items satisfying the corresponding
+ matcher in the specified list of matchers, in the same relative order.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields a series of items, that each satisfying the corresponding
+ matcher in the specified matchers, in the same relative order.
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.
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.
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.
Creates a matcher of String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored.
Creates a matcher of String that matches when the examined string is equal to
+ the specified expectedString, when whitespace differences are (mostly) ignored.
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.
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.
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.
+
+
Example Usage - Search tag in class org.hamcrest.beans.HasPropertyWithValue
Creates a matcher of T object that matches when the examined object is
+ greater than the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
Creates a matcher of T object that matches when the examined object is
+ greater than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified keyand whose value equals the
+ specified value.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key equals the specified keyand whose value equals the
+ specified value.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
Creates a matcher for Maps matching when the examined Map contains
+ at least one entry whose key satisfies the specified keyMatcherand whose
+ value satisfies the specified valueMatcher.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Creates a matcher that matches when the examined object is a graph of
+ JavaBean objects that can be navigated along the declared dot-separated path
+ and the final element of that path is a JavaBean property whose value satisfies the
+ specified matcher.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
Creates a matcher for Iterables that matches when a single pass over the
+ examined Iterable yields an item count that satisfies the specified
+ matcher.
Creates a matcher of T object that matches when the examined object is
+ less than the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
Creates a matcher of T object that matches when the examined object is
+ less than or equal to the specified value, as reported by the Comparator used to
+ create this builder.
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.
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.
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.
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.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
Creates a matcher of String that matches when the examined string contains all of
+ the specified substrings, considering the order of their appearance.
+
+
diff --git a/docs/javadoc/3.0/legal/ADDITIONAL_LICENSE_INFO b/docs/javadoc/3.0/legal/ADDITIONAL_LICENSE_INFO
new file mode 100644
index 000000000..ff700cd09
--- /dev/null
+++ b/docs/javadoc/3.0/legal/ADDITIONAL_LICENSE_INFO
@@ -0,0 +1,37 @@
+ ADDITIONAL INFORMATION ABOUT LICENSING
+
+Certain files distributed by Oracle America, Inc. and/or its affiliates are
+subject to the following clarification and special exception to the GPLv2,
+based on the GNU Project exception for its Classpath libraries, known as the
+GNU Classpath Exception.
+
+Note that Oracle includes multiple, independent programs in this software
+package. Some of those programs are provided under licenses deemed
+incompatible with the GPLv2 by the Free Software Foundation and others.
+For example, the package includes programs licensed under the Apache
+License, Version 2.0 and may include FreeType. Such programs are licensed
+to you under their original licenses.
+
+Oracle facilitates your further distribution of this package by adding the
+Classpath Exception to the necessary parts of its GPLv2 code, which permits
+you to use that code in combination with other independent modules not
+licensed under the GPLv2. However, note that this would not permit you to
+commingle code under an incompatible license with Oracle's GPLv2 licensed
+code by, for example, cutting and pasting such code into a file also
+containing Oracle's GPLv2 licensed code and then distributing the result.
+
+Additionally, if you were to remove the Classpath Exception from any of the
+files to which it applies and distribute the result, you would likely be
+required to license some or all of the other code in that distribution under
+the GPLv2 as well, and since the GPLv2 is incompatible with the license terms
+of some items included in the distribution by Oracle, removing the Classpath
+Exception could therefore effectively compromise your ability to further
+distribute the package.
+
+Failing to distribute notices associated with some files may also create
+unexpected legal consequences.
+
+Proceed with caution and we recommend that you obtain the advice of a lawyer
+skilled in open source matters before removing the Classpath Exception or
+making modifications to this package which may subsequently be redistributed
+and/or involve the use of third party software.
diff --git a/docs/javadoc/3.0/legal/ASSEMBLY_EXCEPTION b/docs/javadoc/3.0/legal/ASSEMBLY_EXCEPTION
new file mode 100644
index 000000000..429666664
--- /dev/null
+++ b/docs/javadoc/3.0/legal/ASSEMBLY_EXCEPTION
@@ -0,0 +1,27 @@
+
+OPENJDK ASSEMBLY EXCEPTION
+
+The OpenJDK source code made available by Oracle America, Inc. (Oracle) at
+openjdk.org ("OpenJDK Code") is distributed under the terms of the GNU
+General Public License version 2
+only ("GPL2"), with the following clarification and special exception.
+
+ Linking this OpenJDK Code statically or dynamically with other code
+ is making a combined work based on this library. Thus, the terms
+ and conditions of GPL2 cover the whole combination.
+
+ As a special exception, Oracle gives you permission to link this
+ OpenJDK Code with certain code licensed by Oracle as indicated at
+ https://openjdk.org/legal/exception-modules-2007-05-08.html
+ ("Designated Exception Modules") to produce an executable,
+ regardless of the license terms of the Designated Exception Modules,
+ and to copy and distribute the resulting executable under GPL2,
+ provided that the Designated Exception Modules continue to be
+ governed by the licenses under which they were offered by Oracle.
+
+As such, it allows licensees and sublicensees of Oracle's GPL2 OpenJDK Code
+to build an executable that includes those portions of necessary code that
+Oracle could not provide under GPL2 (or that Oracle has provided under GPL2
+with the Classpath exception). If you modify or add to the OpenJDK code,
+that new GPL2 code may still be combined with Designated Exception Modules
+if the new code is made subject to this exception by its copyright holder.
diff --git a/docs/javadoc/3.0/legal/LICENSE b/docs/javadoc/3.0/legal/LICENSE
new file mode 100644
index 000000000..8b400c7ab
--- /dev/null
+++ b/docs/javadoc/3.0/legal/LICENSE
@@ -0,0 +1,347 @@
+The GNU General Public License (GPL)
+
+Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Everyone is permitted to copy and distribute verbatim copies of this license
+document, but changing it is not allowed.
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share
+and change it. By contrast, the GNU General Public License is intended to
+guarantee your freedom to share and change free software--to make sure the
+software is free for all its users. This General Public License applies to
+most of the Free Software Foundation's software and to any other program whose
+authors commit to using it. (Some other Free Software Foundation software is
+covered by the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our
+General Public Licenses are designed to make sure that you have the freedom to
+distribute copies of free software (and charge for this service if you wish),
+that you receive source code or can get it if you want it, that you can change
+the software or use pieces of it in new free programs; and that you know you
+can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny
+you these rights or to ask you to surrender the rights. These restrictions
+translate to certain responsibilities for you if you distribute copies of the
+software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for
+a fee, you must give the recipients all the rights that you have. You must
+make sure that they, too, receive or can get the source code. And you must
+show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2)
+offer you this license which gives you legal permission to copy, distribute
+and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain that
+everyone understands that there is no warranty for this free software. If the
+software is modified by someone else and passed on, we want its recipients to
+know that what they have is not the original, so that any problems introduced
+by others will not reflect on the original authors' reputations.
+
+Finally, any free program is threatened constantly by software patents. We
+wish to avoid the danger that redistributors of a free program will
+individually obtain patent licenses, in effect making the program proprietary.
+To prevent this, we have made it clear that any patent must be licensed for
+everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification
+follow.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a notice
+placed by the copyright holder saying it may be distributed under the terms of
+this General Public License. The "Program", below, refers to any such program
+or work, and a "work based on the Program" means either the Program or any
+derivative work under copyright law: that is to say, a work containing the
+Program or a portion of it, either verbatim or with modifications and/or
+translated into another language. (Hereinafter, translation is included
+without limitation in the term "modification".) Each licensee is addressed as
+"you".
+
+Activities other than copying, distribution and modification are not covered by
+this License; they are outside its scope. The act of running the Program is
+not restricted, and the output from the Program is covered only if its contents
+constitute a work based on the Program (independent of having been made by
+running the Program). Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program's source code as
+you receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice and
+disclaimer of warranty; keep intact all the notices that refer to this License
+and to the absence of any warranty; and give any other recipients of the
+Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may
+at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus
+forming a work based on the Program, and copy and distribute such modifications
+or work under the terms of Section 1 above, provided that you also meet all of
+these conditions:
+
+ a) You must cause the modified files to carry prominent notices stating
+ that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in whole or
+ in part contains or is derived from the Program or any part thereof, to be
+ licensed as a whole at no charge to all third parties under the terms of
+ this License.
+
+ c) If the modified program normally reads commands interactively when run,
+ you must cause it, when started running for such interactive use in the
+ most ordinary way, to print or display an announcement including an
+ appropriate copyright notice and a notice that there is no warranty (or
+ else, saying that you provide a warranty) and that users may redistribute
+ the program under these conditions, and telling the user how to view a copy
+ of this License. (Exception: if the Program itself is interactive but does
+ not normally print such an announcement, your work based on the Program is
+ not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If identifiable
+sections of that work are not derived from the Program, and can be reasonably
+considered independent and separate works in themselves, then this License, and
+its terms, do not apply to those sections when you distribute them as separate
+works. But when you distribute the same sections as part of a whole which is a
+work based on the Program, the distribution of the whole must be on the terms
+of this License, whose permissions for other licensees extend to the entire
+whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your
+rights to work written entirely by you; rather, the intent is to exercise the
+right to control the distribution of derivative or collective works based on
+the Program.
+
+In addition, mere aggregation of another work not based on the Program with the
+Program (or with a work based on the Program) on a volume of a storage or
+distribution medium does not bring the other work under the scope of this
+License.
+
+3. You may copy and distribute the Program (or a work based on it, under
+Section 2) in object code or executable form under the terms of Sections 1 and
+2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable source
+ code, which must be distributed under the terms of Sections 1 and 2 above
+ on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three years, to
+ give any third party, for a charge no more than your cost of physically
+ performing source distribution, a complete machine-readable copy of the
+ corresponding source code, to be distributed under the terms of Sections 1
+ and 2 above on a medium customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer to
+ distribute corresponding source code. (This alternative is allowed only
+ for noncommercial distribution and only if you received the program in
+ object code or executable form with such an offer, in accord with
+ Subsection b above.)
+
+The source code for a work means the preferred form of the work for making
+modifications to it. For an executable work, complete source code means all
+the source code for all modules it contains, plus any associated interface
+definition files, plus the scripts used to control compilation and installation
+of the executable. However, as a special exception, the source code
+distributed need not include anything that is normally distributed (in either
+source or binary form) with the major components (compiler, kernel, and so on)
+of the operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the source
+code from the same place counts as distribution of the source code, even though
+third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as
+expressly provided under this License. Any attempt otherwise to copy, modify,
+sublicense or distribute the Program is void, and will automatically terminate
+your rights under this License. However, parties who have received copies, or
+rights, from you under this License will not have their licenses terminated so
+long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it.
+However, nothing else grants you permission to modify or distribute the Program
+or its derivative works. These actions are prohibited by law if you do not
+accept this License. Therefore, by modifying or distributing the Program (or
+any work based on the Program), you indicate your acceptance of this License to
+do so, and all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program),
+the recipient automatically receives a license from the original licensor to
+copy, distribute or modify the Program subject to these terms and conditions.
+You may not impose any further restrictions on the recipients' exercise of the
+rights granted herein. You are not responsible for enforcing compliance by
+third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues), conditions
+are imposed on you (whether by court order, agreement or otherwise) that
+contradict the conditions of this License, they do not excuse you from the
+conditions of this License. If you cannot distribute so as to satisfy
+simultaneously your obligations under this License and any other pertinent
+obligations, then as a consequence you may not distribute the Program at all.
+For example, if a patent license would not permit royalty-free redistribution
+of the Program by all those who receive copies directly or indirectly through
+you, then the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply and
+the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or
+other property right claims or to contest validity of any such claims; this
+section has the sole purpose of protecting the integrity of the free software
+distribution system, which is implemented by public license practices. Many
+people have made generous contributions to the wide range of software
+distributed through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing to
+distribute software through any other system and a licensee cannot impose that
+choice.
+
+This section is intended to make thoroughly clear what is believed to be a
+consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain
+countries either by patents or by copyrighted interfaces, the original
+copyright holder who places the Program under this License may add an explicit
+geographical distribution limitation excluding those countries, so that
+distribution is permitted only in or among countries not thus excluded. In
+such case, this License incorporates the limitation as if written in the body
+of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the
+General Public License from time to time. Such new versions will be similar in
+spirit to the present version, but may differ in detail to address new problems
+or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any later
+version", you have the option of following the terms and conditions either of
+that version or of any later version published by the Free Software Foundation.
+If the Program does not specify a version number of this License, you may
+choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs
+whose distribution conditions are different, write to the author to ask for
+permission. For software which is copyrighted by the Free Software Foundation,
+write to the Free Software Foundation; we sometimes make exceptions for this.
+Our decision will be guided by the two goals of preserving the free status of
+all derivatives of our free software and of promoting the sharing and reuse of
+software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
+THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
+STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE
+PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
+PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE,
+YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
+ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE
+PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
+INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
+BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER
+OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible
+use to the public, the best way to achieve this is to make it free software
+which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to attach
+them to the start of each source file to most effectively convey the exclusion
+of warranty; and each file should have at least the "copyright" line and a
+pointer to where the full notice is found.
+
+ One line to give the program's name and a brief idea of what it does.
+
+ Copyright (C)
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this when it
+starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author Gnomovision comes
+ with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free
+ software, and you are welcome to redistribute it under certain conditions;
+ type 'show c' for details.
+
+The hypothetical commands 'show w' and 'show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may be
+called something other than 'show w' and 'show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your school,
+if any, to sign a "copyright disclaimer" for the program, if necessary. Here
+is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ 'Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ signature of Ty Coon, 1 April 1989
+
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General Public
+License instead of this License.
+
+
+"CLASSPATH" EXCEPTION TO THE GPL
+
+Certain source files distributed by Oracle America and/or its affiliates are
+subject to the following clarification and special exception to the GPL, but
+only where Oracle has expressly included in the particular source file's header
+the words "Oracle designates this particular file as subject to the "Classpath"
+exception as provided by Oracle in the LICENSE file that accompanied this code."
+
+ Linking this library statically or dynamically with other modules is making
+ a combined work based on this library. Thus, the terms and conditions of
+ the GNU General Public License cover the whole combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent modules,
+ and to copy and distribute the resulting executable under terms of your
+ choice, provided that you also meet, for each linked independent module,
+ the terms and conditions of the license of that module. An independent
+ module is a module which is not derived from or based on this library. If
+ you modify this library, you may extend this exception to your version of
+ the library, but you are not obligated to do so. If you do not wish to do
+ so, delete this exception statement from your version.
diff --git a/docs/javadoc/3.0/legal/jquery.md b/docs/javadoc/3.0/legal/jquery.md
new file mode 100644
index 000000000..d468b3183
--- /dev/null
+++ b/docs/javadoc/3.0/legal/jquery.md
@@ -0,0 +1,72 @@
+## jQuery v3.6.1
+
+### jQuery License
+```
+jQuery v 3.6.1
+Copyright OpenJS Foundation and other contributors, https://openjsf.org/
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+******************************************
+
+The jQuery JavaScript Library v3.6.1 also includes Sizzle.js
+
+Sizzle.js includes the following license:
+
+Copyright JS Foundation and other contributors, https://js.foundation/
+
+This software consists of voluntary contributions made by many
+individuals. For exact contribution history, see the revision history
+available at https://github.com/jquery/sizzle
+
+The following license applies to all parts of this software except as
+documented below:
+
+====
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+====
+
+All files located in the node_modules and external directories are
+externally maintained libraries used by this software which have their
+own licenses; we recommend you read them, as their terms may differ from
+the terms above.
+
+*********************
+
+```
diff --git a/docs/javadoc/3.0/legal/jqueryUI.md b/docs/javadoc/3.0/legal/jqueryUI.md
new file mode 100644
index 000000000..8bda9d7a8
--- /dev/null
+++ b/docs/javadoc/3.0/legal/jqueryUI.md
@@ -0,0 +1,49 @@
+## jQuery UI v1.13.2
+
+### jQuery UI License
+```
+Copyright jQuery Foundation and other contributors, https://jquery.org/
+
+This software consists of voluntary contributions made by many
+individuals. For exact contribution history, see the revision history
+available at https://github.com/jquery/jquery-ui
+
+The following license applies to all parts of this software except as
+documented below:
+
+====
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+====
+
+Copyright and related rights for sample code are waived via CC0. Sample
+code is defined as all source code contained within the demos directory.
+
+CC0: http://creativecommons.org/publicdomain/zero/1.0/
+
+====
+
+All files located in the node_modules and external directories are
+externally maintained libraries used by this software which have their
+own licenses; we recommend you read them, as their terms may differ from
+the terms above.
+
+```
diff --git a/docs/javadoc/3.0/link.svg b/docs/javadoc/3.0/link.svg
new file mode 100644
index 000000000..7ccc5ed08
--- /dev/null
+++ b/docs/javadoc/3.0/link.svg
@@ -0,0 +1,31 @@
+
+
+
+
+
diff --git a/docs/javadoc/3.0/member-search-index.js b/docs/javadoc/3.0/member-search-index.js
new file mode 100644
index 000000000..2c33b6f91
--- /dev/null
+++ b/docs/javadoc/3.0/member-search-index.js
@@ -0,0 +1 @@
+memberSearchIndex = [{"p":"org.hamcrest","c":"BaseMatcher","l":"_dont_implement_Matcher___instead_extend_BaseMatcher_()"},{"p":"org.hamcrest","c":"Matcher","l":"_dont_implement_Matcher___instead_extend_BaseMatcher_()"},{"p":"org.hamcrest.io","c":"FileMatchers","l":"aFileNamed(Matcher)","u":"aFileNamed(org.hamcrest.Matcher)"},{"p":"org.hamcrest.io","c":"FileMatchers","l":"aFileWithAbsolutePath(Matcher)","u":"aFileWithAbsolutePath(org.hamcrest.Matcher)"},{"p":"org.hamcrest.io","c":"FileMatchers","l":"aFileWithCanonicalPath(Matcher)","u":"aFileWithCanonicalPath(org.hamcrest.Matcher)"},{"p":"org.hamcrest.io","c":"FileMatchers","l":"aFileWithSize(long)"},{"p":"org.hamcrest.io","c":"FileMatchers","l":"aFileWithSize(Matcher)","u":"aFileWithSize(org.hamcrest.Matcher)"},{"p":"org.hamcrest.core","c":"AllOf","l":"allOf(Iterable>)","u":"allOf(java.lang.Iterable)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"allOf(Iterable>)","u":"allOf(java.lang.Iterable)"},{"p":"org.hamcrest","c":"Matchers","l":"allOf(Iterable>)","u":"allOf(java.lang.Iterable)"},{"p":"org.hamcrest.core","c":"AllOf","l":"AllOf(Iterable>)","u":"%3Cinit%3E(java.lang.Iterable)"},{"p":"org.hamcrest","c":"Matchers","l":"allOf(Matcher super T>, Matcher super T>)","u":"allOf(org.hamcrest.Matcher,org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"allOf(Matcher super T>, Matcher super T>, Matcher super T>)","u":"allOf(org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"allOf(Matcher super T>, Matcher super T>, Matcher super T>, Matcher super T>)","u":"allOf(org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"allOf(Matcher super T>, Matcher super T>, Matcher super T>, Matcher super T>, Matcher super T>)","u":"allOf(org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"allOf(Matcher super T>, Matcher super T>, Matcher super T>, Matcher super T>, Matcher super T>, Matcher super T>)","u":"allOf(org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher)"},{"p":"org.hamcrest.core","c":"AllOf","l":"allOf(Matcher super T>...)","u":"allOf(org.hamcrest.Matcher...)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"allOf(Matcher super T>...)","u":"allOf(org.hamcrest.Matcher...)"},{"p":"org.hamcrest","c":"Matchers","l":"allOf(Matcher super T>...)","u":"allOf(org.hamcrest.Matcher...)"},{"p":"org.hamcrest.core","c":"AllOf","l":"AllOf(Matcher super T>...)","u":"%3Cinit%3E(org.hamcrest.Matcher...)"},{"p":"org.hamcrest.collection","c":"IsMapWithSize","l":"aMapWithSize(int)"},{"p":"org.hamcrest","c":"Matchers","l":"aMapWithSize(int)"},{"p":"org.hamcrest.collection","c":"IsMapWithSize","l":"aMapWithSize(Matcher super Integer>)","u":"aMapWithSize(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"aMapWithSize(Matcher super Integer>)","u":"aMapWithSize(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Condition","l":"and(Condition.Step super T, U>)","u":"and(org.hamcrest.Condition.Step)"},{"p":"org.hamcrest.core","c":"CombinableMatcher","l":"and(Matcher super T>)","u":"and(org.hamcrest.Matcher)"},{"p":"org.hamcrest.core","c":"CombinableMatcher.CombinableBothMatcher","l":"and(Matcher super X>)","u":"and(org.hamcrest.Matcher)"},{"p":"org.hamcrest.collection","c":"IsMapWithSize","l":"anEmptyMap()"},{"p":"org.hamcrest","c":"Matchers","l":"anEmptyMap()"},{"p":"org.hamcrest.io","c":"FileMatchers","l":"anExistingDirectory()"},{"p":"org.hamcrest.io","c":"FileMatchers","l":"anExistingFile()"},{"p":"org.hamcrest.io","c":"FileMatchers","l":"anExistingFileOrDirectory()"},{"p":"org.hamcrest.core","c":"IsInstanceOf","l":"any(Class)","u":"any(java.lang.Class)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"any(Class)","u":"any(java.lang.Class)"},{"p":"org.hamcrest","c":"Matchers","l":"any(Class)","u":"any(java.lang.Class)"},{"p":"org.hamcrest.core","c":"AnyOf","l":"anyOf(Iterable>)","u":"anyOf(java.lang.Iterable)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"anyOf(Iterable>)","u":"anyOf(java.lang.Iterable)"},{"p":"org.hamcrest","c":"Matchers","l":"anyOf(Iterable>)","u":"anyOf(java.lang.Iterable)"},{"p":"org.hamcrest.core","c":"AnyOf","l":"AnyOf(Iterable>)","u":"%3Cinit%3E(java.lang.Iterable)"},{"p":"org.hamcrest","c":"Matchers","l":"anyOf(Matcher super T>, Matcher super T>)","u":"anyOf(org.hamcrest.Matcher,org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"anyOf(Matcher super T>, Matcher super T>, Matcher super T>)","u":"anyOf(org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"anyOf(Matcher super T>, Matcher super T>, Matcher super T>, Matcher super T>)","u":"anyOf(org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"anyOf(Matcher super T>, Matcher super T>, Matcher super T>, Matcher super T>, Matcher super T>)","u":"anyOf(org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"anyOf(Matcher super T>, Matcher super T>, Matcher super T>, Matcher super T>, Matcher super T>, Matcher super T>)","u":"anyOf(org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher,org.hamcrest.Matcher)"},{"p":"org.hamcrest.core","c":"AnyOf","l":"anyOf(Matcher super T>...)","u":"anyOf(org.hamcrest.Matcher...)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"anyOf(Matcher super T>...)","u":"anyOf(org.hamcrest.Matcher...)"},{"p":"org.hamcrest","c":"Matchers","l":"anyOf(Matcher super T>...)","u":"anyOf(org.hamcrest.Matcher...)"},{"p":"org.hamcrest.core","c":"AnyOf","l":"AnyOf(Matcher super T>...)","u":"%3Cinit%3E(org.hamcrest.Matcher...)"},{"p":"org.hamcrest.core","c":"IsAnything","l":"anything()"},{"p":"org.hamcrest","c":"CoreMatchers","l":"anything()"},{"p":"org.hamcrest","c":"Matchers","l":"anything()"},{"p":"org.hamcrest.core","c":"IsAnything","l":"anything(String)","u":"anything(java.lang.String)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"anything(String)","u":"anything(java.lang.String)"},{"p":"org.hamcrest","c":"Matchers","l":"anything(String)","u":"anything(java.lang.String)"},{"p":"org.hamcrest","c":"BaseDescription","l":"append(char)"},{"p":"org.hamcrest","c":"StringDescription","l":"append(char)"},{"p":"org.hamcrest","c":"BaseDescription","l":"append(String)","u":"append(java.lang.String)"},{"p":"org.hamcrest","c":"StringDescription","l":"append(String)","u":"append(java.lang.String)"},{"p":"org.hamcrest","c":"BaseDescription","l":"appendDescriptionOf(SelfDescribing)","u":"appendDescriptionOf(org.hamcrest.SelfDescribing)"},{"p":"org.hamcrest","c":"Description","l":"appendDescriptionOf(SelfDescribing)","u":"appendDescriptionOf(org.hamcrest.SelfDescribing)"},{"p":"org.hamcrest","c":"Description.NullDescription","l":"appendDescriptionOf(SelfDescribing)","u":"appendDescriptionOf(org.hamcrest.SelfDescribing)"},{"p":"org.hamcrest","c":"BaseDescription","l":"appendList(String, String, String, Iterable extends SelfDescribing>)","u":"appendList(java.lang.String,java.lang.String,java.lang.String,java.lang.Iterable)"},{"p":"org.hamcrest","c":"Description","l":"appendList(String, String, String, Iterable extends SelfDescribing>)","u":"appendList(java.lang.String,java.lang.String,java.lang.String,java.lang.Iterable)"},{"p":"org.hamcrest","c":"Description.NullDescription","l":"appendList(String, String, String, Iterable extends SelfDescribing>)","u":"appendList(java.lang.String,java.lang.String,java.lang.String,java.lang.Iterable)"},{"p":"org.hamcrest","c":"BaseDescription","l":"appendText(String)","u":"appendText(java.lang.String)"},{"p":"org.hamcrest","c":"Description","l":"appendText(String)","u":"appendText(java.lang.String)"},{"p":"org.hamcrest","c":"Description.NullDescription","l":"appendText(String)","u":"appendText(java.lang.String)"},{"p":"org.hamcrest","c":"BaseDescription","l":"appendValue(Object)","u":"appendValue(java.lang.Object)"},{"p":"org.hamcrest","c":"Description","l":"appendValue(Object)","u":"appendValue(java.lang.Object)"},{"p":"org.hamcrest","c":"Description.NullDescription","l":"appendValue(Object)","u":"appendValue(java.lang.Object)"},{"p":"org.hamcrest","c":"BaseDescription","l":"appendValueList(String, String, String, Iterable)","u":"appendValueList(java.lang.String,java.lang.String,java.lang.String,java.lang.Iterable)"},{"p":"org.hamcrest","c":"Description","l":"appendValueList(String, String, String, Iterable)","u":"appendValueList(java.lang.String,java.lang.String,java.lang.String,java.lang.Iterable)"},{"p":"org.hamcrest","c":"Description.NullDescription","l":"appendValueList(String, String, String, Iterable)","u":"appendValueList(java.lang.String,java.lang.String,java.lang.String,java.lang.Iterable)"},{"p":"org.hamcrest","c":"BaseDescription","l":"appendValueList(String, String, String, T...)","u":"appendValueList(java.lang.String,java.lang.String,java.lang.String,T...)"},{"p":"org.hamcrest","c":"Description","l":"appendValueList(String, String, String, T...)","u":"appendValueList(java.lang.String,java.lang.String,java.lang.String,T...)"},{"p":"org.hamcrest","c":"Description.NullDescription","l":"appendValueList(String, String, String, T...)","u":"appendValueList(java.lang.String,java.lang.String,java.lang.String,T...)"},{"p":"org.hamcrest","c":"Condition.Step","l":"apply(I, Description)","u":"apply(I,org.hamcrest.Description)"},{"p":"org.hamcrest.io","c":"FileMatchers","l":"aReadableFile()"},{"p":"org.hamcrest.collection","c":"IsArray","l":"array(Matcher super T>...)","u":"array(org.hamcrest.Matcher...)"},{"p":"org.hamcrest","c":"Matchers","l":"array(Matcher super T>...)","u":"array(org.hamcrest.Matcher...)"},{"p":"org.hamcrest.collection","c":"ArrayAsIterableMatcher","l":"ArrayAsIterableMatcher(TypeSafeDiagnosingMatcher>, Collection>, String)","u":"%3Cinit%3E(org.hamcrest.TypeSafeDiagnosingMatcher,java.util.Collection,java.lang.String)"},{"p":"org.hamcrest.collection","c":"ArrayMatching","l":"arrayContaining(E...)"},{"p":"org.hamcrest.collection","c":"IsArrayContainingInOrder","l":"arrayContaining(E...)"},{"p":"org.hamcrest","c":"Matchers","l":"arrayContaining(E...)"},{"p":"org.hamcrest.collection","c":"ArrayMatching","l":"arrayContaining(List>)","u":"arrayContaining(java.util.List)"},{"p":"org.hamcrest.collection","c":"IsArrayContainingInOrder","l":"arrayContaining(List>)","u":"arrayContaining(java.util.List)"},{"p":"org.hamcrest","c":"Matchers","l":"arrayContaining(List>)","u":"arrayContaining(java.util.List)"},{"p":"org.hamcrest.collection","c":"ArrayMatching","l":"arrayContaining(Matcher super E>...)","u":"arrayContaining(org.hamcrest.Matcher...)"},{"p":"org.hamcrest.collection","c":"IsArrayContainingInOrder","l":"arrayContaining(Matcher super E>...)","u":"arrayContaining(org.hamcrest.Matcher...)"},{"p":"org.hamcrest","c":"Matchers","l":"arrayContaining(Matcher super E>...)","u":"arrayContaining(org.hamcrest.Matcher...)"},{"p":"org.hamcrest.collection","c":"ArrayMatching","l":"arrayContainingInAnyOrder(Collection>)","u":"arrayContainingInAnyOrder(java.util.Collection)"},{"p":"org.hamcrest.collection","c":"IsArrayContainingInAnyOrder","l":"arrayContainingInAnyOrder(Collection>)","u":"arrayContainingInAnyOrder(java.util.Collection)"},{"p":"org.hamcrest","c":"Matchers","l":"arrayContainingInAnyOrder(Collection>)","u":"arrayContainingInAnyOrder(java.util.Collection)"},{"p":"org.hamcrest.collection","c":"ArrayMatching","l":"arrayContainingInAnyOrder(E...)"},{"p":"org.hamcrest.collection","c":"IsArrayContainingInAnyOrder","l":"arrayContainingInAnyOrder(E...)"},{"p":"org.hamcrest","c":"Matchers","l":"arrayContainingInAnyOrder(E...)"},{"p":"org.hamcrest.collection","c":"ArrayMatching","l":"arrayContainingInAnyOrder(Matcher super E>...)","u":"arrayContainingInAnyOrder(org.hamcrest.Matcher...)"},{"p":"org.hamcrest.collection","c":"IsArrayContainingInAnyOrder","l":"arrayContainingInAnyOrder(Matcher super E>...)","u":"arrayContainingInAnyOrder(org.hamcrest.Matcher...)"},{"p":"org.hamcrest","c":"Matchers","l":"arrayContainingInAnyOrder(Matcher super E>...)","u":"arrayContainingInAnyOrder(org.hamcrest.Matcher...)"},{"p":"org.hamcrest.collection","c":"IsArrayWithSize","l":"arrayWithSize(int)"},{"p":"org.hamcrest","c":"Matchers","l":"arrayWithSize(int)"},{"p":"org.hamcrest.collection","c":"IsArrayWithSize","l":"arrayWithSize(Matcher super Integer>)","u":"arrayWithSize(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"arrayWithSize(Matcher super Integer>)","u":"arrayWithSize(org.hamcrest.Matcher)"},{"p":"org.hamcrest.collection","c":"ArrayMatching","l":"asEqualMatchers(E[])"},{"p":"org.hamcrest","c":"MatcherAssert","l":"assertThat(String, boolean)","u":"assertThat(java.lang.String,boolean)"},{"p":"org.hamcrest","c":"MatcherAssert","l":"assertThat(String, T, Matcher super T>)","u":"assertThat(java.lang.String,T,org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"MatcherAssert","l":"assertThat(T, Matcher super T>)","u":"assertThat(T,org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"StringDescription","l":"asString(SelfDescribing)","u":"asString(org.hamcrest.SelfDescribing)"},{"p":"org.hamcrest.io","c":"FileMatchers","l":"aWritableFile()"},{"p":"org.hamcrest","c":"BaseDescription","l":"BaseDescription()","u":"%3Cinit%3E()"},{"p":"org.hamcrest","c":"BaseMatcher","l":"BaseMatcher()","u":"%3Cinit%3E()"},{"p":"org.hamcrest.number","c":"BigDecimalCloseTo","l":"BigDecimalCloseTo(BigDecimal, BigDecimal)","u":"%3Cinit%3E(java.math.BigDecimal,java.math.BigDecimal)"},{"p":"org.hamcrest","c":"Matchers","l":"blankOrNullString()"},{"p":"org.hamcrest.text","c":"IsBlankString","l":"blankOrNullString()"},{"p":"org.hamcrest","c":"Matchers","l":"blankString()"},{"p":"org.hamcrest.text","c":"IsBlankString","l":"blankString()"},{"p":"org.hamcrest.core","c":"CombinableMatcher","l":"both(Matcher super LHS>)","u":"both(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"both(Matcher super LHS>)","u":"both(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"both(Matcher super LHS>)","u":"both(org.hamcrest.Matcher)"},{"p":"org.hamcrest.io","c":"FileMatchers","l":"CAN_READ"},{"p":"org.hamcrest.io","c":"FileMatchers","l":"CAN_WRITE"},{"p":"org.hamcrest.text","c":"CharSequenceLength","l":"CharSequenceLength(Matcher super Integer>)","u":"%3Cinit%3E(org.hamcrest.Matcher)"},{"p":"org.hamcrest.io","c":"FileMatchers.FileStatus","l":"check(File)","u":"check(java.io.File)"},{"p":"org.hamcrest","c":"Matchers","l":"closeTo(BigDecimal, BigDecimal)","u":"closeTo(java.math.BigDecimal,java.math.BigDecimal)"},{"p":"org.hamcrest.number","c":"BigDecimalCloseTo","l":"closeTo(BigDecimal, BigDecimal)","u":"closeTo(java.math.BigDecimal,java.math.BigDecimal)"},{"p":"org.hamcrest","c":"Matchers","l":"closeTo(double, double)","u":"closeTo(double,double)"},{"p":"org.hamcrest.number","c":"IsCloseTo","l":"closeTo(double, double)","u":"closeTo(double,double)"},{"p":"org.hamcrest.core","c":"CombinableMatcher.CombinableBothMatcher","l":"CombinableBothMatcher(Matcher super X>)","u":"%3Cinit%3E(org.hamcrest.Matcher)"},{"p":"org.hamcrest.core","c":"CombinableMatcher.CombinableEitherMatcher","l":"CombinableEitherMatcher(Matcher super X>)","u":"%3Cinit%3E(org.hamcrest.Matcher)"},{"p":"org.hamcrest.core","c":"CombinableMatcher","l":"CombinableMatcher(Matcher super T>)","u":"%3Cinit%3E(org.hamcrest.Matcher)"},{"p":"org.hamcrest.comparator","c":"ComparatorMatcherBuilder","l":"comparedBy(Comparator)","u":"comparedBy(java.util.Comparator)"},{"p":"org.hamcrest.comparator","c":"ComparatorMatcherBuilder","l":"comparesEqualTo(T)"},{"p":"org.hamcrest","c":"Matchers","l":"comparesEqualTo(T)"},{"p":"org.hamcrest.number","c":"OrderingComparison","l":"comparesEqualTo(T)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInOrder","l":"contains(E...)"},{"p":"org.hamcrest","c":"Matchers","l":"contains(E...)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInOrder","l":"contains(List>)","u":"contains(java.util.List)"},{"p":"org.hamcrest","c":"Matchers","l":"contains(List>)","u":"contains(java.util.List)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInOrder","l":"contains(Matcher super E>)","u":"contains(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"contains(Matcher super E>)","u":"contains(org.hamcrest.Matcher)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInOrder","l":"contains(Matcher super E>...)","u":"contains(org.hamcrest.Matcher...)"},{"p":"org.hamcrest","c":"Matchers","l":"contains(Matcher super E>...)","u":"contains(org.hamcrest.Matcher...)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInAnyOrder","l":"containsInAnyOrder(Collection>)","u":"containsInAnyOrder(java.util.Collection)"},{"p":"org.hamcrest","c":"Matchers","l":"containsInAnyOrder(Collection>)","u":"containsInAnyOrder(java.util.Collection)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInAnyOrder","l":"containsInAnyOrder(Matcher super T>...)","u":"containsInAnyOrder(org.hamcrest.Matcher...)"},{"p":"org.hamcrest","c":"Matchers","l":"containsInAnyOrder(Matcher super T>...)","u":"containsInAnyOrder(org.hamcrest.Matcher...)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInAnyOrder","l":"containsInAnyOrder(T...)"},{"p":"org.hamcrest","c":"Matchers","l":"containsInAnyOrder(T...)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInRelativeOrder","l":"containsInRelativeOrder(E...)"},{"p":"org.hamcrest","c":"Matchers","l":"containsInRelativeOrder(E...)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInRelativeOrder","l":"containsInRelativeOrder(List>)","u":"containsInRelativeOrder(java.util.List)"},{"p":"org.hamcrest","c":"Matchers","l":"containsInRelativeOrder(List>)","u":"containsInRelativeOrder(java.util.List)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInRelativeOrder","l":"containsInRelativeOrder(Matcher super E>...)","u":"containsInRelativeOrder(org.hamcrest.Matcher...)"},{"p":"org.hamcrest","c":"Matchers","l":"containsInRelativeOrder(Matcher super E>...)","u":"containsInRelativeOrder(org.hamcrest.Matcher...)"},{"p":"org.hamcrest.core","c":"StringContains","l":"containsString(String)","u":"containsString(java.lang.String)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"containsString(String)","u":"containsString(java.lang.String)"},{"p":"org.hamcrest","c":"Matchers","l":"containsString(String)","u":"containsString(java.lang.String)"},{"p":"org.hamcrest.core","c":"StringContains","l":"containsStringIgnoringCase(String)","u":"containsStringIgnoringCase(java.lang.String)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"containsStringIgnoringCase(String)","u":"containsStringIgnoringCase(java.lang.String)"},{"p":"org.hamcrest","c":"Matchers","l":"containsStringIgnoringCase(String)","u":"containsStringIgnoringCase(java.lang.String)"},{"p":"org.hamcrest.core","c":"SubstringMatcher","l":"converted(String)","u":"converted(java.lang.String)"},{"p":"org.hamcrest","c":"CustomMatcher","l":"CustomMatcher(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"org.hamcrest","c":"CustomTypeSafeMatcher","l":"CustomTypeSafeMatcher(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"org.hamcrest.core","c":"DescribedAs","l":"describedAs(String, Matcher, Object...)","u":"describedAs(java.lang.String,org.hamcrest.Matcher,java.lang.Object...)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"describedAs(String, Matcher, Object...)","u":"describedAs(java.lang.String,org.hamcrest.Matcher,java.lang.Object...)"},{"p":"org.hamcrest","c":"Matchers","l":"describedAs(String, Matcher, Object...)","u":"describedAs(java.lang.String,org.hamcrest.Matcher,java.lang.Object...)"},{"p":"org.hamcrest.core","c":"DescribedAs","l":"DescribedAs(String, Matcher, Object[])","u":"%3Cinit%3E(java.lang.String,org.hamcrest.Matcher,java.lang.Object[])"},{"p":"org.hamcrest","c":"BaseMatcher","l":"describeMismatch(Object, Description)","u":"describeMismatch(java.lang.Object,org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"DescribedAs","l":"describeMismatch(Object, Description)","u":"describeMismatch(java.lang.Object,org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"Is","l":"describeMismatch(Object, Description)","u":"describeMismatch(java.lang.Object,org.hamcrest.Description)"},{"p":"org.hamcrest","c":"DiagnosingMatcher","l":"describeMismatch(Object, Description)","u":"describeMismatch(java.lang.Object,org.hamcrest.Description)"},{"p":"org.hamcrest","c":"Matcher","l":"describeMismatch(Object, Description)","u":"describeMismatch(java.lang.Object,org.hamcrest.Description)"},{"p":"org.hamcrest","c":"TypeSafeDiagnosingMatcher","l":"describeMismatch(Object, Description)","u":"describeMismatch(java.lang.Object,org.hamcrest.Description)"},{"p":"org.hamcrest","c":"TypeSafeMatcher","l":"describeMismatch(Object, Description)","u":"describeMismatch(java.lang.Object,org.hamcrest.Description)"},{"p":"org.hamcrest.number","c":"BigDecimalCloseTo","l":"describeMismatchSafely(BigDecimal, Description)","u":"describeMismatchSafely(java.math.BigDecimal,org.hamcrest.Description)"},{"p":"org.hamcrest.object","c":"IsCompatibleType","l":"describeMismatchSafely(Class>, Description)","u":"describeMismatchSafely(java.lang.Class,org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsEmptyCollection","l":"describeMismatchSafely(Collection extends E>, Description)","u":"describeMismatchSafely(java.util.Collection,org.hamcrest.Description)"},{"p":"org.hamcrest.number","c":"IsCloseTo","l":"describeMismatchSafely(Double, Description)","u":"describeMismatchSafely(java.lang.Double,org.hamcrest.Description)"},{"p":"org.hamcrest.number","c":"IsNaN","l":"describeMismatchSafely(Double, Description)","u":"describeMismatchSafely(java.lang.Double,org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"ArrayAsIterableMatcher","l":"describeMismatchSafely(E[], Description)","u":"describeMismatchSafely(E[],org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsArrayContainingInAnyOrder","l":"describeMismatchSafely(E[], Description)","u":"describeMismatchSafely(E[],org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsArrayContainingInOrder","l":"describeMismatchSafely(E[], Description)","u":"describeMismatchSafely(E[],org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsEmptyIterable","l":"describeMismatchSafely(Iterable extends E>, Description)","u":"describeMismatchSafely(java.lang.Iterable,org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsMapContaining","l":"describeMismatchSafely(Map extends K, ? extends V>, Description)","u":"describeMismatchSafely(java.util.Map,org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"SubstringMatcher","l":"describeMismatchSafely(String, Description)","u":"describeMismatchSafely(java.lang.String,org.hamcrest.Description)"},{"p":"org.hamcrest.text","c":"IsEqualCompressingWhiteSpace","l":"describeMismatchSafely(String, Description)","u":"describeMismatchSafely(java.lang.String,org.hamcrest.Description)"},{"p":"org.hamcrest.text","c":"IsEqualIgnoringCase","l":"describeMismatchSafely(String, Description)","u":"describeMismatchSafely(java.lang.String,org.hamcrest.Description)"},{"p":"org.hamcrest.text","c":"StringContainsInOrder","l":"describeMismatchSafely(String, Description)","u":"describeMismatchSafely(java.lang.String,org.hamcrest.Description)"},{"p":"org.hamcrest.beans","c":"HasProperty","l":"describeMismatchSafely(T, Description)","u":"describeMismatchSafely(T,org.hamcrest.Description)"},{"p":"org.hamcrest","c":"TypeSafeMatcher","l":"describeMismatchSafely(T, Description)","u":"describeMismatchSafely(T,org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"HasItemInArray","l":"describeMismatchSafely(T[], Description)","u":"describeMismatchSafely(T[],org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsArray","l":"describeMismatchSafely(T[], Description)","u":"describeMismatchSafely(T[],org.hamcrest.Description)"},{"p":"org.hamcrest.beans","c":"HasProperty","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.beans","c":"HasPropertyWithValue","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.beans","c":"SamePropertyValuesAs","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"ArrayAsIterableMatcher","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"HasItemInArray","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsArray","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsArrayContainingInAnyOrder","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsArrayContainingInOrder","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsEmptyCollection","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsEmptyIterable","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsIn","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInAnyOrder","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInOrder","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInRelativeOrder","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsMapContaining","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"AllOf","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"AnyOf","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"CombinableMatcher","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"DescribedAs","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"Every","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"Is","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"IsAnything","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"IsCollectionContaining","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"IsEqual","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"IsInstanceOf","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"IsIterableContaining","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"IsNot","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"IsNull","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"IsSame","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"StringRegularExpression","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"SubstringMatcher","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest","c":"CustomMatcher","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest","c":"CustomTypeSafeMatcher","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest","c":"FeatureMatcher","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.number","c":"BigDecimalCloseTo","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.number","c":"IsCloseTo","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.number","c":"IsNaN","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.object","c":"HasEqualValues","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.object","c":"IsCompatibleType","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.object","c":"IsEventFrom","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest","c":"SelfDescribing","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.text","c":"IsBlankString","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.text","c":"IsEmptyString","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.text","c":"IsEqualCompressingWhiteSpace","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.text","c":"IsEqualIgnoringCase","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.text","c":"MatchesPattern","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.text","c":"StringContainsInOrder","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.xml","c":"HasXPath","l":"describeTo(Description)","u":"describeTo(org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"AnyOf","l":"describeTo(Description, String)","u":"describeTo(org.hamcrest.Description,java.lang.String)"},{"p":"org.hamcrest.collection","c":"IsArray","l":"descriptionEnd()"},{"p":"org.hamcrest.collection","c":"IsArray","l":"descriptionSeparator()"},{"p":"org.hamcrest.collection","c":"IsArray","l":"descriptionStart()"},{"p":"org.hamcrest","c":"DiagnosingMatcher","l":"DiagnosingMatcher()","u":"%3Cinit%3E()"},{"p":"org.hamcrest.core","c":"CombinableMatcher","l":"either(Matcher super LHS>)","u":"either(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"either(Matcher super LHS>)","u":"either(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"either(Matcher super LHS>)","u":"either(org.hamcrest.Matcher)"},{"p":"org.hamcrest.collection","c":"IsEmptyCollection","l":"empty()"},{"p":"org.hamcrest","c":"Matchers","l":"empty()"},{"p":"org.hamcrest.collection","c":"IsArrayWithSize","l":"emptyArray()"},{"p":"org.hamcrest","c":"Matchers","l":"emptyArray()"},{"p":"org.hamcrest.collection","c":"IsEmptyCollection","l":"emptyCollectionOf(Class)","u":"emptyCollectionOf(java.lang.Class)"},{"p":"org.hamcrest","c":"Matchers","l":"emptyCollectionOf(Class)","u":"emptyCollectionOf(java.lang.Class)"},{"p":"org.hamcrest.collection","c":"IsEmptyIterable","l":"emptyIterable()"},{"p":"org.hamcrest","c":"Matchers","l":"emptyIterable()"},{"p":"org.hamcrest.collection","c":"IsEmptyIterable","l":"emptyIterableOf(Class)","u":"emptyIterableOf(java.lang.Class)"},{"p":"org.hamcrest","c":"Matchers","l":"emptyIterableOf(Class)","u":"emptyIterableOf(java.lang.Class)"},{"p":"org.hamcrest","c":"Matchers","l":"emptyOrNullString()"},{"p":"org.hamcrest.text","c":"IsEmptyString","l":"emptyOrNullString()"},{"p":"org.hamcrest","c":"Matchers","l":"emptyString()"},{"p":"org.hamcrest.text","c":"IsEmptyString","l":"emptyString()"},{"p":"org.hamcrest.core","c":"StringEndsWith","l":"endsWith(String)","u":"endsWith(java.lang.String)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"endsWith(String)","u":"endsWith(java.lang.String)"},{"p":"org.hamcrest","c":"Matchers","l":"endsWith(String)","u":"endsWith(java.lang.String)"},{"p":"org.hamcrest.core","c":"StringEndsWith","l":"endsWithIgnoringCase(String)","u":"endsWithIgnoringCase(java.lang.String)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"endsWithIgnoringCase(String)","u":"endsWithIgnoringCase(java.lang.String)"},{"p":"org.hamcrest","c":"Matchers","l":"endsWithIgnoringCase(String)","u":"endsWithIgnoringCase(java.lang.String)"},{"p":"org.hamcrest.core","c":"IsEqual","l":"equalTo(T)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"equalTo(T)"},{"p":"org.hamcrest","c":"Matchers","l":"equalTo(T)"},{"p":"org.hamcrest","c":"Matchers","l":"equalToCompressingWhiteSpace(String)","u":"equalToCompressingWhiteSpace(java.lang.String)"},{"p":"org.hamcrest.text","c":"IsEqualCompressingWhiteSpace","l":"equalToCompressingWhiteSpace(String)","u":"equalToCompressingWhiteSpace(java.lang.String)"},{"p":"org.hamcrest","c":"Matchers","l":"equalToIgnoringCase(String)","u":"equalToIgnoringCase(java.lang.String)"},{"p":"org.hamcrest.text","c":"IsEqualIgnoringCase","l":"equalToIgnoringCase(String)","u":"equalToIgnoringCase(java.lang.String)"},{"p":"org.hamcrest","c":"Matchers","l":"equalToIgnoringWhiteSpace(String)","u":"equalToIgnoringWhiteSpace(java.lang.String)"},{"p":"org.hamcrest.text","c":"IsEqualCompressingWhiteSpace","l":"equalToIgnoringWhiteSpace(String)","u":"equalToIgnoringWhiteSpace(java.lang.String)"},{"p":"org.hamcrest.core","c":"IsEqual","l":"equalToObject(Object)","u":"equalToObject(java.lang.Object)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"equalToObject(Object)","u":"equalToObject(java.lang.Object)"},{"p":"org.hamcrest","c":"Matchers","l":"equalToObject(Object)","u":"equalToObject(java.lang.Object)"},{"p":"org.hamcrest.core","c":"StringContains","l":"evalSubstringOf(String)","u":"evalSubstringOf(java.lang.String)"},{"p":"org.hamcrest.core","c":"StringEndsWith","l":"evalSubstringOf(String)","u":"evalSubstringOf(java.lang.String)"},{"p":"org.hamcrest.core","c":"StringStartsWith","l":"evalSubstringOf(String)","u":"evalSubstringOf(java.lang.String)"},{"p":"org.hamcrest.core","c":"SubstringMatcher","l":"evalSubstringOf(String)","u":"evalSubstringOf(java.lang.String)"},{"p":"org.hamcrest","c":"Matchers","l":"eventFrom(Class extends EventObject>, Object)","u":"eventFrom(java.lang.Class,java.lang.Object)"},{"p":"org.hamcrest.object","c":"IsEventFrom","l":"eventFrom(Class extends EventObject>, Object)","u":"eventFrom(java.lang.Class,java.lang.Object)"},{"p":"org.hamcrest","c":"Matchers","l":"eventFrom(Object)","u":"eventFrom(java.lang.Object)"},{"p":"org.hamcrest.object","c":"IsEventFrom","l":"eventFrom(Object)","u":"eventFrom(java.lang.Object)"},{"p":"org.hamcrest.core","c":"Every","l":"Every(Matcher super T>)","u":"%3Cinit%3E(org.hamcrest.Matcher)"},{"p":"org.hamcrest.core","c":"Every","l":"everyItem(Matcher)","u":"everyItem(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"everyItem(Matcher)","u":"everyItem(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"everyItem(Matcher)","u":"everyItem(org.hamcrest.Matcher)"},{"p":"org.hamcrest.io","c":"FileMatchers","l":"EXISTS"},{"p":"org.hamcrest","c":"FeatureMatcher","l":"FeatureMatcher(Matcher super U>, String, String)","u":"%3Cinit%3E(org.hamcrest.Matcher,java.lang.String,java.lang.String)"},{"p":"org.hamcrest.text","c":"CharSequenceLength","l":"featureValueOf(CharSequence)","u":"featureValueOf(java.lang.CharSequence)"},{"p":"org.hamcrest.collection","c":"IsCollectionWithSize","l":"featureValueOf(Collection extends E>)","u":"featureValueOf(java.util.Collection)"},{"p":"org.hamcrest.collection","c":"IsArrayWithSize","l":"featureValueOf(E[])"},{"p":"org.hamcrest.collection","c":"IsIterableWithSize","l":"featureValueOf(Iterable)","u":"featureValueOf(java.lang.Iterable)"},{"p":"org.hamcrest.collection","c":"IsMapWithSize","l":"featureValueOf(Map extends K, ? extends V>)","u":"featureValueOf(java.util.Map)"},{"p":"org.hamcrest","c":"FeatureMatcher","l":"featureValueOf(T)"},{"p":"org.hamcrest.object","c":"HasToString","l":"featureValueOf(T)"},{"p":"org.hamcrest.beans","c":"PropertyUtil","l":"getPropertyDescriptor(String, Object)","u":"getPropertyDescriptor(java.lang.String,java.lang.Object)"},{"p":"org.hamcrest.text","c":"IsEqualCompressingWhiteSpace","l":"getString()"},{"p":"org.hamcrest.comparator","c":"ComparatorMatcherBuilder","l":"greaterThan(T)"},{"p":"org.hamcrest","c":"Matchers","l":"greaterThan(T)"},{"p":"org.hamcrest.number","c":"OrderingComparison","l":"greaterThan(T)"},{"p":"org.hamcrest.comparator","c":"ComparatorMatcherBuilder","l":"greaterThanOrEqualTo(T)"},{"p":"org.hamcrest","c":"Matchers","l":"greaterThanOrEqualTo(T)"},{"p":"org.hamcrest.number","c":"OrderingComparison","l":"greaterThanOrEqualTo(T)"},{"p":"org.hamcrest.collection","c":"IsMapContaining","l":"hasEntry(K, V)","u":"hasEntry(K,V)"},{"p":"org.hamcrest","c":"Matchers","l":"hasEntry(K, V)","u":"hasEntry(K,V)"},{"p":"org.hamcrest.collection","c":"IsMapContaining","l":"hasEntry(Matcher super K>, Matcher super V>)","u":"hasEntry(org.hamcrest.Matcher,org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"hasEntry(Matcher super K>, Matcher super V>)","u":"hasEntry(org.hamcrest.Matcher,org.hamcrest.Matcher)"},{"p":"org.hamcrest.object","c":"HasEqualValues","l":"HasEqualValues(T)","u":"%3Cinit%3E(T)"},{"p":"org.hamcrest.core","c":"IsCollectionContaining","l":"hasItem(Matcher super T>)","u":"hasItem(org.hamcrest.Matcher)"},{"p":"org.hamcrest.core","c":"IsIterableContaining","l":"hasItem(Matcher super T>)","u":"hasItem(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"hasItem(Matcher super T>)","u":"hasItem(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"hasItem(Matcher super T>)","u":"hasItem(org.hamcrest.Matcher)"},{"p":"org.hamcrest.core","c":"IsCollectionContaining","l":"hasItem(T)"},{"p":"org.hamcrest.core","c":"IsIterableContaining","l":"hasItem(T)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"hasItem(T)"},{"p":"org.hamcrest","c":"Matchers","l":"hasItem(T)"},{"p":"org.hamcrest.collection","c":"ArrayMatching","l":"hasItemInArray(Matcher super T>)","u":"hasItemInArray(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"hasItemInArray(Matcher super T>)","u":"hasItemInArray(org.hamcrest.Matcher)"},{"p":"org.hamcrest.collection","c":"HasItemInArray","l":"HasItemInArray(Matcher super T>)","u":"%3Cinit%3E(org.hamcrest.Matcher)"},{"p":"org.hamcrest.collection","c":"ArrayMatching","l":"hasItemInArray(T)"},{"p":"org.hamcrest","c":"Matchers","l":"hasItemInArray(T)"},{"p":"org.hamcrest.core","c":"IsCollectionContaining","l":"hasItems(Matcher super T>...)","u":"hasItems(org.hamcrest.Matcher...)"},{"p":"org.hamcrest.core","c":"IsIterableContaining","l":"hasItems(Matcher super T>...)","u":"hasItems(org.hamcrest.Matcher...)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"hasItems(Matcher super T>...)","u":"hasItems(org.hamcrest.Matcher...)"},{"p":"org.hamcrest","c":"Matchers","l":"hasItems(Matcher super T>...)","u":"hasItems(org.hamcrest.Matcher...)"},{"p":"org.hamcrest.core","c":"IsCollectionContaining","l":"hasItems(T...)"},{"p":"org.hamcrest.core","c":"IsIterableContaining","l":"hasItems(T...)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"hasItems(T...)"},{"p":"org.hamcrest","c":"Matchers","l":"hasItems(T...)"},{"p":"org.hamcrest.collection","c":"IsMapContaining","l":"hasKey(K)"},{"p":"org.hamcrest","c":"Matchers","l":"hasKey(K)"},{"p":"org.hamcrest.collection","c":"IsMapContaining","l":"hasKey(Matcher super K>)","u":"hasKey(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"hasKey(Matcher super K>)","u":"hasKey(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"hasLength(int)"},{"p":"org.hamcrest.text","c":"CharSequenceLength","l":"hasLength(int)"},{"p":"org.hamcrest","c":"Matchers","l":"hasLength(Matcher super Integer>)","u":"hasLength(org.hamcrest.Matcher)"},{"p":"org.hamcrest.text","c":"CharSequenceLength","l":"hasLength(Matcher super Integer>)","u":"hasLength(org.hamcrest.Matcher)"},{"p":"org.hamcrest.beans","c":"HasProperty","l":"hasProperty(String)","u":"hasProperty(java.lang.String)"},{"p":"org.hamcrest","c":"Matchers","l":"hasProperty(String)","u":"hasProperty(java.lang.String)"},{"p":"org.hamcrest.beans","c":"HasProperty","l":"HasProperty(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"org.hamcrest.beans","c":"HasPropertyWithValue","l":"hasProperty(String, Matcher>)","u":"hasProperty(java.lang.String,org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"hasProperty(String, Matcher>)","u":"hasProperty(java.lang.String,org.hamcrest.Matcher)"},{"p":"org.hamcrest.beans","c":"HasPropertyWithValue","l":"hasPropertyAtPath(String, Matcher)","u":"hasPropertyAtPath(java.lang.String,org.hamcrest.Matcher)"},{"p":"org.hamcrest.beans","c":"HasPropertyWithValue","l":"HasPropertyWithValue(String, Matcher>)","u":"%3Cinit%3E(java.lang.String,org.hamcrest.Matcher)"},{"p":"org.hamcrest.beans","c":"HasPropertyWithValue","l":"HasPropertyWithValue(String, Matcher>, String)","u":"%3Cinit%3E(java.lang.String,org.hamcrest.Matcher,java.lang.String)"},{"p":"org.hamcrest.collection","c":"IsCollectionWithSize","l":"hasSize(int)"},{"p":"org.hamcrest","c":"Matchers","l":"hasSize(int)"},{"p":"org.hamcrest.collection","c":"IsCollectionWithSize","l":"hasSize(Matcher super Integer>)","u":"hasSize(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"hasSize(Matcher super Integer>)","u":"hasSize(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"hasToString(Matcher super String>)","u":"hasToString(org.hamcrest.Matcher)"},{"p":"org.hamcrest.object","c":"HasToString","l":"hasToString(Matcher super String>)","u":"hasToString(org.hamcrest.Matcher)"},{"p":"org.hamcrest.object","c":"HasToString","l":"HasToString(Matcher super String>)","u":"%3Cinit%3E(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"hasToString(String)","u":"hasToString(java.lang.String)"},{"p":"org.hamcrest.object","c":"HasToString","l":"hasToString(String)","u":"hasToString(java.lang.String)"},{"p":"org.hamcrest.collection","c":"IsMapContaining","l":"hasValue(Matcher super V>)","u":"hasValue(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"hasValue(Matcher super V>)","u":"hasValue(org.hamcrest.Matcher)"},{"p":"org.hamcrest.collection","c":"IsMapContaining","l":"hasValue(V)"},{"p":"org.hamcrest","c":"Matchers","l":"hasValue(V)"},{"p":"org.hamcrest","c":"Matchers","l":"hasXPath(String)","u":"hasXPath(java.lang.String)"},{"p":"org.hamcrest.xml","c":"HasXPath","l":"hasXPath(String)","u":"hasXPath(java.lang.String)"},{"p":"org.hamcrest","c":"Matchers","l":"hasXPath(String, Matcher)","u":"hasXPath(java.lang.String,org.hamcrest.Matcher)"},{"p":"org.hamcrest.xml","c":"HasXPath","l":"hasXPath(String, Matcher)","u":"hasXPath(java.lang.String,org.hamcrest.Matcher)"},{"p":"org.hamcrest.xml","c":"HasXPath","l":"HasXPath(String, Matcher)","u":"%3Cinit%3E(java.lang.String,org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"hasXPath(String, NamespaceContext)","u":"hasXPath(java.lang.String,javax.xml.namespace.NamespaceContext)"},{"p":"org.hamcrest.xml","c":"HasXPath","l":"hasXPath(String, NamespaceContext)","u":"hasXPath(java.lang.String,javax.xml.namespace.NamespaceContext)"},{"p":"org.hamcrest","c":"Matchers","l":"hasXPath(String, NamespaceContext, Matcher)","u":"hasXPath(java.lang.String,javax.xml.namespace.NamespaceContext,org.hamcrest.Matcher)"},{"p":"org.hamcrest.xml","c":"HasXPath","l":"hasXPath(String, NamespaceContext, Matcher)","u":"hasXPath(java.lang.String,javax.xml.namespace.NamespaceContext,org.hamcrest.Matcher)"},{"p":"org.hamcrest.xml","c":"HasXPath","l":"HasXPath(String, NamespaceContext, Matcher)","u":"%3Cinit%3E(java.lang.String,javax.xml.namespace.NamespaceContext,org.hamcrest.Matcher)"},{"p":"org.hamcrest.collection","c":"IsIn","l":"in(Collection)","u":"in(java.util.Collection)"},{"p":"org.hamcrest","c":"Matchers","l":"in(Collection)","u":"in(java.util.Collection)"},{"p":"org.hamcrest.collection","c":"IsIn","l":"in(T[])"},{"p":"org.hamcrest","c":"Matchers","l":"in(T[])"},{"p":"org.hamcrest.core","c":"IsInstanceOf","l":"instanceOf(Class>)","u":"instanceOf(java.lang.Class)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"instanceOf(Class>)","u":"instanceOf(java.lang.Class)"},{"p":"org.hamcrest","c":"Matchers","l":"instanceOf(Class>)","u":"instanceOf(java.lang.Class)"},{"p":"org.hamcrest.io","c":"FileMatchers","l":"IS_DIRECTORY"},{"p":"org.hamcrest.io","c":"FileMatchers","l":"IS_FILE"},{"p":"org.hamcrest.core","c":"Is","l":"is(Matcher)","u":"is(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"is(Matcher)","u":"is(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"is(Matcher)","u":"is(org.hamcrest.Matcher)"},{"p":"org.hamcrest.core","c":"Is","l":"Is(Matcher)","u":"%3Cinit%3E(org.hamcrest.Matcher)"},{"p":"org.hamcrest.core","c":"Is","l":"is(T)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"is(T)"},{"p":"org.hamcrest","c":"Matchers","l":"is(T)"},{"p":"org.hamcrest.core","c":"Is","l":"isA(Class>)","u":"isA(java.lang.Class)"},{"p":"org.hamcrest","c":"Matchers","l":"isA(Class>)","u":"isA(java.lang.Class)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"isA(Class)","u":"isA(java.lang.Class)"},{"p":"org.hamcrest.core","c":"IsAnything","l":"IsAnything()","u":"%3Cinit%3E()"},{"p":"org.hamcrest.core","c":"IsAnything","l":"IsAnything(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"org.hamcrest.collection","c":"IsArray","l":"IsArray(Matcher super T>[])","u":"%3Cinit%3E(org.hamcrest.Matcher[])"},{"p":"org.hamcrest.collection","c":"IsArrayContainingInAnyOrder","l":"IsArrayContainingInAnyOrder(Collection>)","u":"%3Cinit%3E(java.util.Collection)"},{"p":"org.hamcrest.collection","c":"IsArrayContainingInOrder","l":"IsArrayContainingInOrder(List>)","u":"%3Cinit%3E(java.util.List)"},{"p":"org.hamcrest.collection","c":"IsArrayWithSize","l":"IsArrayWithSize(Matcher super Integer>)","u":"%3Cinit%3E(org.hamcrest.Matcher)"},{"p":"org.hamcrest.number","c":"IsCloseTo","l":"IsCloseTo(double, double)","u":"%3Cinit%3E(double,double)"},{"p":"org.hamcrest.core","c":"IsCollectionContaining","l":"IsCollectionContaining(Matcher super T>)","u":"%3Cinit%3E(org.hamcrest.Matcher)"},{"p":"org.hamcrest.collection","c":"IsCollectionWithSize","l":"IsCollectionWithSize(Matcher super Integer>)","u":"%3Cinit%3E(org.hamcrest.Matcher)"},{"p":"org.hamcrest.object","c":"IsCompatibleType","l":"IsCompatibleType(Class)","u":"%3Cinit%3E(java.lang.Class)"},{"p":"org.hamcrest.collection","c":"IsEmptyCollection","l":"IsEmptyCollection()","u":"%3Cinit%3E()"},{"p":"org.hamcrest.collection","c":"IsEmptyIterable","l":"IsEmptyIterable()","u":"%3Cinit%3E()"},{"p":"org.hamcrest","c":"Matchers","l":"isEmptyOrNullString()"},{"p":"org.hamcrest.text","c":"IsEmptyString","l":"isEmptyOrNullString()"},{"p":"org.hamcrest","c":"Matchers","l":"isEmptyString()"},{"p":"org.hamcrest.text","c":"IsEmptyString","l":"isEmptyString()"},{"p":"org.hamcrest.core","c":"IsEqual","l":"IsEqual(T)","u":"%3Cinit%3E(T)"},{"p":"org.hamcrest.text","c":"IsEqualCompressingWhiteSpace","l":"IsEqualCompressingWhiteSpace(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"org.hamcrest.text","c":"IsEqualIgnoringCase","l":"IsEqualIgnoringCase(String)","u":"%3Cinit%3E(java.lang.String)"},{"p":"org.hamcrest.object","c":"IsEventFrom","l":"IsEventFrom(Class>, Object)","u":"%3Cinit%3E(java.lang.Class,java.lang.Object)"},{"p":"org.hamcrest.collection","c":"IsIn","l":"isIn(Collection)","u":"isIn(java.util.Collection)"},{"p":"org.hamcrest","c":"Matchers","l":"isIn(Collection)","u":"isIn(java.util.Collection)"},{"p":"org.hamcrest.collection","c":"IsIn","l":"IsIn(Collection)","u":"%3Cinit%3E(java.util.Collection)"},{"p":"org.hamcrest.collection","c":"IsIn","l":"isIn(T[])"},{"p":"org.hamcrest","c":"Matchers","l":"isIn(T[])"},{"p":"org.hamcrest.collection","c":"IsIn","l":"IsIn(T[])","u":"%3Cinit%3E(T[])"},{"p":"org.hamcrest.core","c":"IsInstanceOf","l":"IsInstanceOf(Class>)","u":"%3Cinit%3E(java.lang.Class)"},{"p":"org.hamcrest.core","c":"IsIterableContaining","l":"IsIterableContaining(Matcher super T>)","u":"%3Cinit%3E(org.hamcrest.Matcher)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInAnyOrder","l":"IsIterableContainingInAnyOrder(Collection>)","u":"%3Cinit%3E(java.util.Collection)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInOrder","l":"IsIterableContainingInOrder(List>)","u":"%3Cinit%3E(java.util.List)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInRelativeOrder","l":"IsIterableContainingInRelativeOrder(List>)","u":"%3Cinit%3E(java.util.List)"},{"p":"org.hamcrest.collection","c":"IsIterableWithSize","l":"IsIterableWithSize(Matcher super Integer>)","u":"%3Cinit%3E(org.hamcrest.Matcher)"},{"p":"org.hamcrest.collection","c":"IsMapContaining","l":"IsMapContaining(Matcher super K>, Matcher super V>)","u":"%3Cinit%3E(org.hamcrest.Matcher,org.hamcrest.Matcher)"},{"p":"org.hamcrest.collection","c":"IsMapWithSize","l":"IsMapWithSize(Matcher super Integer>)","u":"%3Cinit%3E(org.hamcrest.Matcher)"},{"p":"org.hamcrest.core","c":"IsNot","l":"IsNot(Matcher)","u":"%3Cinit%3E(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"BaseMatcher","l":"isNotNull(Object, Description)","u":"isNotNull(java.lang.Object,org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"IsNull","l":"IsNull()","u":"%3Cinit%3E()"},{"p":"org.hamcrest.collection","c":"IsIn","l":"isOneOf(T...)"},{"p":"org.hamcrest","c":"Matchers","l":"isOneOf(T...)"},{"p":"org.hamcrest.core","c":"IsSame","l":"IsSame(T)","u":"%3Cinit%3E(T)"},{"p":"org.hamcrest.collection","c":"ArrayAsIterableMatcher","l":"iterableMatcher"},{"p":"org.hamcrest.collection","c":"IsIterableWithSize","l":"iterableWithSize(int)"},{"p":"org.hamcrest","c":"Matchers","l":"iterableWithSize(int)"},{"p":"org.hamcrest.collection","c":"IsIterableWithSize","l":"iterableWithSize(Matcher super Integer>)","u":"iterableWithSize(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"iterableWithSize(Matcher super Integer>)","u":"iterableWithSize(org.hamcrest.Matcher)"},{"p":"org.hamcrest.comparator","c":"ComparatorMatcherBuilder","l":"lessThan(T)"},{"p":"org.hamcrest","c":"Matchers","l":"lessThan(T)"},{"p":"org.hamcrest.number","c":"OrderingComparison","l":"lessThan(T)"},{"p":"org.hamcrest.comparator","c":"ComparatorMatcherBuilder","l":"lessThanOrEqualTo(T)"},{"p":"org.hamcrest","c":"Matchers","l":"lessThanOrEqualTo(T)"},{"p":"org.hamcrest.number","c":"OrderingComparison","l":"lessThanOrEqualTo(T)"},{"p":"org.hamcrest","c":"Condition","l":"matched(T, Description)","u":"matched(T,org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"ArrayAsIterableMatcher","l":"matchers"},{"p":"org.hamcrest.collection","c":"IsIn","l":"matches(Object)","u":"matches(java.lang.Object)"},{"p":"org.hamcrest.core","c":"AnyOf","l":"matches(Object)","u":"matches(java.lang.Object)"},{"p":"org.hamcrest.core","c":"DescribedAs","l":"matches(Object)","u":"matches(java.lang.Object)"},{"p":"org.hamcrest.core","c":"Is","l":"matches(Object)","u":"matches(java.lang.Object)"},{"p":"org.hamcrest.core","c":"IsAnything","l":"matches(Object)","u":"matches(java.lang.Object)"},{"p":"org.hamcrest.core","c":"IsEqual","l":"matches(Object)","u":"matches(java.lang.Object)"},{"p":"org.hamcrest.core","c":"IsNot","l":"matches(Object)","u":"matches(java.lang.Object)"},{"p":"org.hamcrest.core","c":"IsNull","l":"matches(Object)","u":"matches(java.lang.Object)"},{"p":"org.hamcrest.core","c":"IsSame","l":"matches(Object)","u":"matches(java.lang.Object)"},{"p":"org.hamcrest","c":"DiagnosingMatcher","l":"matches(Object)","u":"matches(java.lang.Object)"},{"p":"org.hamcrest","c":"Matcher","l":"matches(Object)","u":"matches(java.lang.Object)"},{"p":"org.hamcrest","c":"TypeSafeDiagnosingMatcher","l":"matches(Object)","u":"matches(java.lang.Object)"},{"p":"org.hamcrest","c":"TypeSafeMatcher","l":"matches(Object)","u":"matches(java.lang.Object)"},{"p":"org.hamcrest.core","c":"AnyOf","l":"matches(Object, boolean)","u":"matches(java.lang.Object,boolean)"},{"p":"org.hamcrest.beans","c":"SamePropertyValuesAs","l":"matches(Object, Description)","u":"matches(java.lang.Object,org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"AllOf","l":"matches(Object, Description)","u":"matches(java.lang.Object,org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"IsInstanceOf","l":"matches(Object, Description)","u":"matches(java.lang.Object,org.hamcrest.Description)"},{"p":"org.hamcrest","c":"DiagnosingMatcher","l":"matches(Object, Description)","u":"matches(java.lang.Object,org.hamcrest.Description)"},{"p":"org.hamcrest","c":"Matchers","l":"matchesPattern(Pattern)","u":"matchesPattern(java.util.regex.Pattern)"},{"p":"org.hamcrest.text","c":"MatchesPattern","l":"matchesPattern(Pattern)","u":"matchesPattern(java.util.regex.Pattern)"},{"p":"org.hamcrest.text","c":"MatchesPattern","l":"MatchesPattern(Pattern)","u":"%3Cinit%3E(java.util.regex.Pattern)"},{"p":"org.hamcrest","c":"Matchers","l":"matchesPattern(String)","u":"matchesPattern(java.lang.String)"},{"p":"org.hamcrest.text","c":"MatchesPattern","l":"matchesPattern(String)","u":"matchesPattern(java.lang.String)"},{"p":"org.hamcrest.core","c":"StringRegularExpression","l":"matchesRegex(Pattern)","u":"matchesRegex(java.util.regex.Pattern)"},{"p":"org.hamcrest","c":"Matchers","l":"matchesRegex(Pattern)","u":"matchesRegex(java.util.regex.Pattern)"},{"p":"org.hamcrest.core","c":"StringRegularExpression","l":"matchesRegex(String)","u":"matchesRegex(java.lang.String)"},{"p":"org.hamcrest","c":"Matchers","l":"matchesRegex(String)","u":"matchesRegex(java.lang.String)"},{"p":"org.hamcrest.number","c":"BigDecimalCloseTo","l":"matchesSafely(BigDecimal)","u":"matchesSafely(java.math.BigDecimal)"},{"p":"org.hamcrest.object","c":"IsCompatibleType","l":"matchesSafely(Class>)","u":"matchesSafely(java.lang.Class)"},{"p":"org.hamcrest.collection","c":"IsEmptyCollection","l":"matchesSafely(Collection extends E>)","u":"matchesSafely(java.util.Collection)"},{"p":"org.hamcrest.number","c":"IsCloseTo","l":"matchesSafely(Double)","u":"matchesSafely(java.lang.Double)"},{"p":"org.hamcrest.number","c":"IsNaN","l":"matchesSafely(Double)","u":"matchesSafely(java.lang.Double)"},{"p":"org.hamcrest.collection","c":"ArrayAsIterableMatcher","l":"matchesSafely(E[])"},{"p":"org.hamcrest.collection","c":"IsArrayContainingInAnyOrder","l":"matchesSafely(E[])"},{"p":"org.hamcrest.collection","c":"IsArrayContainingInOrder","l":"matchesSafely(E[])"},{"p":"org.hamcrest.object","c":"IsEventFrom","l":"matchesSafely(EventObject, Description)","u":"matchesSafely(java.util.EventObject,org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsEmptyIterable","l":"matchesSafely(Iterable extends E>)","u":"matchesSafely(java.lang.Iterable)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInOrder","l":"matchesSafely(Iterable extends E>, Description)","u":"matchesSafely(java.lang.Iterable,org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInRelativeOrder","l":"matchesSafely(Iterable extends E>, Description)","u":"matchesSafely(java.lang.Iterable,org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsIterableContainingInAnyOrder","l":"matchesSafely(Iterable extends T>, Description)","u":"matchesSafely(java.lang.Iterable,org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"Every","l":"matchesSafely(Iterable extends T>, Description)","u":"matchesSafely(java.lang.Iterable,org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"IsCollectionContaining","l":"matchesSafely(Iterable super T>, Description)","u":"matchesSafely(java.lang.Iterable,org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"IsIterableContaining","l":"matchesSafely(Iterable super T>, Description)","u":"matchesSafely(java.lang.Iterable,org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"IsMapContaining","l":"matchesSafely(Map extends K, ? extends V>)","u":"matchesSafely(java.util.Map)"},{"p":"org.hamcrest.xml","c":"HasXPath","l":"matchesSafely(Node, Description)","u":"matchesSafely(org.w3c.dom.Node,org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"SubstringMatcher","l":"matchesSafely(String)","u":"matchesSafely(java.lang.String)"},{"p":"org.hamcrest.text","c":"IsBlankString","l":"matchesSafely(String)","u":"matchesSafely(java.lang.String)"},{"p":"org.hamcrest.text","c":"IsEmptyString","l":"matchesSafely(String)","u":"matchesSafely(java.lang.String)"},{"p":"org.hamcrest.text","c":"IsEqualCompressingWhiteSpace","l":"matchesSafely(String)","u":"matchesSafely(java.lang.String)"},{"p":"org.hamcrest.text","c":"IsEqualIgnoringCase","l":"matchesSafely(String)","u":"matchesSafely(java.lang.String)"},{"p":"org.hamcrest.text","c":"MatchesPattern","l":"matchesSafely(String)","u":"matchesSafely(java.lang.String)"},{"p":"org.hamcrest.text","c":"StringContainsInOrder","l":"matchesSafely(String)","u":"matchesSafely(java.lang.String)"},{"p":"org.hamcrest.core","c":"StringRegularExpression","l":"matchesSafely(String, Description)","u":"matchesSafely(java.lang.String,org.hamcrest.Description)"},{"p":"org.hamcrest.beans","c":"HasProperty","l":"matchesSafely(T)"},{"p":"org.hamcrest","c":"TypeSafeMatcher","l":"matchesSafely(T)"},{"p":"org.hamcrest.beans","c":"HasPropertyWithValue","l":"matchesSafely(T, Description)","u":"matchesSafely(T,org.hamcrest.Description)"},{"p":"org.hamcrest.core","c":"CombinableMatcher","l":"matchesSafely(T, Description)","u":"matchesSafely(T,org.hamcrest.Description)"},{"p":"org.hamcrest","c":"FeatureMatcher","l":"matchesSafely(T, Description)","u":"matchesSafely(T,org.hamcrest.Description)"},{"p":"org.hamcrest.object","c":"HasEqualValues","l":"matchesSafely(T, Description)","u":"matchesSafely(T,org.hamcrest.Description)"},{"p":"org.hamcrest","c":"TypeSafeDiagnosingMatcher","l":"matchesSafely(T, Description)","u":"matchesSafely(T,org.hamcrest.Description)"},{"p":"org.hamcrest.collection","c":"HasItemInArray","l":"matchesSafely(T[])"},{"p":"org.hamcrest.collection","c":"IsArray","l":"matchesSafely(T[])"},{"p":"org.hamcrest","c":"Condition","l":"matching(Matcher)","u":"matching(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Condition","l":"matching(Matcher, String)","u":"matching(org.hamcrest.Matcher,java.lang.String)"},{"p":"org.hamcrest.beans","c":"PropertyUtil","l":"NO_ARGUMENTS"},{"p":"org.hamcrest.xml","c":"HasXPath","l":"NO_NAMESPACE_CONTEXT"},{"p":"org.hamcrest","c":"Description","l":"NONE"},{"p":"org.hamcrest.core","c":"IsNot","l":"not(Matcher)","u":"not(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"not(Matcher)","u":"not(org.hamcrest.Matcher)"},{"p":"org.hamcrest","c":"Matchers","l":"not(Matcher)","u":"not(org.hamcrest.Matcher)"},{"p":"org.hamcrest.core","c":"IsNot","l":"not(T)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"not(T)"},{"p":"org.hamcrest","c":"Matchers","l":"not(T)"},{"p":"org.hamcrest","c":"Matchers","l":"notANumber()"},{"p":"org.hamcrest.number","c":"IsNaN","l":"notANumber()"},{"p":"org.hamcrest","c":"Condition","l":"notMatched()"},{"p":"org.hamcrest.core","c":"IsNull","l":"notNullValue()"},{"p":"org.hamcrest","c":"CoreMatchers","l":"notNullValue()"},{"p":"org.hamcrest","c":"Matchers","l":"notNullValue()"},{"p":"org.hamcrest.core","c":"IsNull","l":"notNullValue(Class)","u":"notNullValue(java.lang.Class)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"notNullValue(Class)","u":"notNullValue(java.lang.Class)"},{"p":"org.hamcrest","c":"Matchers","l":"notNullValue(Class)","u":"notNullValue(java.lang.Class)"},{"p":"org.hamcrest","c":"Description.NullDescription","l":"NullDescription()","u":"%3Cinit%3E()"},{"p":"org.hamcrest.core","c":"IsNull","l":"nullValue()"},{"p":"org.hamcrest","c":"CoreMatchers","l":"nullValue()"},{"p":"org.hamcrest","c":"Matchers","l":"nullValue()"},{"p":"org.hamcrest.core","c":"IsNull","l":"nullValue(Class)","u":"nullValue(java.lang.Class)"},{"p":"org.hamcrest","c":"CoreMatchers","l":"nullValue(Class)","u":"nullValue(java.lang.Class)"},{"p":"org.hamcrest","c":"Matchers","l":"nullValue(Class)","u":"nullValue(java.lang.Class)"},{"p":"org.hamcrest.collection","c":"IsIn","l":"oneOf(T...)"},{"p":"org.hamcrest","c":"Matchers","l":"oneOf(T...)"},{"p":"org.hamcrest.core","c":"CombinableMatcher","l":"or(Matcher super T>)","u":"or(org.hamcrest.Matcher)"},{"p":"org.hamcrest.core","c":"CombinableMatcher.CombinableEitherMatcher","l":"or(Matcher super X>)","u":"or(org.hamcrest.Matcher)"},{"p":"org.hamcrest.beans","c":"PropertyUtil","l":"propertyDescriptorsFor(Object, Class
ArrayMatching.