[Clirr-devel] Patch: ClassSelector, unit test refactoring
Status: Alpha
Brought to you by:
lkuehne
From: Simon K. <si...@ec...> - 2004-06-04 11:22:02
|
Hi, When I tried to develop some unit tests for the new ScopeSelector class, I struck a problem with the existing unit testing framework. Each unit test currently tries to compare *all* classes in the testinput libs against the previous versions. That means that any time a new test is created and a class is added to the testinput libs, it can break every other unit test. To resolve this, I have created a ClassSelector class (yes, I seem to be on a run with these selectors :-). What it does is affect the way ClassSet objects are built by the checker. A ClassSelector filters the classes in a pretty flexible way. Users could eventually use this to say that they only want their binary compatibility checks, or difference reports, on specific packages or even classes. However the initial application of this is to set up the existing unit tests to only run against classes directly in the "testlib" package. Further tests (such as the ScopeChangeTest unit test I am now creating) can then put their test classes in sub-packages without affecting the existing tests. So, here is the patch for your consideration. The diffs against the Checker class unfortunately also include the diffs from the previous patch I sent which has not yet been committed. One method in Checker has been made public, so the unit tests can access it. I think the API is nice, and don't see why this method shouldn't be public. Some methods have also been made static as this makes them more useful. Regards, Simon |