@Test public void testDeserializationUnknownException() throws Exception { ClassLoader cl = new URLClassLoader(new URL[] {UnitTestUtil.getTestDataFile("test.jar").toURI().toURL()}); Object obj = ReflectionHelper.create("test.Test", null, cl); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(new ExceptionHolder(new BadException(obj))); oos.flush(); ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray())); ExceptionHolder holder = (ExceptionHolder)ois.readObject(); assertTrue(holder.getException() instanceof BadException); assertEquals("Remote org.teiid.client.util.TestExceptionHolder$BadException: null", holder.getException().getMessage()); }
public Throwable getException() { return exception; }
ExceptionHolder implements Externalizable { public Throwable getException() { return exception; } }
ExceptionHolder implements Externalizable { public Throwable getException() { return exception; } ExceptionHolder();  ExceptionHolder(Throwable exception);  ExceptionHolder(Throwable exception, boolean nested); }
ExceptionHolder implements Externalizable { public Throwable getException() { return exception; } ExceptionHolder();  ExceptionHolder(Throwable exception);  ExceptionHolder(Throwable exception, boolean nested); @Override void readExternal(ObjectInput in); @Override void writeExternal(ObjectOutput out); Throwable getException(); static List<ExceptionHolder> toExceptionHolders(List<? extends Throwable> throwables); static List<Throwable> toThrowables(List<ExceptionHolder> exceptionHolders); }
ExceptionHolder implements Externalizable { public Throwable getException() { return exception; } ExceptionHolder();  ExceptionHolder(Throwable exception);  ExceptionHolder(Throwable exception, boolean nested); @Override void readExternal(ObjectInput in); @Override void writeExternal(ObjectOutput out); Throwable getException(); static List<ExceptionHolder> toExceptionHolders(List<? extends Throwable> throwables); static List<Throwable> toThrowables(List<ExceptionHolder> exceptionHolders);  }