RE: is adding test classes in mass possible?
| Newsgroups | gmane.comp.web.httpunit.devel |
|---|---|
| Message-ID | <ABF4E02DA33A6F4BAC41122C7086C8990C2CC7@bromail01.internal.gxs.com> |
Off the top of my head you may try using reflection to do it. You could probably loop over the directory structure of the package and use names of directories and class files to build class names then use the class loader to instantiate them: Class.forName(fully.qualified.class.Name); I think what I am describing here may be a factory pattern? HTH, Rob ________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of [email protected] Sent: Thursday, May 11, 2006 12:18 PM To: [email protected] Subject: [Httpunit-develop] is adding test classes in mass possible? I have been give around 160 separate httpunit test files, instead of listing them one line at a time. Is there a way I can grab them from the package directory and do a mass add of the test cases? I create a main "driver" test suite as follows, and this is were I was hoping to be able to some kind of mass add of the 160 test case files. public class TestLabSuite { public static void main( String[] args ) { junit.textui.TestRunner.run( suite() ); } public static TestSuite suite() { TestSuite result = new TestSuite(); // Labs //result.addTest(LabAdvisorKeywordSearchTest.suite() ); result.addTest(LabAdvisorTopicSearchTest.suite() ); // Added by HCL result.addTest(LabDatabaseSearchExtendedTest.suite() ); result.addTest(LabDatabaseSearchTest.suite() ); result.addTest(LabDatabaseSearchThirdTest.suite() ); return result; } } Thanks for any guidance you can provide Jeff