use of java.sql.SQLTransactionRollbackException in project jdk8u_jdk by JetBrains.
the class SQLTransactionRollbackExceptionTests method test10.
/**
* Serialize a SQLTransactionRollbackException and make sure you can read it back properly
*/
@Test
public void test10() throws Exception {
SQLTransactionRollbackException e = new SQLTransactionRollbackException(reason, state, errorCode, t);
SQLTransactionRollbackException ex1 = createSerializedException(e);
assertTrue(reason.equals(ex1.getMessage()) && ex1.getSQLState().equals(state) && cause.equals(ex1.getCause().toString()) && ex1.getErrorCode() == errorCode);
}
use of java.sql.SQLTransactionRollbackException in project jdk8u_jdk by JetBrains.
the class SQLTransactionRollbackExceptionTests method test5.
/**
* Create SQLTransactionRollbackException with message, SQLState, errorCode, and Throwable
*/
@Test
public void test5() {
SQLTransactionRollbackException ex = new SQLTransactionRollbackException(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.SQLTransactionRollbackException in project jdk8u_jdk by JetBrains.
the class SQLTransactionRollbackExceptionTests method test2.
/**
* Create SQLTransactionRollbackException with message
*/
@Test
public void test2() {
SQLTransactionRollbackException ex = new SQLTransactionRollbackException(reason);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
use of java.sql.SQLTransactionRollbackException in project jdk8u_jdk by JetBrains.
the class SQLTransactionRollbackExceptionTests method test.
/**
* Create SQLTransactionRollbackException and setting all objects to null
*/
@Test
public void test() {
SQLTransactionRollbackException e = new SQLTransactionRollbackException(null, null, errorCode, null);
assertTrue(e.getMessage() == null && e.getSQLState() == null && e.getCause() == null && e.getErrorCode() == errorCode);
}
use of java.sql.SQLTransactionRollbackException in project jdk8u_jdk by JetBrains.
the class SQLTransactionRollbackExceptionTests method test6.
/**
* Create SQLTransactionRollbackException with message, SQLState, and Throwable
*/
@Test
public void test6() {
SQLTransactionRollbackException ex = new SQLTransactionRollbackException(reason, state, t);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && cause.equals(ex.getCause().toString()) && ex.getErrorCode() == 0);
}
Aggregations