use of java.sql.SQLTimeoutException in project jdk8u_jdk by JetBrains.
the class SQLTimeoutExceptionTests method test3.
/**
* Create SQLTimeoutException with message, and SQLState
*/
@Test
public void test3() {
SQLTimeoutException ex = new SQLTimeoutException(reason, state);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && ex.getCause() == null && ex.getErrorCode() == 0);
}
use of java.sql.SQLTimeoutException in project jdk8u_jdk by JetBrains.
the class SQLTimeoutExceptionTests method test2.
/**
* Create SQLTimeoutException with message
*/
@Test
public void test2() {
SQLTimeoutException ex = new SQLTimeoutException(reason);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
use of java.sql.SQLTimeoutException in project jdk8u_jdk by JetBrains.
the class SQLTimeoutExceptionTests method test.
/**
* Create SQLTimeoutException and setting all objects to null
*/
@Test
public void test() {
SQLTimeoutException e = new SQLTimeoutException(null, null, errorCode, null);
assertTrue(e.getMessage() == null && e.getSQLState() == null && e.getCause() == null && e.getErrorCode() == errorCode);
}
use of java.sql.SQLTimeoutException in project jdk8u_jdk by JetBrains.
the class SQLTimeoutExceptionTests method test5.
/**
* Create SQLTimeoutException with message, SQLState, errorCode, and Throwable
*/
@Test
public void test5() {
SQLTimeoutException ex = new SQLTimeoutException(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.SQLTimeoutException in project jdk8u_jdk by JetBrains.
the class SQLTimeoutExceptionTests method test8.
/**
* Create SQLTimeoutException with null Throwable
*/
@Test
public void test8() {
SQLTimeoutException ex = new SQLTimeoutException((Throwable) null);
assertTrue(ex.getMessage() == null && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
Aggregations