use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class ArraysOfPrimitives method arrayAsReturnType_chars_special_case_1.
@org.junit.Test
public void arrayAsReturnType_chars_special_case_1() {
final List<Character> is = new ArrayList<Character>();
final List<Character> js = new ArrayList<Character>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
char[][] chars = { { 34, 12 }, { 89, 29 } };
@TestCase
@TestData("chars")
public void test(char i, char 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, (char) is.get(0));
Assert.assertEquals(12, (char) js.get(0));
Assert.assertEquals(89, (char) is.get(1));
Assert.assertEquals(29, (char) js.get(1));
}
use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class DataQueriesFromFields method test_1.
@org.junit.Test
public void test_1() {
final Set<Integer> set = new HashSet<Integer>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
private ValuesHolder holder = new ValuesHolder();
@TestCase
@TestData("holder.setup")
public void test(int i) throws Throwable {
set.add(i);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(4, set.size());
Assert.assertTrue(set.contains(1));
Assert.assertTrue(set.contains(3));
Assert.assertTrue(set.contains(7));
Assert.assertTrue(set.contains(9));
}
use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class DataQueriesFromFields method test_3.
@org.junit.Test
public void test_3() {
final Set<Integer> set = new HashSet<Integer>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
private ValuesHolder3 holder3 = new ValuesHolder3();
@TestCase
@TestData("holder3.holder2.holder.setup")
public void test(int i) throws Throwable {
set.add(i);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(4, set.size());
Assert.assertTrue(set.contains(1));
Assert.assertTrue(set.contains(3));
Assert.assertTrue(set.contains(7));
Assert.assertTrue(set.contains(9));
}
use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class InlinedArgData_ManyArgs method int_1.
@org.junit.Test
public void int_1() {
final List<Integer> list = new ArrayList<Integer>();
com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {
@TestCase
public void test(@Ints({ 45, 7, 3 }) int i, @Ints({ 8, 34, 9 }) int j, @Ints({ 7, 5, 14 }) int k) throws Throwable {
list.add(i);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(3, list.size());
Assert.assertEquals(45, list.get(0), 0.0);
Assert.assertEquals(7, list.get(1), 0.0);
Assert.assertEquals(3, list.get(2), 0.0);
}
use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.
the class InlinedArgData_ManyArgs method intString_mult_4.
@org.junit.Test
public void intString_mult_4() {
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() {
List<Integer> intsData = Arrays.asList(1, 2, 3);
String[] stringsData = { "a", "b" };
@TestCase
@Operation(Operation.TYPE.MULTIPLY)
public void test(@TestData("intsData") int i, @TestData("stringsData") String s) {
ints.add(i);
strings.add(s);
}
}, TU.EMPTY_ARGV);
Assert.assertTrue(status.isOK());
Assert.assertEquals(6, ints.size());
Assert.assertEquals(1, ints.get(0), 0.0);
Assert.assertEquals(1, ints.get(1), 0.0);
Assert.assertEquals(2, ints.get(2), 0.0);
Assert.assertEquals(2, ints.get(3), 0.0);
Assert.assertEquals(3, ints.get(4), 0.0);
Assert.assertEquals(3, ints.get(5), 0.0);
Assert.assertEquals(6, strings.size());
Assert.assertEquals("a", strings.get(0));
Assert.assertEquals("b", strings.get(1));
Assert.assertEquals("a", strings.get(2));
Assert.assertEquals("b", strings.get(3));
Assert.assertEquals("a", strings.get(4));
Assert.assertEquals("b", strings.get(5));
}
Aggregations