Search in sources :

Example 61 with TestObject

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

the class TestPureAssert method testAssertNotSame_Negative_CustomMessage.

@Test
public void testAssertNotSame_Negative_CustomMessage() {
    TestObject testObject = new TestObject(RANDOM_STRING);
    try {
        com.sun.tck.lib.Assert.assertNotSame(testObject, testObject, RANDOM_STRING + "32423434");
        fail("Exception not thrown");
    } catch (AssertionFailedException e) {
        assertEquals(RANDOM_STRING + "32423434\nExpected not same : \"" + testObject + "\"", 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