From: Suniti R. <sun...@ya...> - 2007-05-26 01:48:59
|
Hello I have a test class defined which has a number of test cases. I would like to choose only certain test cases from this test suite dynamically. Can somebody please help me???? I tried to pass an instance of AccountTest constructor but I have trouble doing that. See below. [Code] < code of a generic test suite> public class AccountTest extends TestCase{ public AccountTest(String name) { super(name); } public void test1() { } public void test2() { } } < Trying to add the tests dynamically> I need to find AccountTest dynamically and then pick test1 and add it to another testsuite. This is my scenario. Can somebody please tell me how to do this?? TestSuiteClass ts = (TestSuiteClass)list.get(i); Class tc = ClassLoaderUtils.getClass("com.fw.testcases.smoke." + ts.testSuiteName.getContent()); // am sucessful in finding AccountTest. ... Constructor constructor = tc.getConstructor(new Class[]{String.class}); // successful in invoking the constructor. .... // how do I add the test to a new test suite from this constructor instance???? Thanks KVn ____________________________________________________________________________________ Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games. http://sims.yahoo.com/ |