use of com.oracle.tck.lib.autd2.unittests.TestObject in project jtharness by openjdk.
the class TestPureAssert method testAssertEquals_Negative_Message.
@Test
public void testAssertEquals_Negative_Message() {
TestObject testObject_1 = new TestObject("first" + RANDOM_STRING);
TestObject testObject_2 = new TestObject("second" + RANDOM_STRING);
try {
com.sun.tck.lib.Assert.assertEquals(testObject_1, testObject_2);
fail("Exception not thrown");
} catch (AssertionFailedException e) {
assertEquals("Expected equal to : \"" + testObject_1 + "\", was given: \"" + testObject_2 + "\"", e.getMessage());
}
}
use of com.oracle.tck.lib.autd2.unittests.TestObject in project jtharness by openjdk.
the class TestPureAssert method testAssertSame_Negative_standardMessage_exception.
@Test
public void testAssertSame_Negative_standardMessage_exception() {
RuntimeException runtimeException = new RuntimeException();
try {
com.sun.tck.lib.Assert.assertSame(new TestObject(RANDOM_STRING), new TestObject(RANDOM_STRING), runtimeException);
fail("Exception not thrown");
} catch (AssertionFailedException e) {
assertSame(runtimeException, e.getCause());
assertEquals("Expected same as : \"" + new TestObject(RANDOM_STRING) + "\", was given: \"" + new TestObject(RANDOM_STRING) + "\"", e.getMessage());
}
}
use of com.oracle.tck.lib.autd2.unittests.TestObject in project jtharness by openjdk.
the class TestPureAssert method testAssertSame_Negative_Message_customMessage.
@Test
public void testAssertSame_Negative_Message_customMessage() {
final TestObject to = new TestObject(RANDOM_STRING);
final TestObject to1 = new TestObject(RANDOM_STRING);
try {
com.sun.tck.lib.Assert.assertSame(to, to1, "werwer12534523535");
fail("Exception not thrown");
} catch (AssertionFailedException e) {
assertEquals("werwer12534523535\nExpected same as : \"" + to + "\", was given: \"" + to1 + "\"", e.getMessage());
}
}
use of com.oracle.tck.lib.autd2.unittests.TestObject in project jtharness by openjdk.
the class TestPureAssert method testAssertEquals_Positive_sameObject_message_exception.
@Test
public void testAssertEquals_Positive_sameObject_message_exception() {
TestObject testObject = new TestObject("object" + RANDOM_STRING);
com.sun.tck.lib.Assert.assertEquals(testObject, testObject, "12312123123", new RuntimeException());
}
use of com.oracle.tck.lib.autd2.unittests.TestObject in project jtharness by openjdk.
the class TestPureAssert method testAssertEquals_Positive_sameObject.
@Test
public void testAssertEquals_Positive_sameObject() {
TestObject testObject = new TestObject("object" + RANDOM_STRING);
com.sun.tck.lib.Assert.assertEquals(testObject, testObject);
}
Aggregations