JUnit testing and test permutations.
I hope this question doesn't sound too confused...
I have a single Engine class, that according to it's creation parameters (two flags), creates four different work environments. This Engine works with two different Adapter classes. It is these Adapters that I want to test. Each Adapter Class has its' own AdapterTest TestCase class set of tests. The thing is, that I want to perform each set of test four times, using an Adapter "hitched" to each of the different Engine configurations.
Initially I thought to extend the two basic AdapterTest classes, leaving the derived classes to create the Engine instance to run the tests with, and then run those extended classes, but that gives me [at least] ten classes and duplicate code and seems rather clunky. Is there any way to refactor the Engine creation or whatever, in order to achieve a more elegant solution, or a perhaps completely different solution to this repeat-test issue?
And ideas or pointers, folks?
I have a single Engine class, that according to it's creation parameters (two flags), creates four different work environments. This Engine works with two different Adapter classes. It is these Adapters that I want to test. Each Adapter Class has its' own AdapterTest TestCase class set of tests. The thing is, that I want to perform each set of test four times, using an Adapter "hitched" to each of the different Engine configurations.
Initially I thought to extend the two basic AdapterTest classes, leaving the derived classes to create the Engine instance to run the tests with, and then run those extended classes, but that gives me [at least] ten classes and duplicate code and seems rather clunky. Is there any way to refactor the Engine creation or whatever, in order to achieve a more elegant solution, or a perhaps completely different solution to this repeat-test issue?
And ideas or pointers, folks?
