use of com.oracle.tck.lib.autd2 in project jtharness by openjdk.
the class ReferenceAttachedToParam method class_1.
@org.junit.Test
public void class_1() {
final List<Class<?>> list = new ArrayList<Class<?>>();
com.oracle.tck.lib.autd2.TestResult status = TU.runTestGroup(new BaseTestGroup() {
Class<?>[] classes = { String.class, Throwable.class };
@TestCase
public void test(@TestData("classes") Class<?> c) throws Throwable {
list.add(c);
}
});
Assert.assertTrue(status.isOK());
Assert.assertEquals(2, list.size());
Assert.assertEquals(String.class, list.get(0));
Assert.assertEquals(Throwable.class, list.get(1));
}
use of com.oracle.tck.lib.autd2 in project jtharness by openjdk.
the class ReferenceAttachedToParam method mixed_default.
@org.junit.Test
public void mixed_default() {
final List<Class<?>> list_1 = new ArrayList<Class<?>>();
final List<String> list_2 = new ArrayList<String>();
com.oracle.tck.lib.autd2.TestResult status = TU.runTestGroup(new BaseTestGroup() {
Values strings_ = DataFactory.createColumn("a", "b", "c");
Class<?>[] classes = { String.class, Throwable.class };
@TestCase
public void test(@TestData("classes") Class<?> c, @TestData("strings_") String s) throws Throwable {
list_1.add(c);
list_2.add(s);
}
});
Assert.assertTrue(status.isOK());
Assert.assertEquals(3, list_1.size());
Assert.assertEquals(3, list_2.size());
Assert.assertEquals(String.class, list_1.get(0));
Assert.assertEquals(Throwable.class, list_1.get(1));
Assert.assertEquals(String.class, list_1.get(2));
Assert.assertEquals("a", list_2.get(0));
Assert.assertEquals("b", list_2.get(1));
Assert.assertEquals("c", list_2.get(2));
}
use of com.oracle.tck.lib.autd2 in project jtharness by openjdk.
the class ReferenceAttachedToParam method shorts_1.
@org.junit.Test
public void shorts_1() {
final List<Integer> list = new ArrayList<Integer>();
com.oracle.tck.lib.autd2.TestResult status = TU.runTestGroup(new BaseTestGroup() {
Values ints = DataFactory.createColumn(23, 423);
@TestCase
public void test(@TestData("ints") int i) throws Throwable {
list.add(i);
}
});
Assert.assertTrue(status.isOK());
Assert.assertEquals(2, list.size());
Assert.assertEquals(23, list.get(0), 0.0);
Assert.assertEquals(423, list.get(1), 0.0);
}
use of com.oracle.tck.lib.autd2 in project jtharness by openjdk.
the class ReferenceAttachedToParam method mixed_mult_2.
@org.junit.Test
public void mixed_mult_2() {
final List<Class<?>> list_1 = new ArrayList<Class<?>>();
final List<String> list_2 = new ArrayList<String>();
com.oracle.tck.lib.autd2.TestResult status = TU.runTestGroup(new BaseTestGroup() {
Values strings_ = DataFactory.createColumn("aa", "bb", "cc");
@TestCase
@Operation(Operation.TYPE.MULTIPLY)
public void test(@Classes({ String.class, Throwable.class }) Class<?> c, @TestData("strings_") String s) throws Throwable {
list_1.add(c);
list_2.add(s);
}
});
Assert.assertTrue(status.isOK());
Assert.assertEquals(6, list_1.size());
Assert.assertEquals(6, list_2.size());
Assert.assertEquals(String.class, list_1.get(0));
Assert.assertEquals(String.class, list_1.get(1));
Assert.assertEquals(String.class, list_1.get(2));
Assert.assertEquals(Throwable.class, list_1.get(3));
Assert.assertEquals(Throwable.class, list_1.get(4));
Assert.assertEquals(Throwable.class, list_1.get(5));
Assert.assertEquals("aa", list_2.get(0));
Assert.assertEquals("bb", list_2.get(1));
Assert.assertEquals("cc", list_2.get(2));
Assert.assertEquals("aa", list_2.get(3));
Assert.assertEquals("bb", list_2.get(4));
Assert.assertEquals("cc", list_2.get(5));
}
use of com.oracle.tck.lib.autd2 in project jtharness by openjdk.
the class General method test_2.
@Test
public void test_2() {
List<Object[]> expected = new ArrayList<Object[]>();
final List<Object[]> actual = new ArrayList<Object[]>();
expected.add(new Object[] { "a", 1 });
expected.add(new Object[] { "b", 2 });
BaseTestGroup test = new BaseTestGroup() {
Values sampleSetup() {
return DataFactory.createColumn("a", "b").pseudoMultiply(1, 2);
}
@TestCase
@TestData("sampleSetup")
public void test(String s, int i) {
actual.add(new Object[] { s, i });
}
};
com.oracle.tck.lib.autd2.TestResult status = TU.runTestGroup(test);
ValuesComparison.compare(expected, actual);
Assert.assertTrue(status.isOK());
}
Aggregations