Search in sources :

Example 31 with TestObject

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

the class Mixed method testDiag_Combine_2_1.

@Test
public void testDiag_Combine_2_1() {
    Values vs1 = createColumn("a", "b", "c", "d", "e");
    Values vs2 = createColumn("x", "y", "z");
    Values vs3 = createColumn(1);
    Values vs4 = createColumn(new TestObject("2"));
    List<Object[]> expected = new ArrayList<Object[]>();
    expected.add(new Object[] { "a", "x", 1, new TestObject("2") });
    expected.add(new Object[] { "b", "y", 1, new TestObject("2") });
    expected.add(new Object[] { "c", "z", 1, new TestObject("2") });
    expected.add(new Object[] { "d", "x", 1, new TestObject("2") });
    expected.add(new Object[] { "e", "y", 1, new TestObject("2") });
    ValuesComparison.compare(vs1.pseudoMultiply(vs2).multiply(vs3).pseudoMultiply(vs4), 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 32 with TestObject

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

the class Cache method runTest.

private long runTest(final Values column, boolean createCache) {
    final long start = System.currentTimeMillis();
    final Values dataToUse = createCache ? column.createCache() : column;
    TU.runTestGroup(new BaseTestGroup() {

        Values setup() {
            return dataToUse.multiply(dataToUse);
        }

        @TestCase
        @TestData("setup")
        public void theTest(TestObject t1, TestObject t2) {
        }
    });
    return System.currentTimeMillis() - start;
}
Also used : TestCase(com.sun.tck.test.TestCase) BaseTestGroup(com.oracle.tck.lib.autd2.unittests.BaseTestGroup) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject)

Example 33 with TestObject

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

the class Constructors method test_LazyInitialization.

@Test
public void test_LazyInitialization() {
    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");
        }
    });
    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 : 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 34 with TestObject

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

the class Intersect method testIntersect_1_7.

@Test
public void testIntersect_1_7() {
    Values values_1 = DataFactory.createValues(new Object[][] { { new TestObject("one"), new TestObject("two") }, { new TestObject("three"), new TestObject("four") }, { new TestObject("five"), new TestObject("six") } });
    Values result = values_1.intersect(new Object[][] { { new TestObject("one"), new TestObject("two") }, { new TestObject("three_"), new TestObject("three_") } });
    List<Object[]> expected = new ArrayList<Object[]>();
    expected.add(new Object[] { new TestObject("one"), new TestObject("two") });
    ValuesComparison.compare(result, 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 35 with TestObject

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

the class Intersect method testIntersect_1_6.

@Test
public void testIntersect_1_6() {
    Values values_1 = DataFactory.createValues(new Object[][] { { new TestObject("one"), new TestObject("two") }, { new TestObject("three"), new TestObject("three") } });
    Values result = values_1.intersect(new Object[][] { { new TestObject("one"), new TestObject("two") }, { new TestObject("three_"), new TestObject("three_") } });
    List<Object[]> expected = new ArrayList<Object[]>();
    expected.add(new Object[] { new TestObject("one"), new TestObject("two") });
    ValuesComparison.compare(result, 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