Okay, so the goal was to be able to modularize the tests in such a way that objects that return a collection or map could have those return values tested using TestMap, TestCollection etc.
How I decided to handle that was to create a new
implementation of junit.framework.Test, that allows
you to specify "bulk test" methods in addition to
the usual simple test methods:
public BulkTest bulkTestListSubList() {
return new TestList() {
public List makeFullList() {
return outer.makeFullList().subList(2, 12);
}
public BulkTest bulkTestSubList() {
return null; // avoid recursion
}
};
}
The above example would be used to run through ALL of
the tests defined by TestList on its sublists...
A similar approach will be used for Maps and their
collection views.
This patch contains:
1. The code for the new BulkTest class.
2. Patch for TestObject to make it extend BulkTest
instead of TestCase.
3. Patches for almost all of the classes, to replace
their suite() methods. TestSuite knows nothing about
bulk test methods, so it can't be used.
After this patch, all existing tests still work.
Upcoming patches will have versions of TestList and
TestMap that utilize bulk test methods for their
subcollections.
-Paul
BulkTest.java
Description: Binary data
col_test_patch_1.diff
Description: Binary data
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
