use of com.sun.tck.test.TestGroup in project jtharness by openjdk.
the class Examples method test_03_array_01_old_approach_2_02.
@Test
public void test_03_array_01_old_approach_2_02() {
@TestGroup
class Test {
Values blues = createColumn(new Color[] { BLACK, BLACK, RED, ORANGE }, new Color[] { BLUE }, new Color[] {}, new Color[] { RED, WHITE }).filter(new Object() {
@Transform
Values t(Object[] colors) {
if (colors.length > 0) {
return createRow(((Color) colors[0]).getBlue());
} else {
return null;
}
}
});
@TestCase
@TestData("blues")
public void test(int blue) {
assertTrue(blue >= 0);
}
}
com.oracle.tck.lib.autd2.TestResult s = TU.runTestGroup(new Test());
Assert.assertTrue(s.isOK());
Assert.assertEquals("test cases: 1; all passed", s.getMessage());
}
use of com.sun.tck.test.TestGroup in project jtharness by openjdk.
the class Examples method test_05.
@Test
public void test_05() {
@TestGroup
class TestTransformingIterator {
Values multiplyValues = DataFactory.createValues(new Comparable<?>[][] { { 1, 2 }, { 3, 4 } }).multiply(DataFactory.createValues(new Comparable<?>[][] { { 5, 6 }, { 7, 8 } })).filter((Object[] i) -> DataFactory.createRow(i));
@TestCase
@TestData("multiplyValues")
public void testToString(Comparable<?> a, Comparable<?> b, Comparable<?> c, Comparable<?> d) {
// Control won't come here, it fails at TransformingIterator.
}
}
com.oracle.tck.lib.autd2.TestResult s = TU.runTestGroup(new TestTransformingIterator());
Assert.assertTrue(s.isOK());
Assert.assertEquals("test cases: 1; all passed", s.getMessage());
}
use of com.sun.tck.test.TestGroup in project jtharness by openjdk.
the class Examples method test_05_02_02.
@Test
public void test_05_02_02() {
@TestGroup
class TestTransformingIterator {
Values multiplyValues = DataFactory.createValues(new Comparable<?>[][] { { 1, 5 }, { 3, 4 } }).filter((Object[] i) -> DataFactory.createRow(i));
@TestCase
@TestData("multiplyValues")
public void testToString(Integer d, Integer d1) {
}
}
com.oracle.tck.lib.autd2.TestResult s = TU.runTestGroup(new TestTransformingIterator());
Assert.assertTrue(s.isOK());
Assert.assertEquals("test cases: 1; all passed", s.getMessage());
}
use of com.sun.tck.test.TestGroup in project jtharness by openjdk.
the class Examples method test_05_03.
@Test
public void test_05_03() {
@TestGroup
class TestTransformingIterator {
Values multiplyValues = DataFactory.createValues(new Comparable<?>[][] { { 3 }, { 3, 4 } }).filter((Object i) -> DataFactory.createRow(i.toString().length()));
@TestCase
@TestData("multiplyValues")
public void testToString(Integer i) {
}
}
com.oracle.tck.lib.autd2.TestResult s = TU.runTestGroup(new TestTransformingIterator());
Assert.assertTrue(s.isOK());
Assert.assertEquals("test cases: 1; all passed", s.getMessage());
}
use of com.sun.tck.test.TestGroup in project jtharness by openjdk.
the class Examples method test_01.
@Test
public void test_01() {
@TestGroup
class Test {
@TestCase
@ExpectedExceptions(ArithmeticException.class)
public void test(@Longs({ 2L, 3L, 1000L, Long.MAX_VALUE }) long y) {
Math.multiplyExact(Long.MAX_VALUE, y);
}
}
TestResult testResult = TU.runTestGroup(new Test());
Assert.assertTrue(testResult.isOK());
Assert.assertEquals("test cases: 1; all passed", testResult.getMessage());
}
Aggregations