Search in sources :

Example 41 with TestObject

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

the class MyTest method wrappingOneDimensionalArray_2.

@Test
public void wrappingOneDimensionalArray_2() {
    final Values result = createColumn("1", "2", "3").filter(new Object() {

        @Transform
        public TestObject[] build(String s) {
            return new TestObject[] { new TestObject(s), new TestObject(s + s), new TestObject(s + s + s) };
        }
    });
    final LinkedList<Object[]> expected = new LinkedList<Object[]>();
    expected.add(new Object[] { new TestObject("1") });
    expected.add(new Object[] { new TestObject("11") });
    expected.add(new Object[] { new TestObject("111") });
    expected.add(new Object[] { new TestObject("2") });
    expected.add(new Object[] { new TestObject("22") });
    expected.add(new Object[] { new TestObject("222") });
    expected.add(new Object[] { new TestObject("3") });
    expected.add(new Object[] { new TestObject("33") });
    expected.add(new Object[] { new TestObject("333") });
    ValuesComparison.compare(result, expected);
}
Also used : TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) Test(org.junit.Test)

Example 42 with TestObject

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

the class MyTest method notValuesReturned_2.

@Test
public void notValuesReturned_2() {
    final Values result = createColumn("1", "2", "3").filter(new Object() {

        @Transform
        public TestObject build(String s) {
            return new TestObject(s);
        }
    });
    final LinkedList<Object[]> expected = new LinkedList<Object[]>();
    expected.add(new Object[] { new TestObject("1") });
    expected.add(new Object[] { new TestObject("2") });
    expected.add(new Object[] { new TestObject("3") });
    ValuesComparison.compare(result, expected);
}
Also used : TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) Test(org.junit.Test)

Example 43 with TestObject

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

the class MyTest method wrappingList_2.

@Test
public void wrappingList_2() {
    final Values result = createColumn("1", "2", "3").filter(new Object() {

        @Transform
        public List<TestObject> build(String s) {
            return Arrays.asList(new TestObject(s), new TestObject(s + s), new TestObject(s + s + s));
        }
    });
    final LinkedList<Object[]> expected = new LinkedList<Object[]>();
    expected.add(new Object[] { new TestObject("1") });
    expected.add(new Object[] { new TestObject("11") });
    expected.add(new Object[] { new TestObject("111") });
    expected.add(new Object[] { new TestObject("2") });
    expected.add(new Object[] { new TestObject("22") });
    expected.add(new Object[] { new TestObject("222") });
    expected.add(new Object[] { new TestObject("3") });
    expected.add(new Object[] { new TestObject("33") });
    expected.add(new Object[] { new TestObject("333") });
    ValuesComparison.compare(result, expected);
}
Also used : TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) List(java.util.List) Test(org.junit.Test)

Example 44 with TestObject

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

the class Mixed method testDiag_Combine_2_2.

@Test
public void testDiag_Combine_2_2() {
    Values vs1 = createColumn("a", "b", "c", "d", "e");
    Values vs2 = createColumn("x", "y", "z");
    Values vs3 = createColumn(1).pseudoMultiply(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), 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 45 with TestObject

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

the class TestPureAssert method testAssertEquals_Negative_Message_custom.

@Test
public void testAssertEquals_Negative_Message_custom() {
    TestObject testObject_1 = new TestObject("1" + RANDOM_STRING);
    TestObject testObject_2 = new TestObject("2" + RANDOM_STRING);
    try {
        com.sun.tck.lib.Assert.assertEquals(testObject_1, testObject_2, "MyMessage" + RANDOM_STRING);
        fail("Exception not thrown");
    } catch (AssertionFailedException e) {
        assertEquals("MyMessage" + RANDOM_STRING + "\n" + "Expected equal to : \"" + testObject_1 + "\", was given: \"" + testObject_2 + "\"", e.getMessage());
    }
}
Also used : TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) AssertionFailedException(com.sun.tck.lib.AssertionFailedException) 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