222223224225226227228229230231232
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();
227228229230231232233234235236237
prot.readFieldEnd(); // shouldl return nulls at end prot.readFieldBegin(); assertNull(prot.readString()); prot.readFieldEnd(); prot.readStructEnd(); } public void testQuotedWrites() throws Exception {
271272273274275276277278279280281
prot.initialize(new Configuration(), schema); prot.readStructBegin(); prot.readFieldBegin(); final String firstRead = prot.readString(); prot.readFieldEnd(); testStr = testStr.replace("\"", ""); assertEquals(testStr, firstRead);
284285286287288289290291292293294
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();
289290291292293294295296297298299
294295296297298299300301302303304
prot.readFieldEnd(); // shouldl return nulls at end prot.readFieldBegin(); assertNull(prot.readString()); prot.readFieldEnd(); prot.readStructEnd(); } /**
329330331332333334335336337338339
prot.readStructBegin(); // ip address prot.readFieldBegin(); final String ip = prot.readString(); prot.readFieldEnd(); assertEquals("127.0.0.1", ip); // identd prot.readFieldBegin();
336337338339340341342343344345346
assertEquals("127.0.0.1", ip); // identd prot.readFieldBegin(); final String identd = prot.readString(); prot.readFieldEnd(); assertNull(identd); // user prot.readFieldBegin();
343344345346347348349350351352353
assertNull(identd); // user prot.readFieldBegin(); final String user = prot.readString(); prot.readFieldEnd(); assertEquals("frank", user); // finishTime prot.readFieldBegin();
350351352353354355356357358359360
assertEquals("frank", user); // finishTime prot.readFieldBegin(); final String finishTime = prot.readString(); prot.readFieldEnd(); assertEquals("10/Oct/2000:13:55:36 -0700", finishTime); // requestLine prot.readFieldBegin();