assertEquals(empty, message);
}
@Test
public void testQuery() throws Exception {
ProtobufEncoder encoder = new ProtobufEncoder();
Query query = Query.newBuilder()
.setId(1)
.setQuestioner("Chen Shuo")
.addQuestion("Running?")
.build();
ChannelBuffer buf = (ChannelBuffer) encoder.encode(null, null, query);
ProtobufDecoder decoder = new ProtobufDecoder();
decoder.addMessageType(Query.getDefaultInstance());
Message message = (Message) decoder.decode(null, null, buf);
assertEquals(query, message);