Search in sources :

Example 6 with NonTestCase

use of com.oracle.tck.lib.autd2.NonTestCase in project jtharness by openjdk.

the class InvalidTestCases method publicNonTestCaseMethod_message.

@Test
public void publicNonTestCaseMethod_message() {
    try {
        com.oracle.tck.lib.autd2.TestResult status = TU.runTestGroup(new BaseTestGroup() {

            @TestCase
            public void myTest01(int i) {
            }

            public void myTest0232426556() {
            }
        });
        Assert.fail("IAE was not thrown");
    } catch (IllegalArgumentException e) {
        assertEquals("Please either add @TestCase or @NonTestCase annotation to method \"com.oracle.tck.lib.autd2.unittests.tgfported.general.InvalidTestCases$18.myTest0232426556\" or make it non-public. All public methods must have @TestCase annotation by default. As an exception a method which needs to be public but is not a testcase should be annotated with @NonTestCase annotation.", e.getMessage());
    }
}
Also used : TestCase(com.sun.tck.test.TestCase) NonTestCase(com.oracle.tck.lib.autd2.NonTestCase) BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup) Test(org.junit.Test)

Example 7 with NonTestCase

use of com.oracle.tck.lib.autd2.NonTestCase in project jtharness by openjdk.

the class InvalidTestCases method publicNonTestCaseMethod_message_bothAnnotations1_protected.

@Test
public void publicNonTestCaseMethod_message_bothAnnotations1_protected() {
    try {
        com.oracle.tck.lib.autd2.TestResult status = TU.runTestGroup(new BaseTestGroup() {

            @TestCase
            @NonTestCase
            protected void myTest01(int i) {
            }
        });
        Assert.fail("IAE was not thrown");
    } catch (IllegalArgumentException e) {
        assertEquals("Please remove one of @TestCase or @NonTestCase annotation from method \"com.oracle.tck.lib.autd2.unittests.tgfported.general.InvalidTestCases$21.myTest01\".", e.getMessage());
    }
}
Also used : TestCase(com.sun.tck.test.TestCase) NonTestCase(com.oracle.tck.lib.autd2.NonTestCase) BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup) NonTestCase(com.oracle.tck.lib.autd2.NonTestCase) Test(org.junit.Test)

Aggregations

BaseTestGroup (com.oracle.tck.lib.autd2.unittests.BaseTestGroup)7 Test (org.junit.Test)7 NonTestCase (com.oracle.tck.lib.autd2.NonTestCase)6 TestCase (com.sun.tck.test.TestCase)5