Search in sources :

Example 66 with TestCase

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

the class InlinedData method double_1.

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

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

Example 67 with TestCase

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

the class InlinedData method chars_1.

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

        @TestCase
        public void test(@Chars({ 28, 1 }) char c) throws Throwable {
            list.add(c);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertTrue(status.isOK());
    Assert.assertEquals(2, list.size());
    Assert.assertEquals(28, list.get(0), 0.0);
    Assert.assertEquals(1, 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 68 with TestCase

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

the class InlinedData method class_1.

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

        @TestCase
        public void test(@Classes({ String.class, Throwable.class }) Class<?> c) throws Throwable {
            list.add(c);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertTrue(status.isOK());
    Assert.assertEquals(2, list.size());
    Assert.assertEquals(String.class, list.get(0));
    Assert.assertEquals(Throwable.class, list.get(1));
}
Also used : TestCase(com.sun.tck.test.TestCase) ArrayList(java.util.ArrayList) BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup)

Example 69 with TestCase

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

the class InlinedData method strings_2.

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

Example 70 with TestCase

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

the class InlinedData method class_2.

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

        @TestCase
        public void test(@Classes(Number.class) Class<?> c) throws Throwable {
            list.add(c);
        }
    }, TU.EMPTY_ARGV);
    Assert.assertTrue(status.isOK());
    Assert.assertEquals(1, list.size());
    Assert.assertEquals(Number.class, list.get(0));
}
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