@Test public void testDeserializationNotSerializable() throws Exception { Exception ex = new TeiidException() { NotSerializable ns = new NotSerializable(); }; ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(new ExceptionHolder(ex)); oos.flush(); ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray())); ExceptionHolder holder = (ExceptionHolder)ois.readObject(); Throwable e = holder.getException(); assertTrue(e instanceof TeiidException); }
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);  }