void test10() { expectBuildExceptionContaining("test10", "Attribute has no name", "Attributes must have name and value"); } /** * Inline manifest - Invalid attribute without value */ public void test11() { expectBuildExceptionContaining("test11", "Attribute has no value", "Attributes must have name and value"); } /** * Inline manifest - Invalid attribute without value */ public void test12() { expectBuildExceptionContaining("test12", "Section with no name", "Sections must have a name"); } /** * Inline manifest - Duplicate attribute */ public void test13() { expectBuildExceptionContaining("test13", "Duplicate Attribute", "The attribute \"Test\" may not occur more than once in the same section"); }
void testTransferParameterSet() throws Exception { expectFileContains("testTransferParameterSet", // target "out/out.xml", // file "set='myvalue'"); // exptected string } public void testTransferParameterEmpty() throws Exception { expectFileContains("testTransferParameterEmpty", "out/out.xml", "empty=''"); } public void testTransferParameterUnset() throws Exception { expectFileContains("testTransferParameterUnset", "out/out.xml", "undefined='${value}'"); } public void testTransferParameterUnsetWithIf() throws Exception { expectFileContains("testTransferParameterUnsetWithIf", "out/out.xml", "undefined='undefined default value'"); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/ManifestTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/StyleTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void test10() {
1
void testTransferParameterSet() throws Exception {
2
        expectBuildExceptionContaining("test10", "Attribute has no name",
2
        expectFileContains("testTransferParameterSet",  // target
3
                                       "Attributes must have name and 
3
                           "out/out.xml",               // file
4
value");
4
                           "set='myvalue'");
5
    }
5
    
6
    /**
6
    
7
     * Inline manifest - Invalid attribute without value
7
    // exptected string
8
     */
8
    }
9
    public void test11() {
9
    public void testTransferParameterEmpty() throws Exception {
10
        expectBuildExceptionContaining("test11", "Attribute has no value",
10
        expectFileContains("testTransferParameterEmpty",
11
                                       "Attributes must have name and value");
11
                           
12
"out/out.xml",
12
    }
13
                     
13
    /**
14
    
14
     * Inline manifest - Invalid attribute without value
15
     */
16
    public void test12()
15
  "empty=''");
16
    }
17
 {
17
    public void testTransferParameterUnset() throws Exception {
18
        expectBuildExceptionContaining("test12", "Section with no name",
18
        expectFileContains("testTransferParameterUnset",
19
                                       "Sections must have a name");
19
                           
20
"out/out.xml",
20
    }
21
                    
21
    /**
22
    
22
     * Inline manifest - Duplicate attribute
23
   "undefined='${value}'");
23
     */
24
    }
24
    public void test13() {
25
    public void testTransferParameterUnsetWithIf() throws Exception {
25
        expectBuildExceptionContaining("test13", "Duplicate Attribute",
26
        expectFileContains("testTransferParameterUnsetWithIf",
26
                                       "The attribute \"Test\" may not occur more than once in the same section
27
                           "out/out.xml",
27
");
28
                           "undefined='undefined default value'");
28
    }
29
    }
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