File path: /jakarta-jmeter-2.3.2/test/src/org/apache/commons/cli/avalon/ClutilTestCase.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/commons/cli/avalon/ClutilTestCase.java | |||
Method name: void testOptionalArgsWithArgShortBeforeOtherOpt()
|
Method name: void testOptionalArgsNoArgShortBeforeOtherOpt()
|
|||
Number of AST nodes: 13 | Number of AST nodes: 13 | |||
1 | final CLOptionDescriptor[] options = new CLOptionDescriptor[] { ALL, TAINT };↵ | 1 | final CLOptionDescriptor[] options = new CLOptionDescriptor[] { ALL, TAINT };↵ | |
2 | final String[] args = new String[] { "-T3", "-a" };↵ | 2 | final String[] args = new String[] { "-T", "-a" };↵ | |
3 | final CLArgsParser parser = new CLArgsParser(args, options);↵ | 3 | final CLArgsParser parser = new CLArgsParser(args, options);↵ | |
4 | assertNull(parser.getErrorString(), parser.getErrorString());↵ | 4 | assertNull(parser.getErrorString(), parser.getErrorString());↵ | |
5 | final List clOptions = parser.getArguments();↵ | 5 | final List clOptions = parser.getArguments();↵ | |
6 | final int size = clOptions.size();↵ | 6 | final int size = clOptions.size();↵ | |
7 | assertEquals(size, 2);↵ | 7 | assertEquals(size, 2);↵ | |
8 | final CLOption option0 = (CLOption) clOptions.get(0);↵ | 8 | final CLOption option0 = (CLOption) clOptions.get(0);↵ | |
9 | assertEquals(option0.getDescriptor().getId(), TAINT_OPT);↵ | 9 | assertEquals(TAINT_OPT, option0.getDescriptor().getId());↵ | |
10 | assertEquals(option0.getArgument(0), "3");↵ | 10 | assertEquals(null, option0.getArgument(0));↵ | |
11 | final CLOption option1 = (CLOption) clOptions.get(1);↵ | 11 | final CLOption option1 = (CLOption) clOptions.get(1);↵ | |
12 | assertEquals(ALL_OPT, option1.getDescriptor().getId());↵ | 12 | assertEquals(ALL_OPT, option1.getDescriptor().getId());↵ | |
13 | assertEquals(null, option1.getArgument(0)); | 13 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 145 |
Number of mapped statements | 13 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | final CLOptionDescriptor[] options = new CLOptionDescriptor[] {ALL, TAINT}; | 1 | final CLOptionDescriptor[] options = new CLOptionDescriptor[] {ALL, TAINT}; | ||||||||||||||||
2 | final String[] args = new String[] {"-T3", "-a"}; |
| 2 | final String[] args = new String[] {"-T", "-a"}; | |||||||||||||||
3 | final CLArgsParser parser = new CLArgsParser(args, options); | 3 | final CLArgsParser parser = new CLArgsParser(args, options); | ||||||||||||||||
4 | assertNull(parser.getErrorString(), parser.getErrorString()); | 4 | assertNull(parser.getErrorString(), parser.getErrorString()); | ||||||||||||||||
5 | final List clOptions = parser.getArguments(); | 5 | final List clOptions = parser.getArguments(); | ||||||||||||||||
6 | final int size = clOptions.size(); | 6 | final int size = clOptions.size(); | ||||||||||||||||
7 | assertEquals(size, 2); | 7 | assertEquals(size, 2); | ||||||||||||||||
8 | final CLOption option0 = (CLOption)clOptions.get(0); | 8 | final CLOption option0 = (CLOption)clOptions.get(0); | ||||||||||||||||
9 | assertEquals(option0.getDescriptor().getId(), TAINT_OPT); |
| 9 | assertEquals(TAINT_OPT, option0.getDescriptor().getId()); | |||||||||||||||
10 | assertEquals(option0.getArgument(0), "3"); |
| 10 | assertEquals(null, option0.getArgument(0)); | |||||||||||||||
11 | final CLOption option1 = (CLOption)clOptions.get(1); | 11 | final CLOption option1 = (CLOption)clOptions.get(1); | ||||||||||||||||
12 | assertEquals(ALL_OPT, option1.getDescriptor().getId()); | 12 | assertEquals(ALL_OPT, option1.getDescriptor().getId()); | ||||||||||||||||
13 | assertEquals(null, option1.getArgument(0)); | 13 | assertEquals(null, option1.getArgument(0)); |
Row | Violation |
---|---|
1 | Expression option0.getDescriptor().getId() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression option0.getDescriptor().getId() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression option0.getArgument(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression option0.getArgument(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted |