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");
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");
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 testDuplicateAttribute() {
1
void testTextElement() {
2
        expectBuildException(
2
        expectLogContaining(
3
            "duplicate.attribute",
3
            "
4
            "the attribute text has already been specified
4
textelement", "Hello world");
5
    }
6
    public void testTextTrim() {
7
        expectLogContaining(
5
");
8
            "text.trim", "[Hello world]");
6
    }
9
    }
7
    public void testDuplicateElement() {
10
    public void testDuplicateTextName() {
8
        expectBuildException(
11
        expectBuildException(
9
            "duplicate.element",
12
            "duplicatetextname",
10
            "the element text has already been specified");
13
            "the name \"text\" is already used as an attribute");
11
    }
14
    }
12
    public void testUri() {
15
    public void testDuplicateTextName2() {
13
        expectLog("uri", "Hello World");
16
        expectBuildException(
14
    }
17
    
15
    public void testNested() {
18
    
16
        expectLog("nested", "A nested
19
    "duplicatetextname2",
17
 element");
20
            "the attribute name \"text\" has already been used by the text element");
18
    
21
    
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