Dave
Dave

Reputation: 1214

JUnit tests for collections

I've implemented a Radix Trie (aka Patricia Trie) in Java, and would like to thoroughly test it. It implements the Map, SortedMap and NavigableMap interfaces, which add up to a pretty large number of methods to check. =/

I figure the people who wrote library classes like HashMap and TreeMap must have had a suite of JUnit tests (or something similar) to ensure they behave correctly. Does anyone know of a way to get the source code of these tests? I'd love to put this code through the same paces.

Upvotes: 1

Views: 287

Answers (1)

Kevin Dolan
Kevin Dolan

Reputation: 5097

In the google collections library, there are some basic test harnesses that thoroughly test the contracts of various structures, including maps.

Here is a link to the gcode page: http://code.google.com/p/google-collections/

Upvotes: 1

Related Questions