use of com.sun.tck.lib.tgf.TestData in project jtharness by openjdk.
the class InvalidTestCases method overLoaded_3.
@Test(expected = IllegalArgumentException.class)
public void overLoaded_3() {
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
private String[] setup_1() {
return new String[] { "2", "dd", "df", "fg", "sfsd", "dfg" };
}
private Integer[] setup_2() {
return new Integer[] { 334, 0, -2, 34 };
}
@TestCase
@TestData("setup_1")
public void test_1(String s) {
}
@TestCase
@TestData("setup_2")
public void test_1(int i) {
}
}, TU.EMPTY_ARGV);
assertTrue(!status.isOK());
}
use of com.sun.tck.lib.tgf.TestData in project jtharness by openjdk.
the class InvalidTestCases method noTestCaseAnn_onlyTestData_03.
@Test
public void noTestCaseAnn_onlyTestData_03() {
try {
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
protected void myTest00() {
}
@TestCase
public void myTest01() {
}
@TestCase
@TestData("something")
public void myTest02(String s) {
}
@TestData("werlwerlkdjfgljdsfg")
protected void myTest04(String s) {
}
@TestData("somethingsomething")
protected void myTest05(String s) {
}
}, TU.EMPTY_ARGV);
Assert.fail("IAE was not thrown");
} catch (IllegalArgumentException e) {
final String s1 = MARKING_METHOD_ONLY_WITH_TEST_DATA_IS_NOT_ALLOWED_PLEASE_ADD_TEST_CASE_ANNOTATION_TO_METHOD + "myTest04\".";
final String s2 = MARKING_METHOD_ONLY_WITH_TEST_DATA_IS_NOT_ALLOWED_PLEASE_ADD_TEST_CASE_ANNOTATION_TO_METHOD + "myTest05\".";
assertTrue(s1.equals(e.getMessage()) || s2.equals(e.getMessage()));
}
}
use of com.sun.tck.lib.tgf.TestData in project jtharness by openjdk.
the class InvalidTestCases method noTestCaseAnn_onlyTestData_04.
@Test
public void noTestCaseAnn_onlyTestData_04() {
try {
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
@TestData("blabla")
void myTest04() {
}
@TestCase
public void myTest02() {
}
}, TU.EMPTY_ARGV);
Assert.fail("IAE was not thrown");
} catch (IllegalArgumentException e) {
assertEquals(MARKING_METHOD_ONLY_WITH_TEST_DATA_IS_NOT_ALLOWED_PLEASE_ADD_TEST_CASE_ANNOTATION_TO_METHOD + "myTest04\".", e.getMessage());
}
}
use of com.sun.tck.lib.tgf.TestData in project jtharness by openjdk.
the class InvalidTestCases method noTestCaseAnn_onlyTestData_01.
@Test
public void noTestCaseAnn_onlyTestData_01() {
try {
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
@TestData("something")
protected void myTest01(int i) {
}
}, TU.EMPTY_ARGV);
Assert.fail("IAE was not thrown");
} catch (IllegalArgumentException e) {
assertEquals(MARKING_METHOD_ONLY_WITH_TEST_DATA_IS_NOT_ALLOWED_PLEASE_ADD_TEST_CASE_ANNOTATION_TO_METHOD + "myTest01\".", e.getMessage());
}
}
Aggregations