I’m teaching a data structures class this semester and we build gobs of JUnit tests given component interfaces. We then use setUp to plug in a specific concrete implementation. In most cases we are implementing java.util interfaces. Is there a common set of rigorous JUnit tests for common Java components, or some sort of framework that makes designing the test cases less painful?
I’m teaching a data structures class this semester and we build gobs of JUnit
Share
Hamcrest provides several matchers that are specific to Maps and Collections.
You can find them in the tutorial.
(JUnit 4.x contains Hamcrest)
Sample code:
Your main starting point would be these convenience classes: