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