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 testDuplicateOptions()
|
Method name: void testIncompatableOptions()
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | final CLOptionDescriptor[] options = new CLOptionDescriptor[] { DEFINE, ALL, CLEAR1 };↵ | 1 | final CLOptionDescriptor[] options = new CLOptionDescriptor[] { DEFINE, ALL, CLEAR1, BLEE };↵ | |
2 | final CLArgsParser parser = new CLArgsParser(ARGLIST3, options);↵ | 2 | final CLArgsParser parser = new CLArgsParser(ARGLIST4, options);↵ | |
3 | assertNull(parser.getErrorString(), parser.getErrorString());↵ | 3 | assertNotNull(parser.getErrorString());↵ | |
4 | final List clOptions = parser.getArguments();↵ | 4 | final List clOptions = parser.getArguments();↵ | |
5 | final int size = clOptions.size();↵ | 5 | final int size = clOptions.size();↵ | |
6 | assertEquals(size, 5);↵ | 6 | assertEquals(size, 5);↵ | |
7 | assertEquals(((CLOption) clOptions.get(0)).getDescriptor().getId(), DEFINE_OPT);↵ | 7 | assertEquals(((CLOption) clOptions.get(0)).getDescriptor().getId(), DEFINE_OPT);↵ | |
8 | assertEquals(((CLOption) clOptions.get(1)).getDescriptor().getId(), 0);↵ | 8 | assertEquals(((CLOption) clOptions.get(1)).getDescriptor().getId(), 0);↵ | |
9 | assertEquals(((CLOption) clOptions.get(2)).getDescriptor().getId(), ALL_OPT);↵ | 9 | assertEquals(((CLOption) clOptions.get(2)).getDescriptor().getId(), ALL_OPT);↵ | |
10 | assertEquals(((CLOption) clOptions.get(3)).getDescriptor().getId(), ALL_OPT);↵ | 10 | assertEquals(((CLOption) clOptions.get(3)).getDescriptor().getId(), BLEE_OPT);↵ | |
11 | assertEquals(((CLOption) clOptions.get(4)).getDescriptor().getId(), 0); | 11 |
| |
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 | 101 |
Number of mapped statements | 11 |
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[] {DEFINE, ALL, CLEAR1}; |
| 1 | final CLOptionDescriptor[] options = new CLOptionDescriptor[] {DEFINE, ALL, CLEAR1, BLEE}; | |||||||||||||||||||||
2 | final CLArgsParser parser = new CLArgsParser(ARGLIST3, options); |
| 2 | final CLArgsParser parser = new CLArgsParser(ARGLIST4, options); | |||||||||||||||||||||
3 | assertNull(parser.getErrorString(), parser.getErrorString()); |
| 3 | assertNotNull(parser.getErrorString()); | |||||||||||||||||||||
4 | final List clOptions = parser.getArguments(); | 4 | final List clOptions = parser.getArguments(); | ||||||||||||||||||||||
5 | final int size = clOptions.size(); | 5 | final int size = clOptions.size(); | ||||||||||||||||||||||
6 | assertEquals(size, 5); | 6 | assertEquals(size, 5); | ||||||||||||||||||||||
7 | assertEquals(((CLOption)clOptions.get(0)).getDescriptor().getId(), DEFINE_OPT); | 7 | assertEquals(((CLOption)clOptions.get(0)).getDescriptor().getId(), DEFINE_OPT); | ||||||||||||||||||||||
8 | assertEquals(((CLOption)clOptions.get(1)).getDescriptor().getId(), 0); | 8 | assertEquals(((CLOption)clOptions.get(1)).getDescriptor().getId(), 0); | ||||||||||||||||||||||
9 | assertEquals(((CLOption)clOptions.get(2)).getDescriptor().getId(), ALL_OPT); | 9 | assertEquals(((CLOption)clOptions.get(2)).getDescriptor().getId(), ALL_OPT); | ||||||||||||||||||||||
10 | assertEquals(((CLOption)clOptions.get(3)).getDescriptor().getId(), ALL_OPT); |
| 10 | assertEquals(((CLOption)clOptions.get(3)).getDescriptor().getId(), BLEE_OPT); | |||||||||||||||||||||
11 | assertEquals(((CLOption)clOptions.get(4)).getDescriptor().getId(), 0); | 11 | assertEquals(((CLOption)clOptions.get(4)).getDescriptor().getId(), 0); |
Row | Violation |
---|---|
1 | Expression assertNull(parser.getErrorString(),parser.getErrorString()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression assertNotNull(parser.getErrorString()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression assertNull(parser.getErrorString(),parser.getErrorString()) is a void method call, and thus it cannot be parameterized |
4 | Expression assertNotNull(parser.getErrorString()) is a void method call, and thus it cannot be parameterized |
5 | Expression assertNull(parser.getErrorString(),parser.getErrorString()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression assertNotNull(parser.getErrorString()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression assertNull(parser.getErrorString(),parser.getErrorString()) is a void method call, and thus it cannot be parameterized |
8 | Expression assertNotNull(parser.getErrorString()) is a void method call, and thus it cannot be parameterized |