@Test public void testWrapWithCauses() throws ClassNotFoundException { IllegalArgumentException wrappedCause = new IllegalArgumentException("testWrapWithCauses-cause"); String message = "testWrapWithCauses-Message"; IOException wrapped = new IOException(message); wrapped.initCause(wrappedCause); TransferableExceptionWrapper wrapper = TransferableExceptionWrapper.wrap(wrapped); checkWrapper(wrapped, wrapper); checkWrapperOrSame(wrapped.getCause(), wrapper.getCause()); }
public static TransferableExceptionWrapper wrap(Throwable exception) { if (exception == null) { return null; } if (exception instanceof TransferableExceptionWrapper) { return (TransferableExceptionWrapper)exception; } else { return new TransferableExceptionWrapper(exception); } }
TransferableExceptionWrapper extends RuntimeException { public static TransferableExceptionWrapper wrap(Throwable exception) { if (exception == null) { return null; } if (exception instanceof TransferableExceptionWrapper) { return (TransferableExceptionWrapper)exception; } else { return new TransferableExceptionWrapper(exception); } } }
TransferableExceptionWrapper extends RuntimeException { public static TransferableExceptionWrapper wrap(Throwable exception) { if (exception == null) { return null; } if (exception instanceof TransferableExceptionWrapper) { return (TransferableExceptionWrapper)exception; } else { return new TransferableExceptionWrapper(exception); } } TransferableExceptionWrapper(Throwable wrapped); }
TransferableExceptionWrapper extends RuntimeException { public static TransferableExceptionWrapper wrap(Throwable exception) { if (exception == null) { return null; } if (exception instanceof TransferableExceptionWrapper) { return (TransferableExceptionWrapper)exception; } else { return new TransferableExceptionWrapper(exception); } } TransferableExceptionWrapper(Throwable wrapped); static TransferableExceptionWrapper wrap(Throwable exception); String getOriginalClassName(); String getOriginalMessage(); @Override String getMessage(); }
TransferableExceptionWrapper extends RuntimeException { public static TransferableExceptionWrapper wrap(Throwable exception) { if (exception == null) { return null; } if (exception instanceof TransferableExceptionWrapper) { return (TransferableExceptionWrapper)exception; } else { return new TransferableExceptionWrapper(exception); } } TransferableExceptionWrapper(Throwable wrapped); static TransferableExceptionWrapper wrap(Throwable exception); String getOriginalClassName(); String getOriginalMessage(); @Override String getMessage();  }