Search in sources :

Example 61 with TestCase

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

the class InlinedData method bytes_2.

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

        @TestCase
        public void test(@Bytes(56) byte b) throws Throwable {
            list.add(b);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertTrue(status.isOK());
    Assert.assertEquals(1, list.size());
    Assert.assertEquals(56, 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 62 with TestCase

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

the class InlinedData method longs_1.

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

        @TestCase
        public void test(@Longs({ 234234, 23423 }) long f) throws Throwable {
            list.add(f);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertTrue(status.isOK());
    Assert.assertEquals(2, list.size());
    Assert.assertEquals(234234, list.get(0), 0.0);
    Assert.assertEquals(23423, 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 63 with TestCase

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

the class InlinedData method bytes_1_1.

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

        @TestCase
        public void test(@Bytes({ 48, 2 }) byte b) throws Throwable {
            list.add(b);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertTrue(status.isOK());
    Assert.assertEquals(2, list.size());
    Assert.assertEquals(48, list.get(0), 0.0);
    Assert.assertEquals(2, 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 64 with TestCase

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

the class InlinedData method bool_1.

@org.junit.Test
public void bool_1() {
    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, false, false, false }) boolean b) throws Throwable {
            list.add(b);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertTrue(status.isOK());
    Assert.assertEquals(4, list.size());
    Assert.assertEquals(true, list.get(0));
    Assert.assertEquals(false, list.get(1));
    Assert.assertEquals(false, list.get(2));
    Assert.assertEquals(false, list.get(3));
}
Also used : TestCase(com.sun.tck.test.TestCase) ArrayList(java.util.ArrayList) BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup)

Example 65 with TestCase

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

the class InlinedData method strings_1_1.

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

        @TestCase
        public void test(@Strings({ "a", "b", "c" }) String s) throws Throwable {
            list.add(s);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertTrue(status.isOK());
    Assert.assertEquals(3, list.size());
    Assert.assertEquals("a", list.get(0));
    Assert.assertEquals("b", list.get(1));
    Assert.assertEquals("c", list.get(2));
}
Also used : TestCase(com.sun.tck.test.TestCase) ArrayList(java.util.ArrayList) BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup)

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