use of java.sql.SQLIntegrityConstraintViolationException in project jdk8u_jdk by JetBrains.
the class SQLIntegrityConstraintViolationExceptionTests method test.
/**
* Create SQLIntegrityConstraintViolationException and setting all objects to null
*/
@Test
public void test() {
SQLIntegrityConstraintViolationException e = new SQLIntegrityConstraintViolationException(null, null, errorCode, null);
assertTrue(e.getMessage() == null && e.getSQLState() == null && e.getCause() == null && e.getErrorCode() == errorCode);
}
use of java.sql.SQLIntegrityConstraintViolationException in project jdk8u_jdk by JetBrains.
the class SQLIntegrityConstraintViolationExceptionTests method test6.
/**
* Create SQLIntegrityConstraintViolationException with message, SQLState, and Throwable
*/
@Test
public void test6() {
SQLIntegrityConstraintViolationException ex = new SQLIntegrityConstraintViolationException(reason, state, t);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && cause.equals(ex.getCause().toString()) && ex.getErrorCode() == 0);
}
use of java.sql.SQLIntegrityConstraintViolationException in project jdk8u_jdk by JetBrains.
the class SQLIntegrityConstraintViolationExceptionTests method test4.
/**
* Create SQLIntegrityConstraintViolationException with message, SQLState, and error code
*/
@Test
public void test4() {
SQLIntegrityConstraintViolationException ex = new SQLIntegrityConstraintViolationException(reason, state, errorCode);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && ex.getCause() == null && ex.getErrorCode() == errorCode);
}
use of java.sql.SQLIntegrityConstraintViolationException in project jdk8u_jdk by JetBrains.
the class SQLIntegrityConstraintViolationExceptionTests method test1.
/**
* Create SQLIntegrityConstraintViolationException with no-arg constructor
*/
@Test
public void test1() {
SQLIntegrityConstraintViolationException ex = new SQLIntegrityConstraintViolationException();
assertTrue(ex.getMessage() == null && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0);
}
Aggregations