MCPcopy Create free account
hub / github.com/apache/pig / testTupleFormat

Method testTupleFormat

test/org/apache/pig/test/TestTuple.java:49–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47 private static final BinInterSedes bis = new BinInterSedes();
48
49 @Test
50 public void testTupleFormat() {
51
52 try {
53 Tuple tuple = mTupleFactory.newTuple(7);
54 tuple.set(0, 12);
55 Map<String, String> map = new HashMap<String, String>();
56 map.put("pig", "scalability");
57 tuple.set(1, map);
58 tuple.set(2, null);
59 tuple.set(3, 12L);
60 tuple.set(4, 1.2F);
61
62 Tuple innerTuple = mTupleFactory.newTuple(1);
63 innerTuple.set(0, "innerTuple");
64 tuple.set(5, innerTuple);
65
66 DataBag bag = BagFactory.getInstance().newDefaultBag();
67 bag.add(innerTuple);
68 tuple.set(6, bag);
69
70 assertEquals(
71 "(12,[pig#scalability],,12,1.2,(innerTuple),{(innerTuple)})",
72 TupleFormat.format(tuple));
73 } catch (ExecException e) {
74 e.printStackTrace();
75 fail();
76 }
77
78 }
79
80 @Test
81 public void testEmptyTupleSize() {

Callers

nothing calls this directly

Calls 8

setMethod · 0.95
getInstanceMethod · 0.95
addMethod · 0.95
formatMethod · 0.95
newTupleMethod · 0.65
putMethod · 0.45
newDefaultBagMethod · 0.45
assertEqualsMethod · 0.45

Tested by

no test coverage detected