Emmanuel Bourg wrote:
In Commons CLI there are 3 parsers implementing the same interface,
and soon another implementation will be added. There is an abstract
test case with the test methods, and a concrete subclass for each
parser. The concrete test case instantiates the parser and disables
some tests by overwriting them if they are known to fail.
The abstract test is growing and becomes difficult to manage. I may
split it into smaller classes grouping the tests by category, but I
don't want to have 4 subclasses for every abstract class. This is
where multi inheritance would be useful.
Anyone knows a trick or a new test frameworks that may help testing
the implementations of an interface?
You have probably thought of this and it may be distasteful, but one way
to break things apart would be to break the single abstract test class
into an artificial hierarchy. If there is a way to do this with some
kind of semantic integrity (e.g., if it can be made to coincide with the
"known to fail" relation) that could be a simple solution. The
[collections] test framework uses this approach, though the inheritance
hierarchy among the test classes generally corresponds to specialization
in the implementation classes.
Phil
Emmanuel Bourg
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org