MCPcopy Create free account
hub / github.com/ddf-project/DDF / testMethodInfo

Method testMethodInfo

core/src/test/java/io/ddf/DDFTests.java:20–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18public class DDFTests {
19
20 @Test
21 public void testMethodInfo() throws NoSuchMethodException, SecurityException {
22 Class<?> thisClass = this.getClass();
23 Method testMethod = thisClass.getMethod("testDummy2", String.class, ArrayList.class);
24 MethodInfo methodInfo = new MethodInfo(testMethod);
25 List<ParamInfo> paramInfos = methodInfo.getParamInfos();
26
27 Assert.assertTrue("First parameter must match String", paramInfos.get(0).argMatches(String.class));
28 Assert.assertTrue("Second parameter must match ArrayList<String>",
29 paramInfos.get(1).argMatches(ArrayList.class, String.class));
30 Assert.assertTrue("Second parameter must match ArrayList<String>", paramInfos.get(1).paramMatches(String.class));
31
32 Assert.assertTrue("First parameter must match String", paramInfos.get(0).argMatches("String"));
33 Assert.assertTrue("Second parameter must match ArrayList<String>",
34 paramInfos.get(1).argMatches("ArrayList", "String"));
35 Assert.assertTrue("Second parameter must match ?<String>", paramInfos.get(1).paramMatches("String"));
36 }
37
38 public static void testDummy2(String arg1, ArrayList<String> arg2) {
39 }

Callers

nothing calls this directly

Calls 5

getParamInfosMethod · 0.95
argMatchesMethod · 0.80
paramMatchesMethod · 0.80
getMethod · 0.65
getMethodMethod · 0.45

Tested by

no test coverage detected