use of java.sql.SQLTransientException in project jdk8u_jdk by JetBrains.
the class SQLTransientExceptionTests method test1.
/**
* Create SQLTransientException with no-arg constructor
*/
@Test
public void test1() {
SQLTransientException ex = new SQLTransientException();
assertTrue(ex.getMessage() == null && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
use of java.sql.SQLTransientException in project jdk8u_jdk by JetBrains.
the class SQLTransientExceptionTests method test8.
/**
* Create SQLTransientException with null Throwable
*/
@Test
public void test8() {
SQLTransientException ex = new SQLTransientException((Throwable) null);
assertTrue(ex.getMessage() == null && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
use of java.sql.SQLTransientException in project jdk8u_jdk by JetBrains.
the class SQLTimeoutExceptionTests method test13.
/**
* Create SQLTimeoutException and validate it is an instance of
* SQLNonTransientException
*/
@Test
public void test13() {
Exception ex = new SQLTimeoutException();
assertTrue(ex instanceof SQLTransientException);
}
use of java.sql.SQLTransientException in project jdk8u_jdk by JetBrains.
the class SQLTransientExceptionTests method test2.
/**
* Create SQLTransientException with message
*/
@Test
public void test2() {
SQLTransientException ex = new SQLTransientException(reason);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
use of java.sql.SQLTransientException in project jdk8u_jdk by JetBrains.
the class SQLTransientExceptionTests method test11.
/**
* Validate that the ordering of the returned Exceptions is correct
* using for-each loop
*/
@Test
public void test11() {
SQLTransientException ex = new SQLTransientException("Exception 1", t1);
SQLTransientException ex1 = new SQLTransientException("Exception 2");
SQLTransientException ex2 = new SQLTransientException("Exception 3", t2);
ex.setNextException(ex1);
ex.setNextException(ex2);
int num = 0;
for (Throwable e : ex) {
assertTrue(msgs[num++].equals(e.getMessage()));
}
}
Aggregations