S
Stephen Riehm
Hi,
I'm an old-hat perl junkie that has grown very accustomed to setting up
a simple testing structure and then simply adding test cases whenever I
add functionality to my code. (ie: write test for new feature, write
feature, test, go back to step 1,...)
Now I'm branching into the world of Java and haven't quite 'got-it' when
using JUnit.
In the FAQ at http://junit.sourceforge.net/doc/faq/faq.htm#organize_2
Mike Clark presents a way of creating a TestSuite which contains a lot
of tests. So far so good. He does this by using a static method which is
called directly from the main method. Is it possible to wrap up a
TestSuite in a "higher" TestSuite?
In my case, I've split my application into several packages, just 5 so
far, but they'll be more. ie: myapp.data, myapp.gui, myapp.cli,
myapp.interfaces. I would *like* to group the test cases for each
package into a TestSuite (ie: myapp.data.AllDataTests) and then have
them all run from a central point. (ie: myapp.AllTests). The idea being
that once the structure is in place, all we would need to do is write
tests and classes, and not have to fiddle with the administration of
test cases.
Is there a neat way of recursively grouping suites of TestSuites (I
tried subclassing TestSuite, but with little success) or is JUnit
limited to a single TestSuite of TestCases? Have I missed something obvious?
Thanks for your enlightenment!
Steve
I'm an old-hat perl junkie that has grown very accustomed to setting up
a simple testing structure and then simply adding test cases whenever I
add functionality to my code. (ie: write test for new feature, write
feature, test, go back to step 1,...)
Now I'm branching into the world of Java and haven't quite 'got-it' when
using JUnit.
In the FAQ at http://junit.sourceforge.net/doc/faq/faq.htm#organize_2
Mike Clark presents a way of creating a TestSuite which contains a lot
of tests. So far so good. He does this by using a static method which is
called directly from the main method. Is it possible to wrap up a
TestSuite in a "higher" TestSuite?
In my case, I've split my application into several packages, just 5 so
far, but they'll be more. ie: myapp.data, myapp.gui, myapp.cli,
myapp.interfaces. I would *like* to group the test cases for each
package into a TestSuite (ie: myapp.data.AllDataTests) and then have
them all run from a central point. (ie: myapp.AllTests). The idea being
that once the structure is in place, all we would need to do is write
tests and classes, and not have to fiddle with the administration of
test cases.
Is there a neat way of recursively grouping suites of TestSuites (I
tried subclassing TestSuite, but with little success) or is JUnit
limited to a single TestSuite of TestCases? Have I missed something obvious?
Thanks for your enlightenment!
Steve