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