prot.readStructEnd();
}
public void testNulls() throws Exception {
TMemoryBuffer trans = new TMemoryBuffer(1024);
TCTLSeparatedProtocol prot = new TCTLSeparatedProtocol(trans, 10);
prot.initialize(new Configuration(), new Properties());
prot.writeStructBegin(new TStruct());
prot.writeFieldBegin(new TField());
prot.writeString(null);
prot.writeFieldEnd();
prot.writeFieldBegin(new TField());
prot.writeString(null);
prot.writeFieldEnd();
prot.writeFieldBegin(new TField());
prot.writeI32(100);
prot.writeFieldEnd();
prot.writeFieldBegin(new TField());
prot.writeString(null);
prot.writeFieldEnd();
prot.writeFieldBegin(new TField());
prot.writeMapBegin(new TMap());
prot.writeString(null);
prot.writeString(null);
prot.writeString("key2");
prot.writeString(null);
prot.writeString(null);
prot.writeString("val3");
prot.writeMapEnd();
prot.writeFieldEnd();
prot.writeStructEnd();
byte b[] = new byte[3 * 1024];
int len = trans.read(b, 0, b.length);
String written = new String(b, 0, len);
String testRef = "\\N\\N100\\N\\N\\Nkey2\\N\\Nval3";
assertTrue(testRef.equals(written));
trans = new TMemoryBuffer(1023);
trans.write(b, 0, len);
prot = new TCTLSeparatedProtocol(trans, 3);
prot.initialize(new Configuration(), new Properties());
prot.readStructBegin();