Skip to content

Java contract test helpers

Christopher-Barham-AKQA edited this page Sep 5, 2012 · 6 revisions

Certain code you override or implement is expected to adhere to contracts laid out in the Java SDK. Examples of these are:

A project called junit-addons has test superclasses that enable compliance testing of objects to these java contracts at http://junit-addons.sourceforge.net/junitx/extensions/package-frame.html these test helper classes work without issue, although are designed for pre-generic java, and JUnit 3.x.

An modernized JUnit4 version of these test helpers, with examples, is at https://github.com/chas66/TestHelper

Clone this wiki locally