Search in sources :

Example 11 with SQLInvalidAuthorizationSpecException

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

the class SQLInvalidAuthorizationSpecExceptionTests method test11.

/**
     * Validate that the ordering of the returned Exceptions is correct using
     * for-each loop
     */
@Test
public void test11() {
    SQLInvalidAuthorizationSpecException ex = new SQLInvalidAuthorizationSpecException("Exception 1", t1);
    SQLInvalidAuthorizationSpecException ex1 = new SQLInvalidAuthorizationSpecException("Exception 2");
    SQLInvalidAuthorizationSpecException ex2 = new SQLInvalidAuthorizationSpecException("Exception 3", t2);
    ex.setNextException(ex1);
    ex.setNextException(ex2);
    int num = 0;
    for (Throwable e : ex) {
        assertTrue(msgs[num++].equals(e.getMessage()));
    }
}
Also used : SQLInvalidAuthorizationSpecException(java.sql.SQLInvalidAuthorizationSpecException) Test(org.testng.annotations.Test) BaseTest(util.BaseTest)

Example 12 with SQLInvalidAuthorizationSpecException

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

the class SQLInvalidAuthorizationSpecExceptionTests method test8.

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

Example 13 with SQLInvalidAuthorizationSpecException

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

the class SQLInvalidAuthorizationSpecExceptionTests method test3.

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

Example 14 with SQLInvalidAuthorizationSpecException

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

the class SQLInvalidAuthorizationSpecExceptionTests method test.

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

Aggregations

SQLInvalidAuthorizationSpecException (java.sql.SQLInvalidAuthorizationSpecException)14 Test (org.testng.annotations.Test)14 BaseTest (util.BaseTest)14 SQLException (java.sql.SQLException)2 SQLNonTransientException (java.sql.SQLNonTransientException)1