I am new to JUNIT 4, I want to write code such as test suite get inputs from excelsheet and based on input testsuite invoke diffrent test cases. As per JUNIT 4 we can define all test cases in @SuiteClasses({ ParameterSampleTest.class,SampleJUnitTest.class })
but this is when we have predefine test cases. but here i want to use custome JUNIT runner that takes decision based on input? can some one help to resolve this problem?
@RunWith(Suite.class)
public class AllTests {
public static TestSuite suite() {
TestSuite suite = new TestSuite();
suite.addTest(new JUnit4TestAdapter(ParameterSampleTest.class));
suite.addTest(new JUnit4TestAdapter(SampleJUnitTest.class));
return suite;
}
}
Thanks, Priyank Shah