use of java.sql.SQLTransientConnectionException in project jdk8u_jdk by JetBrains.
the class SQLTransientConnectionExceptionTests method test.
/**
* Create SQLTransientConnectionException and setting all objects to null
*/
@Test
public void test() {
SQLTransientConnectionException e = new SQLTransientConnectionException(null, null, errorCode, null);
assertTrue(e.getMessage() == null && e.getSQLState() == null && e.getCause() == null && e.getErrorCode() == errorCode);
}
use of java.sql.SQLTransientConnectionException in project jdk8u_jdk by JetBrains.
the class SQLTransientConnectionExceptionTests method test2.
/**
* Create SQLTransientConnectionException with message
*/
@Test
public void test2() {
SQLTransientConnectionException ex = new SQLTransientConnectionException(reason);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
use of java.sql.SQLTransientConnectionException in project jdk8u_jdk by JetBrains.
the class SQLTransientConnectionExceptionTests method test4.
/**
* Create SQLTransientConnectionException with message, SQLState, and error code
*/
@Test
public void test4() {
;
SQLTransientConnectionException ex = new SQLTransientConnectionException(reason, state, errorCode);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && ex.getCause() == null && ex.getErrorCode() == errorCode);
}
use of java.sql.SQLTransientConnectionException in project jdk8u_jdk by JetBrains.
the class SQLTransientConnectionExceptionTests method test7.
/**
* Create SQLTransientConnectionException with message, and Throwable
*/
@Test
public void test7() {
SQLTransientConnectionException ex = new SQLTransientConnectionException(reason, t);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState() == null && cause.equals(ex.getCause().toString()) && ex.getErrorCode() == 0);
}
use of java.sql.SQLTransientConnectionException in project jdk8u_jdk by JetBrains.
the class SQLTransientConnectionExceptionTests method test11.
/**
* Validate that the ordering of the returned Exceptions is correct
* using for-each loop
*/
@Test
public void test11() {
SQLTransientConnectionException ex = new SQLTransientConnectionException("Exception 1", t1);
SQLTransientConnectionException ex1 = new SQLTransientConnectionException("Exception 2");
SQLTransientConnectionException ex2 = new SQLTransientConnectionException("Exception 3", t2);
ex.setNextException(ex1);
ex.setNextException(ex2);
int num = 0;
for (Throwable e : ex) {
assertTrue(msgs[num++].equals(e.getMessage()));
}
}
Aggregations