use of com.oracle.tck.lib.autd2 in project jtharness by openjdk.
the class InlinedArgData_ManyArgs method intString_1.
@org.junit.Test
public void intString_1() {
final List<Integer> ints = new ArrayList<Integer>();
final List<String> strings = new ArrayList<String>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
@TestCase
public void test(@Ints({ 1, 2, 3 }) int i, @Strings({ "a", "b" }) String s) {
ints.add(i);
strings.add(s);
System.out.println(MessageFormat.format("i = {0}, s = {1}", i, s));
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(3, ints.size());
Assert.assertEquals(1, ints.get(0), 0.0);
Assert.assertEquals(2, ints.get(1), 0.0);
Assert.assertEquals(3, ints.get(2), 0.0);
Assert.assertEquals(3, strings.size());
Assert.assertEquals("a", strings.get(0));
Assert.assertEquals("b", strings.get(1));
Assert.assertEquals("a", strings.get(2));
}
use of com.oracle.tck.lib.autd2 in project jtharness by openjdk.
the class InlinedData method bytes_2.
@org.junit.Test
public void bytes_2() {
final List<Byte> list = new ArrayList<Byte>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
@TestCase
public void test(@Bytes(56) byte b) throws Throwable {
list.add(b);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(1, list.size());
Assert.assertEquals(56, list.get(0), 0.0);
}
use of com.oracle.tck.lib.autd2 in project jtharness by openjdk.
the class InlinedData method longs_1.
@org.junit.Test
public void longs_1() {
final List<Long> list = new ArrayList<Long>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
@TestCase
public void test(@Longs({ 234234, 23423 }) long f) throws Throwable {
list.add(f);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(2, list.size());
Assert.assertEquals(234234, list.get(0), 0.0);
Assert.assertEquals(23423, list.get(1), 0.0);
}
use of com.oracle.tck.lib.autd2 in project jtharness by openjdk.
the class InlinedData method bytes_1_1.
@org.junit.Test
public void bytes_1_1() {
final List<Byte> list = new ArrayList<Byte>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
@TestCase
public void test(@Bytes({ 48, 2 }) byte b) throws Throwable {
list.add(b);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(2, list.size());
Assert.assertEquals(48, list.get(0), 0.0);
Assert.assertEquals(2, list.get(1), 0.0);
}
use of com.oracle.tck.lib.autd2 in project jtharness by openjdk.
the class InlinedData method bool_1.
@org.junit.Test
public void bool_1() {
final List<Boolean> list = new ArrayList<Boolean>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
@TestCase
public void test(@Booleans({ true, false, false, false }) boolean b) throws Throwable {
list.add(b);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(4, list.size());
Assert.assertEquals(true, list.get(0));
Assert.assertEquals(false, list.get(1));
Assert.assertEquals(false, list.get(2));
Assert.assertEquals(false, list.get(3));
}
Aggregations