Search in sources :

Example 1 with NonTestCase

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

the class InvalidTestCases method publicNonTestCaseMethod_message2.

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

            public void myTest4444444() {
            }
        });
        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$23.myTest4444444\" 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 : BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup) Test(org.junit.Test)

Example 2 with NonTestCase

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

the class InvalidTestCases method publicNonTestCaseMethod_message_bothAnnotations1_private.

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

            @TestCase
            @NonTestCase
            private 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$20.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)

Example 3 with NonTestCase

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

the class InvalidTestCases method publicNonTestCaseMethod_message_bothAnnotations.

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

            @TestCase
            @NonTestCase
            public 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$19.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)

Example 4 with NonTestCase

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

the class InvalidTestCases method publicNonTestCaseMethod_notTestCase.

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

        @NonTestCase
        public void myTest4444444() {
        }
    });
    Assert.assertTrue(status.isOK());
}
Also used : BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup) NonTestCase(com.oracle.tck.lib.autd2.NonTestCase) Test(org.junit.Test)

Example 5 with NonTestCase

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

the class InvalidTestCases method publicNonTestCaseMethod_message_bothAnnotations1_packprivate.

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

            @TestCase
            @NonTestCase
            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$22.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