This is a small library of code-pieces that I find useful when writing tests.
It covers areas that I miss in JUnit itself e.g. for verifying compare()/hashCode()/equals() implementations and for multi-threaded tests.
- MockSMTPServer - simluate an SMTP Server for testing code which sends emails
- MockRESTServer - simluate a HTTP Server for testing code which accesses other systems, e.g. to mock REST interfaces in tests
- TestHelpers - small utilities for testing things like equals(), hashCode(), toString(), compare() and implementations of Comparator, they ensure some things that the Java spec mandates
- ThreadTestHelpers - easily run unit tests multiple times in parallel to ensure the code does not contain hidden race conditions
compile 'org.dstadler:commons-test:1. '
git clone git://github.com/centic9/commons-test
./gradlew eclipse
cd commons-test
./gradlew check jacocoTestReport
- commons-test is licensed under the BSD 2-Clause License.
- A few pieces are imported from other sources, the source-files contain the necessary license pieces/references.