Schema.createUnion(new ArrayList<Schema>()));
protocol.getMessages().put("echo", message);
Transceiver t
= new SocketTransceiver(new InetSocketAddress(server.getPort()));
try {
GenericRequestor r = new GenericRequestor(protocol, t);
GenericRecord args = new GenericData.Record(message.getRequest());
GenericRecord rec = new GenericData.Record(record);
rec.put("name", new Utf8("foo"));
rec.put("kind", new GenericData.EnumSymbol
(PROTOCOL.getType("Kind"), "BAR"));
rec.put("hash", new GenericData.Fixed
(PROTOCOL.getType("MD5"),
new byte[]{0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5}));
rec.put("extra", Boolean.TRUE);
args.put("record", rec);
GenericRecord response = (GenericRecord)r.request("echo", args);
assertEquals(rec, response);
} finally {
t.close();
}
}