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

Method testSucess

test/org/apache/pig/TestLoadFuncWrapper.java:44–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42 // Asserts that each call to a Wrapper invokes the correct method on the Wrappee.
43
44 @Test
45 public void testSucess() throws IOException {
46
47 DummyLoadFunc loadFunc = new DummyLoadFunc();
48 MockWrapper wrapper = new MockWrapper(loadFunc);
49
50 wrapper.relativeToAbsolutePath(null,null);
51 assertEquals("relativeToAbsolutePath", loadFunc.getLastMethodCalled());
52
53 wrapper.setLocation(null,null);
54 assertEquals("setLocation", loadFunc.getLastMethodCalled());
55
56 wrapper.getInputFormat();
57 assertEquals("getInputFormat", loadFunc.getLastMethodCalled());
58
59 wrapper.getLoadCaster();
60 assertEquals("getLoadCaster", loadFunc.getLastMethodCalled());
61
62 wrapper.prepareToRead(null,null);
63 assertEquals("prepareToRead", loadFunc.getLastMethodCalled());
64
65 wrapper.getNext();
66 assertEquals("getNext", loadFunc.getLastMethodCalled());
67
68 wrapper.setUDFContextSignature(null);
69 assertEquals("setUDFContextSignature", loadFunc.getLastMethodCalled());
70
71 NoSuchElementException e = null;
72 try {
73 loadFunc.getLastMethodCalled();
74 } catch (NoSuchElementException ex) {
75 e = ex;
76 }
77
78 assertNotNull("The wrapped class had more method invokations than it should have", e);
79 }
80
81 // Asserts that each call to an improperly initialized Wrapper fails.
82 @Test

Callers

nothing calls this directly

Calls 9

getLastMethodCalledMethod · 0.95
getLoadCasterMethod · 0.65
assertEqualsMethod · 0.45
setLocationMethod · 0.45
getInputFormatMethod · 0.45
prepareToReadMethod · 0.45
getNextMethod · 0.45

Tested by

no test coverage detected