Pipe p = new Each(inPipe, new Fields("value"), new ExpandProto(Example.Person.class), new Fields("id", "name", "email", "position"));
Hfs sink = new Hfs(new TextLine(), "/tmp/output");
new HadoopFlowConnector().connect(inTap, sink, p).complete();
TupleEntryIterator iter = sink.openForRead(new HadoopFlowProcess());
List<Tuple> results = new ArrayList<Tuple>();
while (iter.hasNext()) {
results.add(iter.next().getTupleCopy());
}
assertEquals(2, results.size());
assertEquals(new Tuple(0, 1, "bryan", "bryan@mail.com", Example.Person.Position.CEO.getNumber()).toString(), results.get(0).toString());
assertEquals(new Tuple(25, 2, "lucas", null, null).toString(), results.get(1).toString());