Search in sources :

Example 51 with com.oracle.tck.lib.autd2

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

the class ArraysOfPrimitives method arrayAsReturnType_double.

@org.junit.Test
public void arrayAsReturnType_double() {
    final Set<Double> set = new HashSet<Double>();
    com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {

        double[] doubles = { 0., 3.4, 67.3456, Double.MAX_VALUE };

        @TestCase
        public void test(@TestData("doubles") double d) throws Throwable {
            set.add(d);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertTrue(status.isOK());
    Assert.assertEquals(4, set.size());
    Assert.assertTrue(set.contains(0.));
    Assert.assertTrue(set.contains(3.4));
    Assert.assertTrue(set.contains(67.3456));
    Assert.assertTrue(set.contains(Double.MAX_VALUE));
}
Also used : TestCase(com.sun.tck.test.TestCase) BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup) HashSet(java.util.HashSet)

Example 52 with com.oracle.tck.lib.autd2

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

the class ArraysOfPrimitives method arrayAsReturnType_byte.

@org.junit.Test
public void arrayAsReturnType_byte() {
    final Set<Byte> set = new HashSet<Byte>();
    com.oracle.tck.lib.autd2.TestResult status = com.oracle.tck.lib.autd2.unittests.TU.runTestGroup(new BaseTestGroup() {

        byte[] bytes = { 0, 1, 120, 45, 8 };

        @TestCase
        public void test(@TestData("bytes") byte b) throws Throwable {
            set.add(b);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertTrue(status.isOK());
    Assert.assertEquals(5, set.size());
    Assert.assertTrue(set.contains((byte) 0));
    Assert.assertTrue(set.contains((byte) 1));
    Assert.assertTrue(set.contains((byte) 120));
    Assert.assertTrue(set.contains((byte) 45));
    Assert.assertTrue(set.contains((byte) 8));
}
Also used : TestCase(com.sun.tck.test.TestCase) BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup) HashSet(java.util.HashSet)

Example 53 with com.oracle.tck.lib.autd2

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

the class ArraysOfPrimitives method arrayAsReturnType_bytes_special_case_1.

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

        byte[][] bytes = { { 34, 12 }, { 89, 29 } };

        @TestCase
        @TestData("bytes")
        public void test(byte i, byte 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(34, (byte) is.get(0));
    Assert.assertEquals(12, (byte) js.get(0));
    Assert.assertEquals(89, (byte) is.get(1));
    Assert.assertEquals(29, (byte) 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 54 with com.oracle.tck.lib.autd2

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

the class ArraysOfPrimitives method arrayAsReturnType_doubles_special_case.

@org.junit.Test
public void arrayAsReturnType_doubles_special_case() {
    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 = { { 3.96786, 8678.18 } };

        @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(1, is.size());
    Assert.assertEquals(1, js.size());
    Assert.assertEquals(3.96786, (double) is.get(0), 0.0001);
    Assert.assertEquals(8678.18, (double) 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 55 with com.oracle.tck.lib.autd2

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

the class ArraysOfPrimitives method arrayAsReturnType_bytes_special_case.

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

        byte[][] bytes = { { 3, 18 } };

        @TestCase
        @TestData("bytes")
        public void test(byte i, byte 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, (byte) is.get(0));
    Assert.assertEquals(18, (byte) 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

TestCase (com.sun.tck.test.TestCase)139 BaseTestGroup (com.oracle.tck.lib.autd2.unittests.BaseTestGroup)135 Test (org.junit.Test)107 ArrayList (java.util.ArrayList)73 TestData (com.sun.tck.lib.tgf.TestData)61 TestResult (com.oracle.tck.lib.autd2.TestResult)52 Values (com.sun.tck.lib.tgf.Values)50 TestGroup (com.sun.tck.test.TestGroup)30 HashSet (java.util.HashSet)13 DataFactory.createValues (com.sun.tck.lib.tgf.DataFactory.createValues)12 NonTestCase (com.oracle.tck.lib.autd2.NonTestCase)11 Operation (com.sun.tck.lib.tgf.data.Operation)10 TestObject (com.oracle.tck.lib.autd2.unittests.TestObject)8 Color (java.awt.Color)7 List (java.util.List)5 DataFactory (com.sun.tck.lib.tgf.DataFactory)4 DataFactory.createColumn (com.sun.tck.lib.tgf.DataFactory.createColumn)3 DataFactory.createRow (com.sun.tck.lib.tgf.DataFactory.createRow)3 PrintWriter (java.io.PrintWriter)3 java.util (java.util)3