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