List of usage examples for org.apache.commons.lang3 SerializationException getCause
public synchronized Throwable getCause()
From source file:org.grouplens.grapht.reflect.QualifiersTest.java
@Test public void testClassMatcherBadClassError() { Qualifiers.AnnotationClassMatcher.SerialProxy proxy = new Qualifiers.AnnotationClassMatcher.SerialProxy( String.class); byte[] data = SerializationUtils.serialize(proxy); try {/*from ww w. j ava2s . c om*/ SerializationUtils.deserialize(data); fail("deserialization should fail with error"); } catch (SerializationException e) { assertThat(e.getCause(), instanceOf(InvalidObjectException.class)); assertThat(e.getCause().getCause(), instanceOf(ClassCastException.class)); } }