@Test public void testSourceWarning() throws Exception { ClassLoader cl = new URLClassLoader(new URL[] {UnitTestUtil.getTestDataFile("test.jar").toURI().toURL()}); ArrayList<String> args = new ArrayList<String>(); args.add("Unknown Exception"); Exception obj = (Exception)ReflectionHelper.create("test.UnknownException", args, cl); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(new ExceptionHolder(new SourceWarning("x", "y", obj, true))); oos.flush(); ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray())); ExceptionHolder holder = (ExceptionHolder)ois.readObject(); SourceWarning sw = (SourceWarning)holder.getException(); assertEquals(sw.getConnectorBindingName(), "y"); assertEquals(sw.getModelName(), "x"); assertTrue(sw.isPartialResultsError()); try { ois = new ObjectInputStream(new FileInputStream(UnitTestUtil.getTestDataFile("old-exceptionholder.ser"))); holder = (ExceptionHolder)ois.readObject(); assertTrue(holder.getException() instanceof TeiidException); } finally { ois.close(); } }
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);  }