219220221222223224225226227228229
prot.readFieldEnd(); // final string prot.readFieldBegin(); assertTrue(prot.readString().equals("bye!")); prot.readFieldEnd(); // shouldl return nulls at end prot.readFieldBegin(); assertNull(prot.readString()); prot.readFieldEnd();
224225226227228229230231232233234
prot.readFieldEnd(); // shouldl return nulls at end prot.readFieldBegin(); assertNull(prot.readString()); prot.readFieldEnd(); // shouldl return nulls at end prot.readFieldBegin(); assertNull(prot.readString()); prot.readFieldEnd();
229230231232233234235236237238239
prot.readFieldEnd(); // shouldl return nulls at end prot.readFieldBegin(); assertNull(prot.readString()); prot.readFieldEnd(); prot.readStructEnd(); } public void testQuotedWrites() throws Exception {
274275276277278279280281282283284
prot.initialize(new Configuration(), schema); prot.readStructBegin(); prot.readFieldBegin(); final String firstRead = prot.readString(); prot.readFieldEnd(); testStr = testStr.replace("\"",""); assertEquals(testStr, firstRead);
288289290291292293294295296297298
TList l = prot.readListBegin(); assertTrue(l.size == 2); assertTrue(prot.readString().equals("elem1")); assertTrue(prot.readString().equals("elem2")); prot.readListEnd(); prot.readFieldEnd(); // shouldl return nulls at end prot.readFieldBegin(); assertNull(prot.readString()); prot.readFieldEnd();
293294295296297298299300301302303
298299300301302303304305306307308
prot.readFieldEnd(); // shouldl return nulls at end prot.readFieldBegin(); assertNull(prot.readString()); prot.readFieldEnd(); prot.readStructEnd(); }
331332333334335336337338339340341
prot.readStructBegin(); // ip address prot.readFieldBegin(); final String ip = prot.readString(); prot.readFieldEnd(); assertEquals("127.0.0.1", ip); // identd prot.readFieldBegin();
338339340341342343344345346347348
assertEquals("127.0.0.1", ip); // identd prot.readFieldBegin(); final String identd = prot.readString(); prot.readFieldEnd(); assertNull(identd); // user prot.readFieldBegin();
345346347348349350351352353354355
assertNull(identd); // user prot.readFieldBegin(); final String user = prot.readString(); prot.readFieldEnd(); assertEquals("frank",user); // finishTime prot.readFieldBegin();