void testNestedA() { expectLogContaining("nested.a", "add A called"); } public void testNestedB() { expectLogContaining("nested.b", "add B called"); } public void testNestedC() { expectLogContaining("nested.c", "add C called"); } public void testNestedAB() { expectBuildExceptionContaining( "nested.ab", "Should have got ambiguous", "ambiguous"); }
void testXml() throws Exception { executeJspCompile("testXml", "xml_jsp.java"); } /** * try a keyword in a file */ public void testKeyword() throws Exception { executeJspCompile("testKeyword", "default_jsp.java"); } /** * what happens to 1nvalid-classname */ public void testInvalidClassname() throws Exception { executeJspCompile("testInvalidClassname", "_1nvalid_0002dclassname_jsp.java"); } /** * A unit test for JUnit */ public void testNoTld() throws Exception { // expectBuildExceptionContaining("testNoTld", // "Jasper found an error in a file", // "Java returned: 9"); expectBuildExceptionContaining("testNoTld", "not found", "Java returned: 9"); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/AddTypeTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/JspcTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void testNestedA() {
1
void testXml() throws Exception {
2
        expectLogContaining("nested.a", "add A called");
2
        executeJspCompile("test
3
    }
4
    public void testNestedB()
3
Xml", "xml_jsp.java");
4
    }
5
    /**
6
     * try a keyword in a file
7
     */
5
 {
8
    public void testKeyword() throws Exception {
6
        expectLogContaining("nested.b", "add B called");
9
        executeJspCompile("test
7
    }
8
    public void testNestedC()
10
Keyword", "default_jsp.java");
11
    }
12
    /**
13
     * what happens to 1nvalid-classname
14
     */
9
 {
15
    public void testInvalidClassname() throws Exception {
10
        expectLogContaining("nested.c", "add C called");
16
        executeJspCompile("test
11
    }
12
    public void testNestedAB() {
17
InvalidClassname",
18
                "_1nvalid_0002dclassname_jsp.java");
19
    }
20
    /**
21
     * A unit test for JUnit
22
     */
23
    public void testNoTld() throws Exception {
13
        expectBuildExceptionContaining(
24
//         expectBuildExceptionContaining(
14
            "nested.ab", "Should have got ambiguous", "ambiguous
25
"testNoTld",
26
//                 "Jasper found an error in a file",
27
//                 "Java returned: 9");
28
         expectBuildExceptionContaining("testNoTld",
29
                 "not found",
15
");
30
                 "Java returned: 9");
16
    }
31
    }
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