Search in sources :

Example 1 with DataFactory.createValues

use of com.sun.tck.lib.tgf.DataFactory.createValues in project jtharness by openjdk.

the class Filtering method returningArrayUntouched.

@Test
public void returningArrayUntouched() {
    final java.util.List<Integer[]> passed = new ArrayList<Integer[]>();
    com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {

        private Values values() {
            return createColumn(0, 1, 2).filter(new Object() {

                @Transform
                Values create(int i) {
                    return DataFactory.createValues(new Object[][] { { new Integer[] { i, i + 1, i + 2 } } });
                }
            });
        }

        @TestCase
        @TestData("values")
        public void test(Integer[] integer) throws Throwable {
            passed.add(integer);
        }
    }, TU.EMPTY_ARGV);
    assertEquals(3, passed.size());
    assertArrayEquals(new Integer[] { 0, 1, 2 }, passed.get(0));
    assertArrayEquals(new Integer[] { 1, 2, 3 }, passed.get(1));
    assertArrayEquals(new Integer[] { 2, 3, 4 }, passed.get(2));
    assertTrue(status.isOK());
}
Also used : DataFactory.createValues(com.sun.tck.lib.tgf.DataFactory.createValues) BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup) TestResult(com.oracle.tck.lib.autd2.TestResult) java.util(java.util) TestCase(com.sun.tck.test.TestCase) Test(org.junit.Test)

Aggregations

TestResult (com.oracle.tck.lib.autd2.TestResult)1 BaseTestGroup (com.oracle.tck.lib.autd2.unittests.BaseTestGroup)1 DataFactory.createValues (com.sun.tck.lib.tgf.DataFactory.createValues)1 TestCase (com.sun.tck.test.TestCase)1 java.util (java.util)1 Test (org.junit.Test)1