@@ -212,22 +212,22 @@ public void testObjectVerification() {
212212 out .writeObject (null ,TClass1 .class );
213213
214214 //Test failure
215- for (Object o : new Object []{new TClass2 ("abc" ,2 ),Calendar .getInstance (), Lists . newArrayList ()}) {
215+ for (Object o : new Object []{new TClass2 ("abc" ,2 ), Calendar .getInstance (), new java . util . ArrayList <> ()}) {
216216 try {
217217 out .writeObjectNotNull (o );
218- fail ();
218+ fail ("Expected an exception but none was thrown" );
219219 } catch (Exception ignored ) {
220220
221221 }
222222 }
223223
224224 ReadBuffer b = out .getStaticBuffer ().asReadBuffer ();
225- assertEquals (t1 , serialize .readClassAndObject (b ));
226- assertNull (serialize .readClassAndObject (b ));
227- assertEquals (t1 , serialize .readObject (b , TClass1 .class ));
228- assertNull (serialize .readObject (b , TClass1 .class ));
225+ assertEquals (t1 , serialize .readClassAndObject (b ), "The first object read does not match the expected TClass1 instance" );
226+ assertNull (serialize .readClassAndObject (b ), "Expected null for the second read but found a non-null value" );
227+ assertEquals (t1 , serialize .readObject (b , TClass1 .class ), "The third object read does not match the expected TClass1 instance" );
228+ assertNull (serialize .readObject (b , TClass1 .class ), "Expected null for the fourth read but found a non-null value" );
229229
230- assertFalse (b .hasRemaining ());
230+ assertFalse (b .hasRemaining (), "Buffer should have no remaining data after all reads" );
231231 }
232232
233233
@@ -245,8 +245,8 @@ public void largeWriteTest() {
245245 out .writeObjectNotNull (str .toString ());
246246 ReadBuffer b = out .getStaticBuffer ().asReadBuffer ();
247247 if (printStats ) log .debug (bufferStats (b ));
248- assertEquals (str .toString (), serialize .readObjectNotNull (b , String .class ));
249- assertFalse (b .hasRemaining ());
248+ assertEquals (str .toString (), serialize .readObjectNotNull (b , String .class ), "Serialized string does not match the original string" );
249+ assertFalse (b .hasRemaining (), "The buffer has remaining data after reading" );
250250 }
251251
252252 @ Test
0 commit comments