use of com.sun.tck.lib.tgf.TestData in project jtharness by openjdk.
the class Examples method test_03.
@Test
public void test_03() {
@TestGroup
class Test {
Values colors = createColumn(BLUE, BLACK, WHITE).<Color>filter(c -> createRow(c.darker(), c.brighter()));
@TestCase
@TestData("colors")
public void test(Color darker, Color brighter) {
assertTrue(darker.getRed() <= brighter.getRed());
assertTrue(darker.getGreen() <= brighter.getGreen());
assertTrue(darker.getBlue() <= brighter.getBlue());
}
}
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.lib.tgf.TestData in project jtharness by openjdk.
the class ArraysOfPrimitives method arrayAsReturnType_shorts_special_case.
@org.junit.Test
public void arrayAsReturnType_shorts_special_case() {
final List<Short> is = new ArrayList<Short>();
final List<Short> js = new ArrayList<Short>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
short[][] shorts = { { 23234, 23400 } };
@TestCase
@TestData("shorts")
public void test(short i, short j) throws Throwable {
is.add(i);
js.add(j);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(1, is.size());
Assert.assertEquals(1, js.size());
Assert.assertEquals(23234, (short) is.get(0));
Assert.assertEquals(23400, (short) js.get(0));
}
use of com.sun.tck.lib.tgf.TestData in project jtharness by openjdk.
the class ArraysOfPrimitives method arrayAsReturnType_bytes_special_case_1.
@org.junit.Test
public void arrayAsReturnType_bytes_special_case_1() {
final List<Byte> is = new ArrayList<Byte>();
final List<Byte> js = new ArrayList<Byte>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
byte[][] bytes = { { 34, 12 }, { 89, 29 } };
@TestCase
@TestData("bytes")
public void test(byte i, byte j) throws Throwable {
is.add(i);
js.add(j);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(2, is.size());
Assert.assertEquals(2, js.size());
Assert.assertEquals(34, (byte) is.get(0));
Assert.assertEquals(12, (byte) js.get(0));
Assert.assertEquals(89, (byte) is.get(1));
Assert.assertEquals(29, (byte) js.get(1));
}
use of com.sun.tck.lib.tgf.TestData in project jtharness by openjdk.
the class ArraysOfPrimitives method arrayAsReturnType_doubles_special_case.
@org.junit.Test
public void arrayAsReturnType_doubles_special_case() {
final List<Double> is = new ArrayList<Double>();
final List<Double> js = new ArrayList<Double>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
double[][] doubles = { { 3.96786, 8678.18 } };
@TestCase
@TestData("doubles")
public void test(double i, double j) throws Throwable {
is.add(i);
js.add(j);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(1, is.size());
Assert.assertEquals(1, js.size());
Assert.assertEquals(3.96786, (double) is.get(0), 0.0001);
Assert.assertEquals(8678.18, (double) js.get(0), 0.0001);
}
use of com.sun.tck.lib.tgf.TestData in project jtharness by openjdk.
the class ArraysOfPrimitives method arrayAsReturnType_bytes_special_case.
@org.junit.Test
public void arrayAsReturnType_bytes_special_case() {
final List<Byte> is = new ArrayList<Byte>();
final List<Byte> js = new ArrayList<Byte>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
byte[][] bytes = { { 3, 18 } };
@TestCase
@TestData("bytes")
public void test(byte i, byte j) throws Throwable {
is.add(i);
js.add(j);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(1, is.size());
Assert.assertEquals(1, js.size());
Assert.assertEquals(3, (byte) is.get(0));
Assert.assertEquals(18, (byte) js.get(0));
}
Aggregations