Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generic Test harness for java.util.Map?

I have a custom implementation of the Map interface which does some fancy stuff, like lazy evaluation of functions. the implementation should appear immutable after construction from outside (e.g. no put() and putAll() methods are supported)

I it looks like it works in the most basic conditions. Since it is quite complex, i am sure there must be tons of lurking bugs w.r.t thread safety, irregular order of operations and much more..

Since the contract of the Map interface is well-defined i am sure there must exist a generic test collection which checks corner-cases, thread safety etc.

I have heard that Google Collections runs about 25000 unit tests for their library. Is it possible to download them somewhere?

like image 837
Andreas Petersson Avatar asked May 14 '09 17:05

Andreas Petersson


1 Answers

The Google Collections zip contains their tests. There should be a google-collect-testfw jar in there.

Specifically, there's an abstract test for the general contract of Map.

like image 195
Adam Jaskiewicz Avatar answered Sep 19 '22 07:09

Adam Jaskiewicz