class CaseTest extends BuildFileTest { public CaseTest(String name) { super(name); } public void setUp() { configureProject("src/etc/testcases/core/case.xml"); } /** * Test whether the build file treats nested elements without * regard to case. This should not cause an exception. */ public void testCaseSensitivity() { executeTarget("case-sensitivity"); } /** * Test whether the build file uses case when determining * task names. */ public void testTaskCase() { expectBuildExceptionContaining("taskcase", "Task names are case sensitive", "Problem: failed to create task or type ecHO"); }
class LoaderRefTest extends BuildFileTest { public LoaderRefTest(String name) { super(name); } public void setUp() { configureProject("src/etc/testcases/core/loaderref/loaderref.xml"); } public void tearDown() { executeTarget("clean"); } // override allowed on <available> public void testBadRef() { expectBuildExceptionContaining("testbadref", "Should fail due to ref " + "not being a class loader", "does not reference a class loader"); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/CaseTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/LoaderRefTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
class CaseTest extends BuildFileTest {
1
class LoaderRefTest extends BuildFileTest {
2
    public CaseTest(String name) {
2
    public LoaderRefTest(String name) {
3
        super(name);
3
        super(name);
4
    }
4
    }
5
    public void setUp() {
5
    public void setUp() {
6
        configureProject("src/etc/testcases/core/case.xml");
6
        configureProject("src/etc/testcases/core/
7
    }
8
    /**
9
     * Test whether the build file treats nested elements without
10
     * regard to case. This should not cause an exception.
7
loaderref/loaderref.xml");
11
     */
8
    }
12
    public void testCaseSensitivity() {
9
    public void tearDown() {
13
        executeTarget("case-sensitivity");
10
        executeTarget("clean");
14
    }
11
    }
15
    /**
12
    /
16
     * Test whether the build file uses case when determining
17
     * task names.
18
     */
13
/ override allowed on <available>
19
    public void testTaskCase() {
14
    public void testBadRef() {
20
        expectBuildExceptionContaining("taskcase",
15
        expectBuildExceptionContaining("t
21
            "Task names are case sensitive",
22
            "Problem: failed to create task or type ecHO
16
estbadref", "Should fail due to ref "
23
");
17
            + "not being a class loader", "does not reference a class loader");
24
    }
18
    }
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