use of java.sql.SQLNonTransientException in project jdk8u_jdk by JetBrains.
the class SQLNonTransientExceptionTests method test1.
/**
* Create SQLNonTransientException with no-arg constructor
*/
@Test
public void test1() {
SQLNonTransientException ex = new SQLNonTransientException();
assertTrue(ex.getMessage() == null && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
use of java.sql.SQLNonTransientException in project jdk8u_jdk by JetBrains.
the class SQLSyntaxErrorExceptionTests method test13.
/**
* Create SQLSyntaxErrorException and validate it is an instance of
* SQLNonTransientException
*/
@Test
public void test13() {
Exception ex = new SQLSyntaxErrorException();
assertTrue(ex instanceof SQLNonTransientException);
}
use of java.sql.SQLNonTransientException in project jdk8u_jdk by JetBrains.
the class SQLNonTransientExceptionTests method test10.
/**
* Serialize a SQLNonTransientException and make sure you can read it back properly
*/
@Test
public void test10() throws Exception {
SQLNonTransientException e = new SQLNonTransientException(reason, state, errorCode, t);
SQLNonTransientException ex1 = createSerializedException(e);
assertTrue(reason.equals(ex1.getMessage()) && ex1.getSQLState().equals(state) && cause.equals(ex1.getCause().toString()) && ex1.getErrorCode() == errorCode);
}
use of java.sql.SQLNonTransientException in project jdk8u_jdk by JetBrains.
the class SQLNonTransientExceptionTests method test4.
/**
* Create SQLNonTransientException with message, SQLState, and error code
*/
@Test
public void test4() {
;
SQLNonTransientException ex = new SQLNonTransientException(reason, state, errorCode);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && ex.getCause() == null && ex.getErrorCode() == errorCode);
}
use of java.sql.SQLNonTransientException in project jdk8u_jdk by JetBrains.
the class SQLNonTransientExceptionTests method test6.
/**
* Create SQLNonTransientException with message, SQLState, and Throwable
*/
@Test
public void test6() {
SQLNonTransientException ex = new SQLNonTransientException(reason, state, t);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && cause.equals(ex.getCause().toString()) && ex.getErrorCode() == 0);
}
Aggregations