Samples - Test Suite
The Java code in these samples constitutes the entire test suite for the tester library. Each package has been designed to test a specific feature of the library. Each package includes a collection of classes needed to create the tests, the Examples class with examples of data needed to design the tests, and, of course, the tests themselves. For each package we also include the complete set of test results: a version with all test results and all data shown, and a version that shows only the failed tests (that were designed to fail).
The results shown have been run with the 1.4.1 version. (The later versions do not alter these tests - they only added options for the display of the results and improved the code that detects circularity in data.)
Links to the samples of the use of the tester library that illustrate the use of all of the library’s functionality.
Tests that compare the basic types. This includes primitive types and wrapper classes.
Tests that compare the user defined types. This includes the equality of two instances of user defined classes.
Tests that compare inexact values. This includes comparison of two objects that contain a field with values of types double or float (or their wrapper classes).
Tests that compare sets. This includes the comparison of HashSet and TreeSet objects.
Tests that compare all elements of two iterable objects.
Tests that compare all elements of two traversal objects.
Tests that compare all elements of two map objects. This includes tests for HashMap and TreeMap.
Tests that compare the random choices. This includes tests to determine whether the data value is OneOf or NoneOf a finite collection of options for both the exact and inexact variants.
Tests for range check. This includes tests to determine whether the data value is in the range [low, high) using Comparable objects or a given Comparator.
Tests to check equivalence of two objects. This includes tests that check whether the two given objects are equivalent according to the user-defined function object that implements the Equivalence interface.
Tests for ISame. This includes comparison of two instances of a class that implements the ISame interface by applying the same method defined in that class.
Tests for exceptions. This includes tests that determine whether both a method invocation throws the desired exception or a constructor invocation throws the desired exception.
Tests for methods. This includes tests to check the expected value produced by a method invocation.