Hamcrest - library of matchers for building test expressions
Hamcrest provides a library of matcher objects (also known as constraints or predicates) allowing 'match' rules to be defined declaratively, to be used in other frameworks. Typical scenarios include testing frameworks, mocking libraries and UI validation rules. Hamcrest has been ported to Java, C++, Objective-C, Python, PHP and Erlang.
comments powered by Disqus
A library for writing readable, composable regular expression matchers that integrates cleanly with Hamcrest. FeaturesEasier to read (although more long-winded) than regular expressions Named capture groups: captured text is identified by name, not by the index of the group. Composable: patterns can be easily combined into more complex patterns without worrying about breaking regex syntax or changing group identifiers. Refactoring friendly: patterns can be refactored with your favourite IDE. Par
JSON matchers based on hamcrest matcher framework (org.json) Hamcrest framework extension to add support for JSON. The target is to build a custom factory of Matcher<JSONObjects> to aid in unit tests and production code.
A collection of Hamcrest matchers for XML documents. The matchers include XPath, schema validation using XML Schema or RelaxNG(experimental), and XML document equivalence. Check out the Tutorial page for a quick overview. XML Matchers allow you to do things like the following. Source xml = ...assertThat(xml, hasXPath("/mountains/mountain"));Node xml = ...assertThat( the(xml), hasXPath("count(/mountains/mountain)", returningANumber(), greaterThanOrEqualTo(2d)));String xml = "<mountains><mountain>
MarrowBoy Test ReportsWe provide a wrapper around hamcrest MatcherAssert methods to provide pretty, human-readable test reports in a variety of beautiful formats. ExampleOutputs JavaDoc MarrowBoy is based in the philosophy that good test code should be completely self-documenting, and that anyone reading a test should be able to understand what it does without the need for comments, annotations or other textual description. (todo: examples of good/bad test code). MarrowBoy comes in once the test
Hamcrest XML Schema MatchersA project providing matchers for validating your XML documents using Hamcrest. It currently provides a collection of RelaxNG based matchers, but more matchers are coming. UsageThis is how you use Hamcrest Schema from JUnit: File xml = new File(...); // An XML fileFile schema = new File(...); // A RelaxNG schema file assertThat(xml, isValidatedBy(schema));If the XML file is a valid instance of the document type defined by the schema file, then this code will just silen
A framework to write static analysis tests. Unlike tools such as checkstyle, PMD or findbugs, Freud attempts to give the user easy and full control of their static analysis tests. Freud does not attempt to give you out-of-the-box tests and tell you anything about what's needed to be tested. You can always use the examples, but once you get familiar with those, you will probably just want to write one yourself. Using a DSL for every supported type of analysed entity, Freud allows users to define
The intention of this project is to simplify the creation of custom hamcrest-matchers for java-objects.
The Niceassert library defines a few useful Java tools designed to aid test readability by reducing the code overhead of various common testing patterns. It works well alongside existing widely-used testing frameworks (especially JUnit4/JMock2 with which it shares support library requirements). Features: Expectations - a concise way to express expected behaviour of a method call Overriding - partially mock the behaviour of an object Matchers - a collection of various useful Hamcrest Matchers
This micro-library provides Java extensions to the Hamcrest library to provide a convienient way of declaring and combining entity Matchers which can be used in either test or production code. See the wiki for a rundown