use of java.sql.SQLTransientConnectionException in project jdk8u_jdk by JetBrains.
the class SQLTransientConnectionExceptionTests method test3.
/**
* Create SQLTransientConnectionException with message, and SQLState
*/
@Test
public void test3() {
SQLTransientConnectionException ex = new SQLTransientConnectionException(reason, state);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && ex.getCause() == null && ex.getErrorCode() == 0);
}
use of java.sql.SQLTransientConnectionException in project jdk8u_jdk by JetBrains.
the class SQLTransientConnectionExceptionTests method test6.
/**
* Create SQLTransientConnectionException with message, SQLState, and Throwable
*/
@Test
public void test6() {
SQLTransientConnectionException ex = new SQLTransientConnectionException(reason, state, t);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && cause.equals(ex.getCause().toString()) && ex.getErrorCode() == 0);
}
use of java.sql.SQLTransientConnectionException in project jdk8u_jdk by JetBrains.
the class SQLTransientConnectionExceptionTests method test5.
/**
* Create SQLTransientConnectionException with message, SQLState, errorCode, and Throwable
*/
@Test
public void test5() {
SQLTransientConnectionException ex = new SQLTransientConnectionException(reason, state, errorCode, t);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && cause.equals(ex.getCause().toString()) && ex.getErrorCode() == errorCode);
}
use of java.sql.SQLTransientConnectionException in project jdk8u_jdk by JetBrains.
the class SQLTransientConnectionExceptionTests method test10.
/**
* Serialize a SQLTransientConnectionException and make sure you can read it back properly
*/
@Test
public void test10() throws Exception {
SQLTransientConnectionException e = new SQLTransientConnectionException(reason, state, errorCode, t);
SQLTransientConnectionException ex1 = createSerializedException(e);
assertTrue(reason.equals(ex1.getMessage()) && ex1.getSQLState().equals(state) && cause.equals(ex1.getCause().toString()) && ex1.getErrorCode() == errorCode);
}
use of java.sql.SQLTransientConnectionException in project jdk8u_jdk by JetBrains.
the class SQLTransientConnectionExceptionTests method test9.
/**
* Create SQLTransientConnectionException with Throwable
*/
@Test
public void test9() {
SQLTransientConnectionException ex = new SQLTransientConnectionException(t);
assertTrue(ex.getMessage().equals(cause) && ex.getSQLState() == null && cause.equals(ex.getCause().toString()) && ex.getErrorCode() == 0);
}
Aggregations