void testParseErrorInIncluded() { try { configureProject("src/etc/testcases/core/include/included_file_parse_error/build.xml"); fail("should have caused a parser exception"); } catch (BuildException e) { assertTrue(e.getLocation().toString() + " should refer to included_file.xml", e.getLocation().toString() .indexOf("included_file.xml:") > -1); } } public void testTaskErrorInIncluded() { configureProject("src/etc/testcases/core/include/included_file_task_error/build.xml"); try { executeTarget("test"); fail("should have cause a build failure"); } catch (BuildException e) { assertTrue(e.getMessage() + " should start with \'Warning: Could not find", e.getMessage().startsWith("Warning: Could not find file ")); assertTrue(e.getLocation().toString() + " should end with included_file.xml:2: ", e.getLocation().toString().endsWith("included_file.xml:2: ")); }
void testParseErrorInIncluding() { try { configureProject("src/etc/testcases/core/include/including_file_parse_error/build.xml"); fail("should have caused a parser exception"); } catch (BuildException e) { assertTrue(e.getLocation().toString() + " should refer to build.xml", e.getLocation().toString().indexOf("build.xml:") > -1); } } public void testTaskErrorInIncluding() { configureProject("src/etc/testcases/core/include/including_file_task_error/build.xml"); try { executeTarget("test"); fail("should have cause a build failure"); } catch (BuildException e) { assertTrue(e.getMessage() + " should start with \'Warning: Could not find", e.getMessage().startsWith("Warning: Could not find file ")); assertTrue(e.getLocation().toString() + " should end with build.xml:14: ", e.getLocation().toString().endsWith("build.xml:14: ")); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/IncludeTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/IncludeTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void testParseErrorInIncluded() {
1
void testParseErrorInIncluding() {
2
        try {
2
        try {
3
            configureProject("src/etc/testcases/core/include/included_file_parse_error/build.xml");
3
            configureProject("src/etc/testcases/core/include/including_file_parse_error/build.xml");
4
            fail("should have caused a parser exception");
4
            fail("should have caused a parser exception");
5
        } catch (BuildException e) {
5
        } catch (BuildException e) {
6
            assertTrue(e.getLocation().toString()
6
            assertTrue(e.getLocation().toString()
7
                       + " should refer to included_file.xml",
7
                       + " should refer to build.xml",
8
                       e.getLocation().toString()
8
                       e.getLocation().toString()
9
                       .indexOf("included_file.xml:") > -1);
9
.indexOf("build.xml:") > -1);
10
        }
10
        }
11
    }
11
    }
12
    public void testTaskErrorInIncluded() {
12
    public void testTaskErrorInIncluding() {
13
        configureProject("src/etc/testcases/core/include/included_file_task_error/build.xml");
13
        configureProject("src/etc/testcases/core/include/including_file_task_error/build.xml");
14
        try {
14
        try {
15
            executeTarget("test");
15
            executeTarget("test");
16
            fail("should have cause a build failure");
16
            fail("should have cause a build failure");
17
        } catch (BuildException e) {
17
        } catch (BuildException e) {
18
            assertTrue(e.getMessage()
18
            assertTrue(e.getMessage()
19
                       + " should start with \'Warning: Could not find",
19
                       + " should start with \'Warning: Could not find",
20
                         e.getMessage().startsWith("Warning: Could not find file "));
20
                         e.getMessage().startsWith("Warning: Could not find file "));
21
            assertTrue(e.getLocation().toString()
21
            assertTrue(e.getLocation().toString()
22
                       + " should end with included_file.xml:2: ",
22
                       + " should end with build.xml:14: ",
23
                       e.getLocation().toString().endsWith("included_file.xml:2: "));
23
                       e.getLocation().toString().endsWith("build.xml:14: "));
24
        }
24
        }
25
    
25
    
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