void test9() { expectBuildExceptionContaining("test9", "Construction is invalid - Name attribute should not be used", "Specify the section name using the \"name\" attribute of the <section> element"); } /** * Inline manifest - Invalid attribute without name */ public 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");
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 test9() {
1
void testTransferParameterSet() throws Exception {
2
        expectBuildExceptionContaining("test9", "Construction is invalid - Name attribute should not be used",
2
        expectFileContains("test
3
TransferParameterSet",  // target
3
                                       "Specify the section name using the \"name\" attribute of the <section> element
4
                           "out/out.xml",               // file
4
");
5
                           "set='myvalue'");
5
    }
6
    
6
    /**
7
    
7
     * Inline manifest - Invalid attribute without name
8
    // exptected string
8
     */
9
    }
9
    public void test10() {
10
    public void testTransferParameterEmpty() throws Exception {
10
        expectBuildExceptionContaining("test10", "Attribute has no name",
11
        expectFileContains("testTransferParameterEmpty",
11
                                       "Attributes must have name and value");
12
                           
13
"out/out.xml",
12
    }
14
                     
13
    /**
15
    
14
     * Inline manifest - Invalid attribute without value
15
     */
16
    public void test11()
16
  "empty=''");
17
    }
17
 {
18
    public void testTransferParameterUnset() throws Exception {
18
        expectBuildExceptionContaining("test11", "Attribute has no value",
19
        expectFileContains("testTransferParameterUnset",
19
                                       "Attributes must have name and value");
20
                           
21
"out/out.xml",
20
    }
22
                 
21
    /**
23
    
22
     * Inline manifest - Invalid attribute without value
24
      "undefined='${value}'");
23
     */
25
    }
24
    public void test12() {
26
    public void testTransferParameterUnsetWithIf() throws Exception {
25
        expectBuildExceptionContaining("test12", "Section with no name",
27
        expectFileContains("testTransferParameterUnsetWithIf",
26
                                       "Sections must have a name
28
                           "out/out.xml",
27
");
29
                           "undefined='undefined default value'");
28
    
30
    
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