Search in sources :

Example 16 with TestObject

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

the class TestPureAssert method testAssertSame_Positive_message_exception.

@Test
public void testAssertSame_Positive_message_exception() {
    TestObject testObject = new TestObject(RANDOM_STRING);
    com.sun.tck.lib.Assert.assertSame(testObject, testObject, "3490275092375", new IllegalAccessException());
}
Also used : TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) Test(org.junit.Test)

Example 17 with TestObject

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

the class TestPureAssert method testAssertEquals_Positive_sameObject_message.

@Test
public void testAssertEquals_Positive_sameObject_message() {
    TestObject testObject = new TestObject("object" + RANDOM_STRING);
    com.sun.tck.lib.Assert.assertEquals(testObject, testObject, "12312123123");
}
Also used : TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) Test(org.junit.Test)

Example 18 with TestObject

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

the class MyTest method wrappingIterator_2.

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

        @Transform
        public Iterator<TestObject> build(String s) {
            return Arrays.asList(new TestObject(s), new TestObject(s + s), new TestObject(s + s + s)).iterator();
        }
    });
    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 19 with TestObject

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

the class Cache method test_3.

@Test
public void test_3() {
    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");
        }
    }, new AbstractValue<Object>() {

        public Object create() {
            return new TestObject("x");
        }
    }).multiply(1, 2, 3, 4, 5, 6, 7, 8, 9).multiply(89, 45, 23, 78);
    ValuesComparison.checkCachedReturnsTheSame(values);
}
Also used : TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) TestObject(com.oracle.tck.lib.autd2.unittests.TestObject) Test(org.junit.Test)

Example 20 with TestObject

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

the class Cache method test_2.

@Test
public void test_2() {
    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");
        }
    });
    final Values cache = values.createCache();
    final Object[] result = ValuesComparison.createArray(cache);
    List<Object[]> expectedList = new ArrayList<Object[]>();
    expectedList.add(new Object[] { new TestObject("a") });
    expectedList.add(new Object[] { new TestObject("b") });
    expectedList.add(new Object[] { new TestObject("c") });
    final Object[] expected = expectedList.toArray();
    Assert.assertArrayEquals(expected, result);
}
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)

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