assertEquals(FILE_OPT, ((CLOption) clOptions.get(2)).getDescriptor().getId()); assertEquals("a", ((CLOption) clOptions.get(2)).getArgument()); } public void testCombinedArgs3() { final CLOptionDescriptor[] options = new CLOptionDescriptor[] { BLEE, TAINT, FILE }; final CLArgsParser parser = new CLArgsParser(new String[] { "-bT", "--", "-fa" }// Should // not // detect // trailing // option , options); assertNull(parser.getErrorString(), parser.getErrorString()); final List clOptions = parser.getArguments(); final int size = clOptions.size(); assertEquals(3, size); assertEquals
assertEquals(FILE_OPT, ((CLOption) clOptions.get(0)).getDescriptor().getId()); assertEquals("-=-", ((CLOption) clOptions.get(0)).getArgument()); } public void testSingleArg7() { final CLOptionDescriptor[] options = new CLOptionDescriptor[] { FILE }; final CLArgsParser parser = new CLArgsParser(new String[] { "--file=-=-" }, options); assertNull(parser.getErrorString(), parser.getErrorString()); final List clOptions = parser.getArguments(); final int size = clOptions.size(); assertEquals(1, size); assertEquals
Clone fragments detected by clone detection tool
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: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
assertEquals(FILE_OPT, ((CLOption) clOptions.get(2)).getDescriptor().getId());
1
assertEquals(FILE_OPT, ((CLOption) clOptions.get(0)).getDescriptor().getId());
2
        assertEquals("a", ((CLOption) clOptions.get(2)).getArgument());
2
        assertEquals("-=-", ((CLOption) clOptions.get(0)).getArgument());
3
    }
3
    }
4
    public void testCombinedArgs3() {
4
    public void testSingleArg7() {
5
        final CLOptionDescriptor[] options = new CLOptionDescriptor[] { BLEE, TAINT, FILE };
5
        final CLOptionDescriptor[] options = new CLOptionDescriptor[] { FILE };
6
        final CLArgsParser parser = new CLArgsParser(new String[] { "-bT", "--", "-fa" }// Should
6
        final CLArgsParser parser = new CLArgsParser(new String[] { "-
7
                                                                                        // not
8
                                                                                        // detect
9
                                                                                        // trailing
10
                                                                                        // option
11
                , options);
7
-file=-=-" }, options);
12
        assertNull(parser.getErrorString(), parser.getErrorString());
8
        assertNull(parser.getErrorString(), parser.getErrorString());
13
        final List clOptions = parser.getArguments();
9
        final List clOptions = parser.getArguments();
14
        final int size = clOptions.size();
10
        final int size = clOptions.size();
15
        assertEquals(3, size);
11
        assertEquals(1, size);
16
        assertEquals
12
        assertEquals
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0