Hello,
I am writing a test case where in I want to run a one DataPoint for one test case and second DataPoint for second test case.
@RunWith(Theories.class)
public class DummyTest {
@DataPoints
public static String[] getFileNames() {
return new String[] { "firstFile.txt","firstFile1.txt" };
}
@Theory
public void test1(String fileName) throws Exception {
System.out.println(fileName);
assertThat(true, is(equalTo(Boolean.TRUE)));
}
@DataPoints
public static String[] getSecondFileNames() {
return new String[] { "secondFile.txt","secondFile1.txt" };
}
@Theory
public void test2(String fileName) throws Exception {
System.out.println(fileName);
assertThat(true, is(equalTo(Boolean.TRUE)));
}
}
I want that for first test case my first datapoints i.e. getFileNames method is called and for second test case getSecondFileNames datapoints should be called. Can anybody suggest is this feasible?
Thanks,
Shekhar