String[] theFinalStates4 = init1; // Message state
Exception[] theExceptions = { null, null, null, null, null, null, null,
null, null, null, null };
BatchUpdateException aBatchUpdateException;
int loopCount = init1.length;
for (int i = 0; i < loopCount; i++) {
try {
aBatchUpdateException = new BatchUpdateException(init1[i],
init2[i], init3[i], init4[i]);
if (theExceptions[i] != null) {
fail();
}
assertEquals(i + " Final state mismatch: ",
aBatchUpdateException.getErrorCode(),
theFinalStates1[i]);
assertEquals(i + " Final state mismatch: ",
aBatchUpdateException.getUpdateCounts(),
theFinalStates2[i]);
assertEquals(i + " Final state mismatch: ",
aBatchUpdateException.getSQLState(), theFinalStates3[i]);
assertEquals(i + " Final state mismatch: ",
aBatchUpdateException.getMessage(), theFinalStates4[i]);
} catch (Exception e) {
if (theExceptions[i] == null) {
fail(i + "Unexpected exception");
}