IOExceptionFactory extends AbstractExceptionFactory<IOException> { @Override public IOException createException(String message) { return new IOException(message); } IOExceptionFactory(); @Override IOException createException(String message); @Override boolean indicatesFailure(IOException exception, Dialect dialect); @Override ExceptionType getType(); @Override boolean correctHeuristic(IOException exception, Phase phase);  }
@Test public void createExceptionFromMessage() { String message = "message"; IOException result = this.factory.createException(message); assertSame(message, result.getMessage()); assertNull(result.getCause()); }
@Test public void createExceptionFromException() { String message = "message"; Exception exception = new Exception(message); IOException result = this.factory.createException(exception); assertNotNull(result.getMessage()); assertSame(exception.getMessage(), result.getMessage()); assertSame(exception, result.getCause()); }
@Test public void createExceptionFromSQLException() { IOException exception = new IOException(); IOException result = this.factory.createException(exception); assertSame(exception, result); }