Search in sources :

Example 26 with TestData

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

the class ArraysOfPrimitives method arrayAsReturnType_floats_special_case_1.

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

        float[][] floats = { { 538767.96f, 878.1f }, { 57.6f, 78.1678f } };

        @TestCase
        @TestData("floats")
        public void test(float i, float 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(538767.96f, is.get(0), 0.0001);
    Assert.assertEquals(878.1f, js.get(0), 0.0001);
    Assert.assertEquals(57.6f, is.get(1), 0.0001);
    Assert.assertEquals(78.1678f, 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 27 with TestData

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

the class ArraysOfPrimitives method arrayAsReturnType_ints_special_case_1.

@org.junit.Test
public void arrayAsReturnType_ints_special_case_1() {
    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 }, { 34324, 343424 } };

        @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(2, is.size());
    Assert.assertEquals(2, js.size());
    Assert.assertEquals(89898, (int) is.get(0));
    Assert.assertEquals(176253, (int) js.get(0));
    Assert.assertEquals(34324, (int) is.get(1));
    Assert.assertEquals(343424, (int) 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 28 with TestData

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

the class ArraysOfPrimitives method arrayAsReturnType_floats_special_case.

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

        float[][] floats = { { 3.65786f, 9078.0966f } };

        @TestCase
        @TestData("floats")
        public void test(float i, float 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.65786f, is.get(0), 0.0001);
    Assert.assertEquals(9078.0966f, js.get(0), 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 29 with TestData

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

the class ArraysOfPrimitives method arrayAsReturnType_bools_special_case.

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

        boolean[][] bools = { { true, false } };

        @TestCase
        @TestData("bools")
        public void test(boolean i, boolean 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(true, (boolean) is.get(0));
    Assert.assertEquals(false, (boolean) 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 30 with TestData

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

the class ArraysOfPrimitives method arrayAsReturnType_bools_special_case_1.

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

        boolean[][] bools = { { true, false }, { false, true } };

        @TestCase
        @TestData("bools")
        public void test(boolean i, boolean 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(true, (boolean) is.get(0));
    Assert.assertEquals(false, (boolean) js.get(0));
    Assert.assertEquals(false, (boolean) is.get(1));
    Assert.assertEquals(true, (boolean) 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)

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