use of com.sun.tck.lib.AssertionFailedException in project jtharness by openjdk.
the class TestPureAssert method testAssertSame_Negative_standardMessage.
@Test
public void testAssertSame_Negative_standardMessage() {
try {
com.sun.tck.lib.Assert.assertSame(new TestObject(RANDOM_STRING), new TestObject(RANDOM_STRING));
fail("Exception not thrown");
} catch (AssertionFailedException e) {
assertEquals("Expected same as : \"" + new TestObject(RANDOM_STRING) + "\", was given: \"" + new TestObject(RANDOM_STRING) + "\"", e.getMessage());
}
}
use of com.sun.tck.lib.AssertionFailedException 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());
}
}
Aggregations