Search in sources :

Example 16 with SQLTransientException

use of java.sql.SQLTransientException in project jdk8u_jdk by JetBrains.

the class SQLTransientExceptionTests method test5.

/**
     * Create SQLTransientException with message, SQLState, errorCode, and Throwable
     */
@Test
public void test5() {
    SQLTransientException ex = new SQLTransientException(reason, state, errorCode, t);
    assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && cause.equals(ex.getCause().toString()) && ex.getErrorCode() == errorCode);
}
Also used : SQLTransientException(java.sql.SQLTransientException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 17 with SQLTransientException

use of java.sql.SQLTransientException in project jdk8u_jdk by JetBrains.

the class SQLTransactionRollbackExceptionTests method test13.

/**
     * Create SQLTransactionRollbackException and validate it is an instance of
     * SQLNonTransientException
     */
@Test
public void test13() {
    Exception ex = new SQLTransactionRollbackException();
    assertTrue(ex instanceof SQLTransientException);
}
Also used : SQLTransactionRollbackException(java.sql.SQLTransactionRollbackException) SQLTransientException(java.sql.SQLTransientException) SQLException(java.sql.SQLException) SQLTransactionRollbackException(java.sql.SQLTransactionRollbackException) SQLTransientException(java.sql.SQLTransientException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Aggregations

SQLTransientException (java.sql.SQLTransientException)17 Test (org.testng.annotations.Test)16 BaseTest (util.BaseTest)16 SQLException (java.sql.SQLException)5 SQLTimeoutException (java.sql.SQLTimeoutException)1 SQLTransactionRollbackException (java.sql.SQLTransactionRollbackException)1 SQLTransientConnectionException (java.sql.SQLTransientConnectionException)1 Random (java.util.Random)1