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

Method testArrayConversion

test/org/apache/pig/test/TestInvoker.java:94–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92 }
93
94 @Test
95 public void testArrayConversion() throws SecurityException, ClassNotFoundException, NoSuchMethodException, IOException {
96 InvokeForInt ii = new InvokeForInt(TestInvoker.class.getName() + ".avg", "double[]");
97 DataBag nums = newSimpleBag(1.0, 2.0, 3.0);
98 assertEquals(Integer.valueOf(2), ii.exec(tf_.newTuple(nums)));
99
100 ii = new InvokeForInt(TestInvoker.class.getName() + ".avg", "long[]");
101 nums = newSimpleBag(1L, 2L, 3L);
102 assertEquals(Integer.valueOf(2), ii.exec(tf_.newTuple(nums)));
103
104 InvokeForString is = new InvokeForString(TestInvoker.class.getName() + ".concatStringArray", "string[]");
105 DataBag strings = newSimpleBag("foo", "bar", "baz");
106 assertEquals("foobarbaz", is.exec(tf_.newTuple(strings)));
107 }
108
109 @Test
110 public void testDoubleInvoker() throws SecurityException, ClassNotFoundException, NoSuchMethodException, NumberFormatException, IOException {

Callers

nothing calls this directly

Calls 5

newSimpleBagMethod · 0.95
newTupleMethod · 0.65
getNameMethod · 0.45
assertEqualsMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected