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()));
}
}
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);
}
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);
}
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);
}
Aggregations