List of usage examples for java.lang AssertionError getCause
public synchronized Throwable getCause()
From source file:org.marketcetera.util.test.SerializableAssertTest.java
@Test public void transientData() { try {/*w w w . j a v a 2 s . c o m*/ assertSerializable(new TransientData(1)); } catch (AssertionError ex) { assertEquals("expected object is 'I am 1' actual is 'I am 0'", ex.getMessage()); assertNull(ex.getCause()); return; } fail(); }
From source file:org.marketcetera.util.test.SerializableAssertTest.java
@Test public void nonSerializable() { try {// www . jav a 2s . co m assertSerializable(new NonSerializableClass(new NonSerializableMember(1))); } catch (AssertionError ex) { assertEquals("de/serialization failed", ex.getMessage()); assertEquals(SerializationException.class, ex.getCause().getClass()); return; } fail(); }
From source file:org.marketcetera.util.test.SerializableAssertTest.java
@Test public void message() { try {// w w w. j a v a 2 s . com assertSerializable("Right now,", new TransientData(1)); } catch (AssertionError ex) { assertEquals("Right now, expected object is 'I am 1' actual is 'I am 0'", ex.getMessage()); assertNull(ex.getCause()); return; } fail(); }