use of java.sql.BatchUpdateException in project jdk8u_jdk by JetBrains.
the class BatchUpdateExceptionTests method test3.
/**
* Create BatchUpdateException with message and update counts
*/
@Test
public void test3() {
BatchUpdateException ex = new BatchUpdateException(reason, uc);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0 && Arrays.equals(ex.getUpdateCounts(), uc) && Arrays.equals(ex.getLargeUpdateCounts(), luc));
}
use of java.sql.BatchUpdateException in project jdk8u_jdk by JetBrains.
the class BatchUpdateExceptionTests method test1.
/**
* Create BatchUpdateException with no-arg constructor
*/
@Test
public void test1() {
BatchUpdateException ex = new BatchUpdateException();
assertTrue(ex.getMessage() == null && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0 && ex.getUpdateCounts() == null && ex.getLargeUpdateCounts() == null);
}
use of java.sql.BatchUpdateException in project jdk8u_jdk by JetBrains.
the class BatchUpdateExceptionTests method test7.
/**
* Create BatchUpdateException with message, SQLState, Throwable, and update
* counts
*/
@Test
public void test7() {
BatchUpdateException ex = new BatchUpdateException(reason, state, uc, t);
assertTrue(ex.getMessage().equals(reason) && ex.getSQLState().equals(state) && cause.equals(ex.getCause().toString()) && ex.getErrorCode() == 0 && Arrays.equals(ex.getUpdateCounts(), uc) && Arrays.equals(ex.getLargeUpdateCounts(), luc));
}
use of java.sql.BatchUpdateException in project jdk8u_jdk by JetBrains.
the class BatchUpdateExceptionTests method test10.
/**
* Validate that a copy of the update counts array is made
*/
@Test
public void test10() {
int[] uc1 = { 1, 2 };
BatchUpdateException ex = new BatchUpdateException(uc1);
assertTrue(Arrays.equals(ex.getUpdateCounts(), uc1));
uc1[0] = 6689;
assertFalse(Arrays.equals(ex.getUpdateCounts(), uc1));
}
use of java.sql.BatchUpdateException in project jdk8u_jdk by JetBrains.
the class BatchUpdateExceptionTests method test2.
/**
* Create BatchUpdateException with null Throwable
*/
@Test
public void test2() {
BatchUpdateException ex = new BatchUpdateException((Throwable) null);
assertTrue(ex.getMessage() == null && ex.getSQLState() == null && ex.getCause() == null && ex.getErrorCode() == 0 && ex.getUpdateCounts() == null && ex.getLargeUpdateCounts() == null);
}
Aggregations