void testTextElement() { expectLogContaining( "textelement", "Hello world"); } public void testTextTrim() { expectLogContaining( "text.trim", "[Hello world]"); } public void testDuplicateTextName() { expectBuildException( "duplicatetextname", "the name \"text\" is already used as an attribute"); } public void testDuplicateTextName2() { expectBuildException( "duplicatetextname2", "the attribute name \"text\" has already been used by the text element"); }
void testDuplicateAttribute() { expectBuildException( "duplicate.attribute", "the attribute text has already been specified"); } public void testDuplicateElement() { expectBuildException( "duplicate.element", "the element text has already been specified"); } public void testUri() { expectLog("uri", "Hello World"); } public void testNested() { expectLog("nested", "A nested element"); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/MacroDefTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/MacroDefTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void testTextElement() {
1
void testDuplicateAttribute() {
2
        expectLogContaining(
2
        expectBuildException(
3
            "textelement", "Hello world");
3
            "
4
    }
5
    public void testTextTrim() {
6
        expectLogContaining(
7
            "text.trim", "[Hello world]
4
duplicate.attribute",
8
");
5
            "the attribute text has already been specified");
9
    }
6
    }
10
    public void testDuplicateTextName() {
7
    public void testDuplicateElement() {
11
        expectBuildException(
8
        expectBuildException(
12
            "duplicatetextname",
9
            "duplicate.element",
13
            "the name \"text\" is already used as an attribute");
10
            "the element text has already been specified");
14
    }
11
    }
15
    public void testDuplicateTextName2() {
12
    public void testUri() {
16
        expectBuildException(
13
        expect
17
    
14
Log("uri", "Hello World");
18
    
15
    }
19
    "duplicatetextname2",
16
    
20
            "the attribute name \"text\" has already been used by the text
17
public void testNested() {
21
 element");
18
        expectLog("nested", "A nested element");
22
    }
19
    }
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