MCPcopy Create free account
hub / github.com/cbeust/jcommander / testIssue244

Method testIssue244

src/test/java/com/beust/jcommander/CmdTest.java:91–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89 }
90
91 @Test
92 public void testIssue244() throws Exception {
93 class P1 {}
94 class P2 {
95 @Parameter(names = "--hello")
96 private int test;
97 }
98 P1 p1 = new P1();
99 P2 p2 = new P2();
100 JCommander j = new JCommander(p1);
101 j.addCommand("wonderful", p2);
102 j.setAllowAbbreviatedOptions(true);
103 j.parse("wond", "--he", "47");
104 Assert.assertEquals("wonderful", j.getParsedCommand());
105 Assert.assertEquals(47, p2.test);
106 }
107}

Callers

nothing calls this directly

Calls 4

addCommandMethod · 0.95
parseMethod · 0.95
getParsedCommandMethod · 0.95

Tested by

no test coverage detected