/*
* Method test for getUpdateCounts
*/
public void testGetUpdateCounts() {
BatchUpdateException aBatchUpdateException;
int[][] init1 = { { 1, 2, 3 }, {}, null };
int[] theReturn;
int[][] theReturns = init1;
int[] theFinalStates1 = { 0, 0, 0 }; // Error Code state
int[][] theFinalStates2 = init1; // Update Counts array state
String[] theFinalStates3 = { null, null, null }; // SQL State state
// value
String[] theFinalStates4 = { null, null, null }; // Message state
Exception[] theExceptions = { null, null, null };
int loopCount = init1.length;
for (int i = 0; i < loopCount; i++) {
try {
aBatchUpdateException = new BatchUpdateException(init1[i]);
theReturn = aBatchUpdateException.getUpdateCounts();
if (theExceptions[i] != null) {
fail(i + "Exception missed");
}
assertEquals(i + "Return value mismatch", theReturn,
theReturns[i]);
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");
}