use of com.sun.tck.test.TestGroup in project jtharness by openjdk.
the class Examples method test_06.
@Test(expected = java.lang.RuntimeException.class)
public // TODO rethink TransformingIterator design to make this possible
void test_06() {
@TestGroup
class TestTransformingIterator {
Values multiplyValues = DataFactory.createValues(new Comparable<?>[][] { { 1, 2 }, { 3, 4 } }).multiply(DataFactory.createValues(new Comparable<?>[][] { { 5, 6 }, { 7, 8 } })).filter((Comparable<?>... i) -> DataFactory.createRow((Object) i));
@TestCase
@TestData("multiplyValues")
public void testToString(Comparable<?> a) {
// Control won't come here, it fails at TransformingIterator.
}
}
com.oracle.tck.lib.autd2.TestResult s = TU.runTestGroup(new TestTransformingIterator());
Assert.assertFalse(s.isOK());
}
use of com.sun.tck.test.TestGroup in project jtharness by openjdk.
the class Examples method test_09.
@Test
public void test_09() {
@TestGroup
class TestTransformingIterator {
Values multiplyValues = DataFactory.createValues(new Comparable<?>[][] { { 1, 2 }, { 3, 4 } }).filter((Comparable<?>[] objectsToUse) -> DataFactory.createRow((Object[]) objectsToUse));
@TestCase
@TestData("multiplyValues")
public void testToString(Comparable<?> a, Comparable<?> b) {
}
}
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_10_01.
@Test
public void test_10_01() {
@TestGroup
class TestTransformingIterator {
int calls;
Values multiplyValues = DataFactory.createValues(new Comparable<?>[][] { {}, { 3, 4 } }).filter((Object[] objectsToUse) -> {
calls++;
return DataFactory.createRow(objectsToUse);
});
@TestCase
@TestData("multiplyValues")
public void testToString(Comparable<?> a, Comparable<?> b) {
System.out.println("TestTransformingIterator.testToString");
}
}
TestTransformingIterator tg = new TestTransformingIterator();
com.oracle.tck.lib.autd2.TestResult s = TU.runTestGroup(tg);
Assert.assertTrue(s.isOK());
Assert.assertEquals(2, tg.calls);
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_04.
@Test
public void test_05_02_04() {
@TestGroup
class TestTransformingIterator {
Values multiplyValues = DataFactory.createValues(new Comparable<?>[][] { { 1 }, { 3 } }).filter((Values.Transformer1<Object[]>) DataFactory::createRow);
@TestCase
@TestData("multiplyValues")
public void testToString(Integer d) {
}
}
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_03_array_01_old_approach_2_01.
@Test
public void test_03_array_01_old_approach_2_01() {
@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(Color[] colors) {
if (colors.length > 0) {
return createRow(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());
}
Aggregations