Search in sources :

Example 71 with TestCase

use of com.sun.tck.test.TestCase in project jtharness by openjdk.

the class InlinedData method int_2.

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

        @TestCase
        public void test(@Ints(867) int d) throws Throwable {
            list.add(867);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertTrue(status.isOK());
    Assert.assertEquals(1, list.size());
    Assert.assertEquals(867, list.get(0), 0.0);
}
Also used : TestCase(com.sun.tck.test.TestCase) ArrayList(java.util.ArrayList) BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup)

Example 72 with TestCase

use of com.sun.tck.test.TestCase in project jtharness by openjdk.

the class InlinedData method shorts_1.

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

        @TestCase
        public void test(@Shorts({ 23, 423 }) short s) throws Throwable {
            list.add(s);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertTrue(status.isOK());
    Assert.assertEquals(2, list.size());
    Assert.assertEquals(23, list.get(0), 0.0);
    Assert.assertEquals(423, list.get(1), 0.0);
}
Also used : TestCase(com.sun.tck.test.TestCase) ArrayList(java.util.ArrayList) BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup)

Example 73 with TestCase

use of com.sun.tck.test.TestCase in project jtharness by openjdk.

the class InlinedData method shorts_2.

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

        @TestCase
        public void test(@Shorts(1423) short s) throws Throwable {
            list.add(s);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertTrue(status.isOK());
    Assert.assertEquals(1, list.size());
    Assert.assertEquals(1423, list.get(0), 0.0);
}
Also used : TestCase(com.sun.tck.test.TestCase) ArrayList(java.util.ArrayList) BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup)

Example 74 with TestCase

use of com.sun.tck.test.TestCase in project jtharness by openjdk.

the class InlinedData method bool_2.

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

        @TestCase
        public void test(@Booleans(true) boolean b) throws Throwable {
            list.add(b);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertTrue(status.isOK());
    Assert.assertEquals(1, list.size());
    Assert.assertEquals(true, list.get(0));
}
Also used : TestCase(com.sun.tck.test.TestCase) ArrayList(java.util.ArrayList) BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup)

Example 75 with TestCase

use of com.sun.tck.test.TestCase in project jtharness by openjdk.

the class IteratorAsSupportedDataContainer method iteratorAsReturnType_mix_severalIterators.

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

        Iterator<Object[]> mixIterator = Arrays.<Object[]>asList(new Object[] { 89898, 176253, "123" }, new Object[] { 34324, 343424, "345" }).iterator();

        Iterator<Integer> iter_1 = Arrays.asList(89898, 34324).iterator();

        Iterator<Integer> iter_2 = Arrays.asList(176253, 343424).iterator();

        Iterator<String> iter_3 = Arrays.asList("123", "345").iterator();

        @TestCase
        public void test(@TestData("iter_1") int i, @TestData("iter_2") int j, @TestData("iter_3") String s) throws Throwable {
            is.add(i);
            js.add(j);
            strings.add(s);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertTrue(status.isOK());
    Assert.assertEquals(2, is.size());
    Assert.assertEquals(2, js.size());
    Assert.assertEquals(2, strings.size());
    Assert.assertEquals(89898, (int) is.get(0));
    Assert.assertEquals(176253, (int) js.get(0));
    Assert.assertEquals("123", strings.get(0));
    Assert.assertEquals(34324, (int) is.get(1));
    Assert.assertEquals(343424, (int) js.get(1));
    Assert.assertEquals("345", strings.get(1));
}
Also used : ArrayList(java.util.ArrayList) BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup) TestCase(com.sun.tck.test.TestCase) Test(org.junit.Test)

Aggregations

TestCase (com.sun.tck.test.TestCase)147 BaseTestGroup (com.oracle.tck.lib.autd2.unittests.BaseTestGroup)126 Test (org.junit.Test)77 ArrayList (java.util.ArrayList)72 TestData (com.sun.tck.lib.tgf.TestData)57 TestResult (com.oracle.tck.lib.autd2.TestResult)28 Values (com.sun.tck.lib.tgf.Values)28 HashSet (java.util.HashSet)13 DataFactory.createValues (com.sun.tck.lib.tgf.DataFactory.createValues)12 NonTestCase (com.oracle.tck.lib.autd2.NonTestCase)10 Operation (com.sun.tck.lib.tgf.data.Operation)10 TestObject (com.oracle.tck.lib.autd2.unittests.TestObject)9 PrintWriter (java.io.PrintWriter)8 InOrder (org.mockito.InOrder)8 List (java.util.List)4 DataFactory.createColumn (com.sun.tck.lib.tgf.DataFactory.createColumn)3 DataFactory.createRow (com.sun.tck.lib.tgf.DataFactory.createRow)3 java.util (java.util)3 Assert (org.junit.Assert)3 Assert.assertEquals (com.sun.tck.lib.Assert.assertEquals)2