/*
* Method test for getTransferSize
*/
public void testGetTransferSize() {
DataTruncation aDataTruncation;
int[] init1 = { -2147483648, 2147483647, 0, 78096124, 1719192600,
-1661234694, -1205825753 };
boolean[] init2 = { false, true, false, false, true, false, true };
boolean[] init3 = { false, true, false, false, false, false, false };
int[] init4 = { -2147483648, 2147483647, 0, -493779295, -2042560243,
-217347438, 1357818664 };
int[] init5 = { -2147483648, 2147483647, 0, -1647009002, -717544563,
-1368171905, -918209633 };
int theReturn;
int[] theReturns = init5;
String[] theFinalStates1 = { "22001", "01004", "22001", "22001",
"22001", "22001", "22001" };
String state2 = "Data truncation";
String[] theFinalStates2 = { state2, state2, state2, state2, state2,
state2, state2 };
int[] theFinalStates3 = { 0, 0, 0, 0, 0, 0, 0 };
int[] theFinalStates4 = init1;
int[] theFinalStates5 = init4;
int[] theFinalStates6 = init5;
boolean[] theFinalStates7 = init2;
boolean[] theFinalStates8 = init3;
Exception[] theExceptions = { null, null, null, null, null, null, null };
int loopCount = 1;
for (int i = 0; i < loopCount; i++) {
try {
aDataTruncation = new DataTruncation(init1[i], init2[i],
init3[i], init4[i], init5[i]);
theReturn = aDataTruncation.getTransferSize();
if (theExceptions[i] != null) {
fail(i + "Exception missed");
}
assertEquals(i + "Return value mismatch", theReturn,
theReturns[i]);
assertEquals(i + " Final state mismatch", aDataTruncation
.getSQLState(), theFinalStates1[i]);
assertEquals(i + " Final state mismatch", aDataTruncation
.getMessage(), theFinalStates2[i]);
assertEquals(i + " Final state mismatch", aDataTruncation
.getErrorCode(), theFinalStates3[i]);
assertEquals(i + " Final state mismatch", aDataTruncation
.getIndex(), theFinalStates4[i]);
assertEquals(i + " Final state mismatch", aDataTruncation
.getDataSize(), theFinalStates5[i]);
assertEquals(i + " Final state mismatch", aDataTruncation
.getTransferSize(), theFinalStates6[i]);
assertEquals(i + " Final state mismatch", aDataTruncation
.getParameter(), theFinalStates7[i]);
assertEquals(i + " Final state mismatch", aDataTruncation
.getRead(), theFinalStates8[i]);
} catch (Exception e) {
if (theExceptions[i] == null) {
fail(i + "Unexpected exception");