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

Method testKeySet

test/org/apache/pig/test/TestBuiltin.java:2925–2943  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2923 }
2924
2925 @Test
2926 public void testKeySet() throws Exception {
2927 Map<String, Object> m = new HashMap<String, Object>();
2928 m.put("open", "apache");
2929 m.put("1", "hadoop");
2930 m.put("source", "code");
2931 Tuple input = TupleFactory.getInstance().newTuple(m);
2932
2933 KEYSET keySet = new KEYSET();
2934 DataBag result = keySet.exec(input);
2935 Iterator<Tuple> i = result.iterator();
2936 assertEquals(result.size(), m.size());
2937
2938 while(i.hasNext()) {
2939 Tuple t = i.next();
2940 assertTrue(m.containsKey((String)t.get(0)));
2941 }
2942
2943 }
2944
2945 @SuppressWarnings("unchecked")
2946 @Test

Callers

nothing calls this directly

Calls 12

getInstanceMethod · 0.95
execMethod · 0.95
iteratorMethod · 0.95
sizeMethod · 0.95
getMethod · 0.95
newTupleMethod · 0.65
sizeMethod · 0.65
putMethod · 0.45
assertEqualsMethod · 0.45
hasNextMethod · 0.45
nextMethod · 0.45
containsKeyMethod · 0.45

Tested by

no test coverage detected