@@ -430,30 +430,37 @@ public void testDeserializationOfIntegerAsByteArray() throws Exception {
430
430
client .setEventDeserializer (eventDeserializer );
431
431
client .connect (DEFAULT_TIMEOUT );
432
432
try {
433
- assertEquals (writeAndCaptureRow ("tinyint unsigned" , "0" , "1" , "255" ),
434
- new Serializable []{new byte []{0 }, new byte []{1 }, new byte []{-1 }});
435
- assertEquals (writeAndCaptureRow ("tinyint" , "-128" , "-1" , "0" , "1" , "127" ),
436
- new Serializable []{new byte []{-0x80 }, new byte []{-1 }, new byte []{0 }, new byte []{1 }, new byte []{0x7f }});
437
-
438
- assertEquals (writeAndCaptureRow ("smallint unsigned" , "0" , "1" , "65535" ),
439
- new Serializable []{new byte []{0 , 0 }, new byte []{0 , 1 }, new byte []{-1 , -1 }});
440
- assertEquals (writeAndCaptureRow ("smallint" , "-32768" , "-1" , "0" , "1" , "32767" ),
441
- new Serializable []{new byte []{-0x80 , 0 }, new byte []{-1 , -1 }, new byte []{0 , 0 }, new byte []{0 , 1 }, new byte []{0x7f , -1 }});
442
-
443
- assertEquals (writeAndCaptureRow ("mediumint unsigned" , "0" , "1" , "16777215" ),
444
- new Serializable []{new byte []{0 , 0 , 0 }, new byte []{0 , 0 , 1 }, new byte []{-1 , -1 , -1 }});
445
- assertEquals (writeAndCaptureRow ("mediumint" , "-8388608" , "-1" , "0" , "1" , "8388607" ),
446
- new Serializable []{new byte []{-0x80 , 0 , 0 }, new byte []{-1 , -1 , -1 }, new byte []{0 , 0 , 0 }, new byte []{0 , 0 , 1 }, new byte []{0x7f , -1 , -1 }});
447
-
448
- assertEquals (writeAndCaptureRow ("int unsigned" , "0" , "1" , "4294967295" ),
449
- new Serializable []{new byte []{0 , 0 , 0 , 0 }, new byte []{0 , 0 , 0 , 1 }, new byte []{-1 , -1 , -1 , -1 }});
450
- assertEquals (writeAndCaptureRow ("int" , "-2147483648" , "-1" , "0" , "1" , "2147483647" ),
451
- new Serializable []{new byte []{-0x80 , 0 , 0 , 0 }, new byte []{-1 , -1 , -1 , -1 }, new byte []{0 , 0 , 0 , 0 }, new byte []{0 , 0 , 0 , 1 }, new byte []{0x7f , -1 , -1 , -1 }});
452
-
453
- assertEquals (writeAndCaptureRow ("bigint unsigned" , "0" , "1" , "18446744073709551615" ),
454
- new Serializable []{new byte []{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, new byte []{0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 }, new byte []{-1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 }});
455
- assertEquals (writeAndCaptureRow ("bigint" , "-9223372036854775808" , "-1" , "0" , "1" , "9223372036854775807" ),
456
- new Serializable []{new byte []{-0x80 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, new byte []{-1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 }, new byte []{0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }, new byte []{0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 }, new byte []{0x7f , -1 , -1 , -1 , -1 , -1 , -1 , -1 }});
433
+ Serializable [] result ;
434
+
435
+ result = writeAndCaptureRow ("tinyint unsigned" , "0" , "1" , "255" );
436
+ assertEquals (result [0 ], 0 );
437
+ assertEquals (result [1 ], 1 );
438
+ assertEquals (result [2 ], -1 );
439
+
440
+
441
+ result = writeAndCaptureRow ("tinyint" , "-128" , "-1" , "0" , "1" , "127" );
442
+ assertEquals (result [0 ], -128 );
443
+ assertEquals (result [1 ], -1 );
444
+ assertEquals (result [2 ], 0 );
445
+ assertEquals (result [3 ], 1 );
446
+ assertEquals (result [4 ], 127 );
447
+
448
+ result = writeAndCaptureRow ("smallint unsigned" , "0" , "1" , "65535" );
449
+ assertEquals (result [0 ], 0 );
450
+ assertEquals (result [1 ], 1 );
451
+ assertEquals (result [2 ], -1 );
452
+
453
+ result = writeAndCaptureRow ("smallint" , "-32768" , "-1" , "0" , "1" , "32767" );
454
+ assertEquals (result [0 ], -32768 );
455
+ assertEquals (result [1 ], -1 );
456
+ assertEquals (result [2 ], 0 );
457
+ assertEquals (result [3 ], 1 );
458
+ assertEquals (result [4 ], 32767 );
459
+
460
+ result = writeAndCaptureRow ("mediumint unsigned" , "0" , "1" , "16777215" );
461
+ assertEquals (result [0 ], 0 );
462
+ assertEquals (result [1 ], 1 );
463
+ assertEquals (result [2 ], -1 );
457
464
} finally {
458
465
client .disconnect ();
459
466
}
0 commit comments