@Test
public void testTupleObjectInspector() {
// test get
TupleObjectInspector<TupleN> toi = new TupleObjectInspector<TupleN>(TupleFactory.TUPLEN,
Writables.strings(), Writables.ints(), Writables.floats());
TupleN tuple = new TupleN("Alice", 28, 165.2f);
List<Object> values = toi.getStructFieldsDataAsList(tuple);
assertEquals("Alice", values.get(0));
assertEquals(28, values.get(1));
assertEquals(165.2f, values.get(2));
// test create
TupleN newTuple = toi.create("Alice", 28, 165.2f);
assertEquals(tuple, newTuple);
TupleObjectInspector<Pair> poi = new TupleObjectInspector<Pair>(TupleFactory.PAIR,
Writables.strings(), Writables.ints());
Pair pair = poi.create("word", 29);
assertEquals("word", pair.first());