Search in sources :

Example 21 with BaseTestGroup

use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.

the class MyTest method testRun_DataFilteredOutCompletely.

@Test
public void testRun_DataFilteredOutCompletely() {
    final ArrayList<String> arrayList = new ArrayList<String>();
    com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {

        Values setupOne() {
            return createColumn(1, 2).filter(new Object() {

                @Transform
                String filterOut(int i) {
                    return "a";
                }
            }).multiply().filter(new Object() {

                @Transform
                String end(String s) {
                    return null;
                }
            });
        }

        @TestCase
        @TestData("setupOne")
        public void myTest(String s) {
            arrayList.add(s);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertEquals(0, arrayList.size());
    Assert.assertTrue(status.isOK());
    Assert.assertEquals("Passed. test cases: 1; all passed", status.toString());
}
Also used : TestCase(com.sun.tck.test.TestCase) BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) Test(org.junit.Test)

Example 22 with BaseTestGroup

use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.

the class MyTest method testRun_Data_partlyFilteredInTheEnd.

@Test
public void testRun_Data_partlyFilteredInTheEnd() {
    final ArrayList<String> arrayList = new ArrayList<String>();
    com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {

        Values setupOne() {
            return createColumn(1, 2).filter(new Object() {

                @Transform
                String filterOut(int i) {
                    return "a";
                }
            }).multiply(createColumn("a", "b", "d").filter(new Object() {

                @Transform
                String end(String s) {
                    return null;
                }
            }));
        }

        @TestCase
        @TestData("setupOne")
        public void myTest(String s1, String s2, String s3, String s4) {
            arrayList.add(s1);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertEquals(0, arrayList.size());
    Assert.assertTrue(status.isOK());
    Assert.assertEquals("Passed. test cases: 1; all passed", status.toString());
}
Also used : BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup) TestCase(com.sun.tck.test.TestCase) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) Test(org.junit.Test)

Example 23 with BaseTestGroup

use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.

the class MyTest method test_dataFilteredOutCompletely_NotAppEx_messageChecking.

@Test
public void test_dataFilteredOutCompletely_NotAppEx_messageChecking() {
    final ArrayList<String> arrayList = new ArrayList<String>();
    com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {

        Values setupOne() {
            return createColumn(1, 2).filter(new Object() {

                @Transform
                String filterOut(int i) {
                    return null;
                }
            }).filter(new Object() {

                @Transform
                String end(String s) {
                    return "abc";
                }
            });
        }

        @TestCase
        @TestData("setupOne")
        public void myTest(String s) {
            arrayList.add(s);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertEquals(0, arrayList.size());
    Assert.assertTrue(status.isOK());
    Assert.assertEquals("Passed. test cases: 1; all passed", status.toString());
}
Also used : BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup) TestCase(com.sun.tck.test.TestCase) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) Test(org.junit.Test)

Example 24 with BaseTestGroup

use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup in project jtharness by openjdk.

the class MyTest method testRun_DataOK.

@Test
public void testRun_DataOK() {
    final ArrayList<String> arrayList = new ArrayList<String>();
    com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {

        Values setupOne() {
            return createColumn(1, 2).filter(new Object() {

                @Transform
                String filterOut(int i) {
                    return "a";
                }
            }).multiply(createColumn("a", "b", "d").filter(new Object() {

                @Transform
                String end(String s) {
                    return s;
                }
            }));
        }

        @TestCase
        @TestData("setupOne")
        public void myTest(String s1, String s2) {
            arrayList.add(s1);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertEquals(6, arrayList.size());
    Assert.assertTrue(status.isOK());
    Assert.assertEquals("Passed. test cases: 1; all passed", status.toString());
}
Also used : BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup) TestCase(com.sun.tck.test.TestCase) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) Test(org.junit.Test)

Example 25 with BaseTestGroup

use of com.oracle.tck.lib.autd2.unittests.BaseTestGroup 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));
}
Also used : TestData(com.sun.tck.lib.tgf.TestData) ArrayList(java.util.ArrayList) BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup) TestCase(com.sun.tck.test.TestCase)

Aggregations

BaseTestGroup (com.oracle.tck.lib.autd2.unittests.BaseTestGroup)132 TestCase (com.sun.tck.test.TestCase)126 ArrayList (java.util.ArrayList)73 Test (org.junit.Test)62 TestData (com.sun.tck.lib.tgf.TestData)47 Values (com.sun.tck.lib.tgf.Values)21 HashSet (java.util.HashSet)13 DataFactory.createValues (com.sun.tck.lib.tgf.DataFactory.createValues)12 NonTestCase (com.oracle.tck.lib.autd2.NonTestCase)11 TestResult (com.oracle.tck.lib.autd2.TestResult)11 TestObject (com.oracle.tck.lib.autd2.unittests.TestObject)9 Operation (com.sun.tck.lib.tgf.data.Operation)8 java.util (java.util)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 List (java.util.List)2 com.oracle.tck.lib.autd2 (com.oracle.tck.lib.autd2)1 CustomException (com.oracle.tck.lib.autd2.unittests.CustomException)1 TU (com.oracle.tck.lib.autd2.unittests.TU)1 ValuesComparison (com.oracle.tck.lib.autd2.unittests.ValuesComparison)1 com.sun.tck.lib.tgf (com.sun.tck.lib.tgf)1