Search in sources :

Example 1 with TestedAPI

use of com.sun.tck.test.TestedAPI in project jtharness by openjdk.

the class FailingSimpleTestCases method testedAPI_package_class_methods.

@Test
public void testedAPI_package_class_methods() {
    @TestedAPI(testedPackage = "s.e.g", testedClass = "TheClass", testedMember = { "method1", "method2" })
    @TestGroup
    class MyTest {

        @TestCase
        @TestedStatement("a statement")
        public void testCase() {
            Assert.fail();
        }
    }
    TestResult s = TU.runTestGroup(new MyTest(), TU.EMPTY_ARGV);
    Assert.assertTrue(!s.isOK());
    Assert.assertEquals("test cases: 1; all failed", s.getMessage());
}
Also used : TestGroup(com.sun.tck.test.TestGroup) TestResult(com.oracle.tck.lib.autd2.TestResult) TestedAPI(com.sun.tck.test.TestedAPI) Test(org.junit.Test)

Example 2 with TestedAPI

use of com.sun.tck.test.TestedAPI in project jtharness by openjdk.

the class FailingSimpleTestCases method testedAPI_package_class_method.

@Test
public void testedAPI_package_class_method() {
    @TestedAPI(testedPackage = "s.e.g", testedClass = "TheClass", testedMember = "method1")
    @TestGroup
    class MyTest {

        @TestCase
        @TestedStatement("a statement")
        public void testCase() {
            Assert.fail();
        }
    }
    TestResult s = TU.runTestGroup(new MyTest(), TU.EMPTY_ARGV);
    Assert.assertTrue(!s.isOK());
    Assert.assertEquals("test cases: 1; all failed", s.getMessage());
}
Also used : TestGroup(com.sun.tck.test.TestGroup) TestResult(com.oracle.tck.lib.autd2.TestResult) TestedAPI(com.sun.tck.test.TestedAPI) Test(org.junit.Test)

Example 3 with TestedAPI

use of com.sun.tck.test.TestedAPI in project jtharness by openjdk.

the class FailingSimpleTestCases method testedAPI_package_classes.

@Test
public void testedAPI_package_classes() {
    @TestedAPI(testedPackage = "s.e.g", testedClass = { "TheClass", "TheClass" })
    @TestGroup
    class MyTest {

        @TestCase
        @TestedStatement("a statement")
        public void testCase() {
            Assert.fail();
        }
    }
    TestResult s = TU.runTestGroup(new MyTest(), TU.EMPTY_ARGV);
    Assert.assertTrue(!s.isOK());
    Assert.assertEquals("test cases: 1; all failed", s.getMessage());
}
Also used : TestGroup(com.sun.tck.test.TestGroup) TestResult(com.oracle.tck.lib.autd2.TestResult) TestedAPI(com.sun.tck.test.TestedAPI) Test(org.junit.Test)

Example 4 with TestedAPI

use of com.sun.tck.test.TestedAPI in project jtharness by openjdk.

the class FailingSimpleTestCases method testedAPI_packages_class.

@Test
public void testedAPI_packages_class() {
    @TestedAPI(testedPackage = { "x.e.r", "s.e.g", "e.t.r" }, testedClass = "TheClass")
    @TestGroup
    class MyTest {

        @TestCase
        @TestedStatement("a statement")
        public void testCase() {
            Assert.fail();
        }
    }
    TestResult s = TU.runTestGroup(new MyTest(), TU.EMPTY_ARGV);
    Assert.assertTrue(!s.isOK());
    Assert.assertEquals("test cases: 1; all failed", s.getMessage());
}
Also used : TestGroup(com.sun.tck.test.TestGroup) TestResult(com.oracle.tck.lib.autd2.TestResult) TestedAPI(com.sun.tck.test.TestedAPI) Test(org.junit.Test)

Example 5 with TestedAPI

use of com.sun.tck.test.TestedAPI in project jtharness by openjdk.

the class FailingSimpleTestCases method testedAPI_package.

@Test
public void testedAPI_package() {
    @TestedAPI(testedPackage = "x.e.r")
    @TestGroup
    class MyTest {

        @TestCase
        @TestedStatement("a statement")
        public void testCase() {
            Assert.fail();
        }
    }
    TestResult s = TU.runTestGroup(new MyTest(), TU.EMPTY_ARGV);
    Assert.assertTrue(!s.isOK());
    Assert.assertEquals("test cases: 1; all failed", s.getMessage());
}
Also used : TestGroup(com.sun.tck.test.TestGroup) TestResult(com.oracle.tck.lib.autd2.TestResult) TestedAPI(com.sun.tck.test.TestedAPI) Test(org.junit.Test)

Aggregations

TestedAPI (com.sun.tck.test.TestedAPI)11 TestResult (com.oracle.tck.lib.autd2.TestResult)10 TestGroup (com.sun.tck.test.TestGroup)10 Test (org.junit.Test)10 ArrayList (java.util.ArrayList)1 StringJoiner (java.util.StringJoiner)1