Search in sources :

Example 31 with TestData

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

the class ArraysOfPrimitives method arrayAsReturnType_chars_special_case.

@org.junit.Test
public void arrayAsReturnType_chars_special_case() {
    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 = { { 3, 18 } };

        @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(1, is.size());
    Assert.assertEquals(1, js.size());
    Assert.assertEquals(3, (char) is.get(0));
    Assert.assertEquals(18, (char) 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)

Example 32 with TestData

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

the class ArraysOfPrimitives method arrayAsReturnType_ints_special_case.

@org.junit.Test
public void arrayAsReturnType_ints_special_case() {
    final List<Integer> is = new ArrayList<Integer>();
    final List<Integer> js = new ArrayList<Integer>();
    com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {

        int[][] ints = { { 89898, 176253 } };

        @TestCase
        @TestData("ints")
        public void test(int i, int 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(89898, (int) is.get(0));
    Assert.assertEquals(176253, (int) 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)

Example 33 with TestData

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

the class ArraysOfPrimitives method arrayAsReturnType_doubles_special_case_1.

@org.junit.Test
public void arrayAsReturnType_doubles_special_case_1() {
    final List<Double> is = new ArrayList<Double>();
    final List<Double> js = new ArrayList<Double>();
    com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {

        double[][] doubles = { { 5387.986, 6878.18 }, { 587.6786, 868.1678 } };

        @TestCase
        @TestData("doubles")
        public void test(double i, double 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(5387.986, (double) is.get(0), 0.0001);
    Assert.assertEquals(6878.18, (double) js.get(0), 0.0001);
    Assert.assertEquals(587.6786, (double) is.get(1), 0.0001);
    Assert.assertEquals(868.1678, (double) js.get(1), 0.0001);
}
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)

Example 34 with TestData

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

the class ArraysOfPrimitives method arrayAsReturnType_shorts_special_case_1.

@org.junit.Test
public void arrayAsReturnType_shorts_special_case_1() {
    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 = { { 243, 23 }, { 9009, 32000 } };

        @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(2, is.size());
    Assert.assertEquals(2, js.size());
    Assert.assertEquals(243, (short) is.get(0));
    Assert.assertEquals(23, (short) js.get(0));
    Assert.assertEquals(9009, (short) is.get(1));
    Assert.assertEquals(32000, (short) js.get(1));
}
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)

Example 35 with TestData

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

the class DataQueriesFromFields method test_4.

@org.junit.Test
public void test_4() {
    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.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));
}
Also used : TestData(com.sun.tck.lib.tgf.TestData) BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup) TestCase(com.sun.tck.test.TestCase) HashSet(java.util.HashSet)

Aggregations

TestData (com.sun.tck.lib.tgf.TestData)64 TestCase (com.sun.tck.test.TestCase)57 BaseTestGroup (com.oracle.tck.lib.autd2.unittests.BaseTestGroup)50 Test (org.junit.Test)37 ArrayList (java.util.ArrayList)30 Values (com.sun.tck.lib.tgf.Values)22 TestResult (com.oracle.tck.lib.autd2.TestResult)14 TestGroup (com.sun.tck.test.TestGroup)7 NonTestCase (com.oracle.tck.lib.autd2.NonTestCase)5 HashSet (java.util.HashSet)5 Color (java.awt.Color)4 List (java.util.List)4 ColorSpace (java.awt.color.ColorSpace)3 Collectors.toList (java.util.stream.Collectors.toList)3 Assert.assertEquals (com.sun.tck.lib.Assert.assertEquals)2 Assert.assertTrue (com.sun.tck.lib.Assert.assertTrue)2 ExpectedExceptions (com.sun.tck.lib.ExpectedExceptions)2 DataFactory (com.sun.tck.lib.tgf.DataFactory)2 DataFactory.createColumn (com.sun.tck.lib.tgf.DataFactory.createColumn)2 DataFactory.createRow (com.sun.tck.lib.tgf.DataFactory.createRow)2