use of java.sql.SQLSyntaxErrorException in project jdk8u_jdk by JetBrains.
the class SQLSyntaxErrorExceptionTests method test6.
/**
* Create SQLSyntaxErrorException with message, SQLState, and Throwable
*/
@Test
public void test6() {
SQLSyntaxErrorException ex = new SQLSyntaxErrorException(reason, state, t);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && cause.equals(ex.getCause().toString()) && ex.getErrorCode() == 0);
}
use of java.sql.SQLSyntaxErrorException in project jdk8u_jdk by JetBrains.
the class SQLSyntaxErrorExceptionTests method test8.
/**
* Create SQLSyntaxErrorException with null Throwable
*/
@Test
public void test8() {
SQLSyntaxErrorException ex = new SQLSyntaxErrorException((Throwable) null);
assertTrue(ex.getMessage() == null && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
use of java.sql.SQLSyntaxErrorException in project jdk8u_jdk by JetBrains.
the class SQLSyntaxErrorExceptionTests method test12.
/**
* Validate that the ordering of the returned Exceptions is correct
* using traditional while loop
*/
@Test
public void test12() {
SQLSyntaxErrorException ex = new SQLSyntaxErrorException("Exception 1", t1);
SQLSyntaxErrorException ex1 = new SQLSyntaxErrorException("Exception 2");
SQLSyntaxErrorException ex2 = new SQLSyntaxErrorException("Exception 3", t2);
ex.setNextException(ex1);
ex.setNextException(ex2);
int num = 0;
SQLException sqe = ex;
while (sqe != null) {
assertTrue(msgs[num++].equals(sqe.getMessage()));
Throwable c = sqe.getCause();
while (c != null) {
assertTrue(msgs[num++].equals(c.getMessage()));
c = c.getCause();
}
sqe = sqe.getNextException();
}
}
use of java.sql.SQLSyntaxErrorException in project jdk8u_jdk by JetBrains.
the class SQLSyntaxErrorExceptionTests method test7.
/**
* Create SQLSyntaxErrorException with message, and Throwable
*/
@Test
public void test7() {
SQLSyntaxErrorException ex = new SQLSyntaxErrorException(reason, t);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState() == null && cause.equals(ex.getCause().toString()) && ex.getErrorCode() == 0);
}
use of java.sql.SQLSyntaxErrorException in project jdk8u_jdk by JetBrains.
the class SQLSyntaxErrorExceptionTests method test2.
/**
* Create SQLSyntaxErrorException with message
*/
@Test
public void test2() {
SQLSyntaxErrorException ex = new SQLSyntaxErrorException(reason);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
Aggregations