use of com.sun.tck.test.TestGroup in project jtharness by openjdk.
the class FailingSimpleTestCases method testedAPI_packages_classes.
@Test
public void testedAPI_packages_classes() {
@TestedAPI(testedPackage = { "x.e.r", "s.e.g", "e.t.r" }, testedClass = { "TheClass", "AnotherClass" })
@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());
}
use of com.sun.tck.test.TestGroup in project jtharness by openjdk.
the class FailingSimpleTestCases method threeMixedTestCases_ForgotToAddStatusRecognizingProcessor_01.
@Test
public void threeMixedTestCases_ForgotToAddStatusRecognizingProcessor_01() {
final AtomicBoolean testCase_1_called = new AtomicBoolean();
final AtomicBoolean testCase_2_called = new AtomicBoolean();
final AtomicBoolean testCase_3_called = new AtomicBoolean();
@TestGroup
class TestGr {
@TestCase
@ExpectedExceptions(IllegalArgumentException.class)
public void test1() {
testCase_1_called.set(true);
throw new IllegalArgumentException();
}
@TestCase
public Status test2() {
testCase_2_called.set(true);
return Status.passed("Status passed");
}
@TestCase
public void test3() {
testCase_3_called.set(true);
}
}
TestResult testResult = TestRunner.run(new TestGr(), log, ref, TU.TG_PROC, TU.TC_PROC_STATUS_NOT_EXPECTED);
Assert.assertFalse(testResult.isOK());
Assert.assertTrue(testCase_1_called.get());
Assert.assertTrue(testCase_2_called.get());
Assert.assertTrue(testCase_3_called.get());
Assert.assertEquals("test cases: 3; passed: 2; failed: 1; failed: [test2]", testResult.getMessage());
}
use of com.sun.tck.test.TestGroup in project jtharness by openjdk.
the class FailingSimpleTestCases method testedAPI_packages_classes_method.
@Test
public void testedAPI_packages_classes_method() {
@TestedAPI(testedPackage = { "x.e.r", "s.e.g", "e.t.r" }, testedClass = { "TheClass", "AnotherClass" }, testedMember = "method")
@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());
}
use of com.sun.tck.test.TestGroup in project jtharness by openjdk.
the class FailingSimpleTestCases method testedAPI_packages_classes_methods.
@Test
public void testedAPI_packages_classes_methods() {
@TestedAPI(testedPackage = { "x.e.r", "s.e.g", "e.t.r" }, testedClass = { "TheClass", "AnotherClass" }, 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());
}
use of com.sun.tck.test.TestGroup in project jtharness by openjdk.
the class FailingSimpleTestCases method testedAPI_packages.
@Test
public void testedAPI_packages() {
@TestedAPI(testedPackage = { "x.e.r", "s.e.g", "e.t.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());
}
Aggregations