1 | CLOption option = (CLOption) clOptions.get(0);↵ | | 1 | CLOption option = (CLOption) clOptions.get(0);↵
|
2 | assertEquals(option.getDescriptor().getId(), DEFINE_OPT);↵ | | 2 | assertEquals(option.getDescriptor().getId(), DEFINE_OPT);↵
|
3 | assertEquals(option.getArgument(0), "stupid");↵ | | 3 | assertEquals(option.getArgument(0), "stupid");↵
|
4 | assertEquals(option.getArgument(1), "");↵ | | 4 | assertEquals(option.getArgument(1), "");↵
|
5 | }↵ | | 5 | }↵
|
|
6 | public void testIncomplete2ArgsMixedNoEq() {↵ | | 6 | public void testIncomplete2ArgsMixed() {↵
|
7 | // "-Dstupid","-c"↵ | | 7 | // "-Dstupid=","-c"↵
|
8 | final CLOptionDescriptor[] options = new CLOptionDescriptor[] { DEFINE, CLEAR1 };↵ | | 8 | final CLOptionDescriptor[] options = new CLOptionDescriptor[] { DEFINE, CLEAR1 };↵
|
|
9 | final String[] args = new String[] { "-DStupid", "-c" };↵ | | 9 | final String[] args = new String[] { "-Dstupid=", "-c" };↵
|
|
10 | final CLArgsParser parser = new CLArgsParser(args, options);↵ | | 10 | final CLArgsParser parser = new CLArgsParser(args, options);↵
|
|
11 | assertNull(parser.getErrorString(), parser.getErrorString());↵ | | 11 | assertNull(parser.getErrorString(), parser.getErrorString());↵
|
|
12 | final List clOptions = parser.getArguments();↵ | | 12 | final List clOptions = parser.getArguments();↵
|
13 | final int size = clOptions.size();↵ | | 13 | final int size = clOptions.size();↵
|
|
14 | assertEquals(size, 2);↵ | | 14 | assertEquals(size, 2);↵
|
15 | assertEquals(((CLOption) clOptions.get(1)).getDescriptor().getId(), CLEAR1_OPT);↵ | | 15 | assertEquals(((CLOption) clOptions.get(1)).getDescriptor().getId(), CLEAR1_OPT);↵
|
16 | final CLOption option = (CLOption) clOptions.get(0);↵ | | 16 | final CLOption option = (CLOption) clOptions.get(0);↵
|
17 | assertEquals(option.getDescriptor().getId(), DEFINE_OPT);↵ | | 17 | assertEquals(option.getDescriptor().getId(), DEFINE_OPT);↵
|
18 | assertEquals(option.getArgument(0), "Stupid");↵ | | 18 | assertEquals(option.getArgument(0), "stupid");↵
|
19 | assertEquals(option.getArgument(1), "");↵ | | 19 | assertEquals(option.getArgument(1), "");↵
|
20 | | | 20 |
|