4

I just wrote a WeakArrayList<E> class, which implements List<E>, with WeakReference<E>s to the elements, and appropriate synchronizations.

I have every reason to believe that a through test suite will be much larger and complicated then my class is.

Is there a (free) test suite for List, ArrayList and Map?

Thanks!

Charlweed
  • 1,517
  • 2
  • 14
  • 22
  • 1
    Note: Depending on your particular implementation, if your `WeakArrayList` class violates the List spec, it (predictably) will fail the test suites. This really depends on how you tried to work weak references into the `List` interface. – Louis Wasserman Oct 21 '12 at 00:46
  • Yes, I know Louis. My implementation will conform to a `List`. In particular, it will behave exactly like the SE `ArrayList` as long as there are (other) strong references to all items in the WeakArrayList, and various other conditions. – Charlweed Oct 21 '12 at 20:11

1 Answers1

2

Google Collections has a very elaborate library of collection test suites, but it is not usable out-of-the-box for external classes nor JUnit 4. I forked http://google-collections.googlecode.com/svn/trunk (A subset of Guava), And I converted the tests into their own library. I had to modify some classes, and add others so that it would work correctly with Generics in subclasses, and to resolve some other issues. I may put it on GitHub or something if I can determine that it won't violate any licenses.

Charlweed
  • 1,517
  • 2
  • 14
  • 22