use of com.oracle.tck.lib.autd2.unittests.TestObject in project jtharness by openjdk.
the class TestPureAssert method testAssertSame_Positive_exception.
@Test
public void testAssertSame_Positive_exception() {
TestObject testObject = new TestObject(RANDOM_STRING);
com.sun.tck.lib.Assert.assertSame(testObject, testObject, new RuntimeException());
}
use of com.oracle.tck.lib.autd2.unittests.TestObject in project jtharness by openjdk.
the class TestPureAssert method testAssertEquals_Positive_sameObject_exception.
@Test
public void testAssertEquals_Positive_sameObject_exception() {
TestObject testObject = new TestObject("object" + RANDOM_STRING);
com.sun.tck.lib.Assert.assertEquals(testObject, testObject, new RuntimeException());
}
use of com.oracle.tck.lib.autd2.unittests.TestObject in project jtharness by openjdk.
the class TestPureAssert method testAssertEquals_Negative_exception.
@Test
public void testAssertEquals_Negative_exception() {
TestObject testObject_1 = new TestObject("first" + RANDOM_STRING);
TestObject testObject_2 = new TestObject("second" + RANDOM_STRING);
RuntimeException cause = new RuntimeException();
try {
com.sun.tck.lib.Assert.assertEquals(testObject_1, testObject_2, cause);
fail("Exception not thrown");
} catch (AssertionFailedException e) {
assertEquals("Expected equal to : \"" + testObject_1 + "\", was given: \"" + testObject_2 + "\"", e.getMessage());
assertSame(cause, e.getCause());
}
}
use of com.oracle.tck.lib.autd2.unittests.TestObject in project jtharness by openjdk.
the class TestPureAssert method testAssertSame_Positive_message.
@Test
public void testAssertSame_Positive_message() {
TestObject testObject = new TestObject(RANDOM_STRING);
com.sun.tck.lib.Assert.assertSame(testObject, testObject, "3490275092375");
}
use of com.oracle.tck.lib.autd2.unittests.TestObject in project jtharness by openjdk.
the class TestPureAssert method testAssertNotEquals_Negative_message_exception.
@Test
public void testAssertNotEquals_Negative_message_exception() {
RuntimeException exception = new RuntimeException();
try {
com.sun.tck.lib.Assert.assertNotEquals(new TestObject(RANDOM_STRING), new TestObject(RANDOM_STRING), RANDOM_STRING, exception);
fail("AssertionFailedException was not thrown");
} catch (AssertionFailedException e) {
assertEquals(RANDOM_STRING, e.getMessage());
assertSame(exception, e.getCause());
}
}
Aggregations