Search in sources :

Example 21 with TestObject

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

the class Cache method test_1.

@Test
public void test_1() {
    Values values = DataFactory.createColumn(new AbstractValue<Object>() {

        public Object create() {
            return new TestObject("a");
        }
    }, new AbstractValue<Object>() {

        public Object create() {
            return new TestObject("b");
        }
    }, new AbstractValue<Object>() {

        public Object create() {
            return new TestObject("c");
        }
    }).createCache();
    List<Object[]> expected = new ArrayList<Object[]>();
    expected.add(new Object[] { new TestObject("a") });
    expected.add(new Object[] { new TestObject("b") });
    expected.add(new Object[] { new TestObject("c") });
    ValuesComparison.compare(values, expected);
}
Also used : ArrayList(java.util.ArrayList) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) Test(org.junit.Test)

Example 22 with TestObject

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

the class Constructors method testConstructor_TwoDim_2.

@Test
public void testConstructor_TwoDim_2() {
    Values values = DataFactory.createValues(new TestObject[][] { { new TestObject("a"), new TestObject("b") }, { new TestObject("b"), new TestObject("c") }, { new TestObject("e"), new TestObject("d") }, { new TestObject("x"), new TestObject("y") } });
    List<Object[]> expected = new ArrayList<Object[]>();
    expected.add(new TestObject[] { new TestObject("a"), new TestObject("b") });
    expected.add(new TestObject[] { new TestObject("b"), new TestObject("c") });
    expected.add(new TestObject[] { new TestObject("e"), new TestObject("d") });
    expected.add(new TestObject[] { new TestObject("x"), new TestObject("y") });
    ValuesComparison.compare(values, expected);
}
Also used : Values(com.sun.tck.lib.tgf.Values) ArrayList(java.util.ArrayList) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) Test(org.junit.Test)

Example 23 with TestObject

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

the class Constructors method testConstructor_Column_4.

@Test
public void testConstructor_Column_4() {
    final String s1 = TU.generateRandomString();
    final String s2 = TU.generateRandomString();
    final String s3 = TU.generateRandomString();
    Values values = DataFactory.createColumn(new TestObject(s1), new TestObject(s2), new TestObject(s3));
    List<Object[]> expected = new ArrayList<Object[]>();
    expected.add(new Object[] { new TestObject(s1) });
    expected.add(new Object[] { new TestObject(s2) });
    expected.add(new Object[] { new TestObject(s3) });
    ValuesComparison.compare(values, expected);
}
Also used : Values(com.sun.tck.lib.tgf.Values) ArrayList(java.util.ArrayList) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) Test(org.junit.Test)

Example 24 with TestObject

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

the class Constructors method testConstructor_Column_3.

@Test
public void testConstructor_Column_3() {
    final String s = TU.generateRandomString();
    Values values = DataFactory.createColumn(new TestObject(s + "suff"));
    List<Object[]> expected = new ArrayList<Object[]>();
    expected.add(new Object[] { new TestObject(s + "suff") });
    ValuesComparison.compare(values, expected);
}
Also used : Values(com.sun.tck.lib.tgf.Values) ArrayList(java.util.ArrayList) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) Test(org.junit.Test)

Example 25 with TestObject

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

the class Constructors method testConstructor_Row_1.

@Test
public void testConstructor_Row_1() {
    final String s1 = TU.generateRandomString();
    final String s2 = TU.generateRandomString();
    final String s3 = TU.generateRandomString();
    Values values = DataFactory.createRow(new TestObject(s1), new TestObject(s2), new TestObject(s3));
    List<Object[]> expected = new ArrayList<Object[]>();
    expected.add(new Object[] { new TestObject(s1), new TestObject(s2), new TestObject(s3) });
    ValuesComparison.compare(values, expected);
}
Also used : Values(com.sun.tck.lib.tgf.Values) ArrayList(java.util.ArrayList) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) Test(org.junit.Test)

Aggregations

TestObject (com.oracle.tck.lib.autd2.unittests.TestObject)61 Test (org.junit.Test)60 AssertionFailedException (com.sun.tck.lib.AssertionFailedException)22 ArrayList (java.util.ArrayList)20 Values (com.sun.tck.lib.tgf.Values)18 BaseTestGroup (com.oracle.tck.lib.autd2.unittests.BaseTestGroup)1 TestCase (com.sun.tck.test.TestCase)1 List (java.util.List)1