use of java.sql.SQLSyntaxErrorException in project jdk8u_jdk by JetBrains.
the class SQLSyntaxErrorExceptionTests method test13.
/**
* Create SQLSyntaxErrorException and validate it is an instance of
* SQLNonTransientException
*/
@Test
public void test13() {
Exception ex = new SQLSyntaxErrorException();
assertTrue(ex instanceof SQLNonTransientException);
}
use of java.sql.SQLSyntaxErrorException in project jdk8u_jdk by JetBrains.
the class SQLSyntaxErrorExceptionTests method test5.
/**
* Create SQLSyntaxErrorException with message, SQLState, errorCode, and Throwable
*/
@Test
public void test5() {
SQLSyntaxErrorException ex = new SQLSyntaxErrorException(reason, state, errorCode, t);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && cause.equals(ex.getCause().toString()) && ex.getErrorCode() == errorCode);
}
use of java.sql.SQLSyntaxErrorException in project jdk8u_jdk by JetBrains.
the class SQLSyntaxErrorExceptionTests method test4.
/**
* Create SQLSyntaxErrorException with message, SQLState, and error code
*/
@Test
public void test4() {
SQLSyntaxErrorException ex = new SQLSyntaxErrorException(reason, state, errorCode);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && ex.getCause() == null && ex.getErrorCode() == errorCode);
}
use of java.sql.SQLSyntaxErrorException in project jdk8u_jdk by JetBrains.
the class SQLSyntaxErrorExceptionTests method test9.
/**
* Create SQLSyntaxErrorException with Throwable
*/
@Test
public void test9() {
SQLSyntaxErrorException ex = new SQLSyntaxErrorException(t);
assertTrue(ex.getMessage().equals(cause) && 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 test10.
/**
* Serialize a SQLSyntaxErrorException and make sure you can read it back properly
*/
@Test
public void test10() throws Exception {
SQLSyntaxErrorException e = new SQLSyntaxErrorException(reason, state, errorCode, t);
SQLSyntaxErrorException ex1 = createSerializedException(e);
assertTrue(reason.equals(ex1.getMessage()) && ex1.getSQLState().equals(state) && cause.equals(ex1.getCause().toString()) && ex1.getErrorCode() == errorCode);
}
Aggregations