Search in sources :

Example 11 with SQLNonTransientConnectionException

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

the class SQLNonTransientConnectionExceptionTests method test7.

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

Example 12 with SQLNonTransientConnectionException

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

the class SQLNonTransientConnectionExceptionTests method test4.

/**
     * Create SQLNonTransientConnectionException with message, SQLState, and error code
     */
@Test
public void test4() {
    SQLNonTransientConnectionException ex = new SQLNonTransientConnectionException(reason, state, errorCode);
    assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && ex.getCause() == null && ex.getErrorCode() == errorCode);
}
Also used : SQLNonTransientConnectionException(java.sql.SQLNonTransientConnectionException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 13 with SQLNonTransientConnectionException

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

the class SQLNonTransientConnectionExceptionTests method test.

/**
     * Create SQLNonTransientConnectionException and setting all objects to null
     */
@Test
public void test() {
    SQLNonTransientConnectionException e = new SQLNonTransientConnectionException(null, null, errorCode, null);
    assertTrue(e.getMessage() == null && e.getSQLState() == null && e.getCause() == null && e.getErrorCode() == errorCode);
}
Also used : SQLNonTransientConnectionException(java.sql.SQLNonTransientConnectionException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 14 with SQLNonTransientConnectionException

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

the class SQLNonTransientConnectionExceptionTests method test9.

/**
     * Create SQLNonTransientConnectionException with Throwable
     */
@Test
public void test9() {
    SQLNonTransientConnectionException ex = new SQLNonTransientConnectionException(t);
    assertTrue(ex.getMessage().equals(cause) && ex.getSQLState() == null && cause.equals(ex.getCause().toString()) && ex.getErrorCode() == 0);
}
Also used : SQLNonTransientConnectionException(java.sql.SQLNonTransientConnectionException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 15 with SQLNonTransientConnectionException

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

the class SQLNonTransientConnectionExceptionTests method test2.

/**
     * Create SQLNonTransientConnectionException with message
     */
@Test
public void test2() {
    SQLNonTransientConnectionException ex = new SQLNonTransientConnectionException(reason);
    assertTrue(ex.getMessage().equals(reason) && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
Also used : SQLNonTransientConnectionException(java.sql.SQLNonTransientConnectionException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Aggregations

SQLNonTransientConnectionException (java.sql.SQLNonTransientConnectionException)15 Test (org.testng.annotations.Test)14 BaseTest (util.BaseTest)14 SQLException (java.sql.SQLException)3 SQLFeatureNotSupportedException (java.sql.SQLFeatureNotSupportedException)1 SQLNonTransientException (java.sql.SQLNonTransientException)1 Properties (java.util.Properties)1