public void testOrder1() throws IOException, ManifestException { executeTarget("testOrder1"); Manifest manifest = getManifest(EXPANDED_MANIFEST); Enumeration e = manifest.getSectionNames(); String section1 = (String)e.nextElement(); String section2 = (String)e.nextElement(); assertEquals("First section name unexpected", "Test1", section1); assertEquals("Second section name unexpected", "Test2", section2); Manifest.Section section = manifest.getSection("Test1"); e = section.getAttributeKeys(); String attr1Key = (String)e.nextElement(); String attr2Key = (String)e.nextElement(); String attr1 = section.getAttribute(attr1Key).getName(); String attr2 = section.getAttribute(attr2Key).getName(); assertEquals("First attribute name unexpected", "TestAttr1", attr1); assertEquals("Second attribute name unexpected", "TestAttr2", attr2);
public void testOrder2() throws IOException, ManifestException { executeTarget("testOrder2"); Manifest manifest = getManifest(EXPANDED_MANIFEST); Enumeration e = manifest.getSectionNames(); String section1 = (String)e.nextElement(); String section2 = (String)e.nextElement(); assertEquals("First section name unexpected", "Test2", section1); assertEquals("Second section name unexpected", "Test1", section2); Manifest.Section section = manifest.getSection("Test1"); e = section.getAttributeKeys(); String attr1Key = (String)e.nextElement(); String attr2Key = (String)e.nextElement(); String attr1 = section.getAttribute(attr1Key).getName(); String attr2 = section.getAttribute(attr2Key).getName(); assertEquals("First attribute name unexpected", "TestAttr2", attr1); assertEquals("Second attribute name unexpected", "TestAttr1", attr2);
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/ManifestTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public void testOrder1() throws IOException, ManifestException {
1
public void testOrder2() throws IOException, ManifestException {
2
        executeTarget("testOrder1");
2
        executeTarget("testOrder2");
3
        Manifest manifest = getManifest(EXPANDED_MANIFEST);
3
        Manifest manifest = getManifest(EXPANDED_MANIFEST);
4
        Enumeration e = manifest.getSectionNames();
4
        Enumeration e = manifest.getSectionNames();
5
        String section1 = (String)e.nextElement();
5
        String section1 = (String)e.nextElement();
6
        String section2 = (String)e.nextElement();
6
        String section2 = (String)e.nextElement();
7
        assertEquals("First section name unexpected", "Test1", section1);
7
        assertEquals("First section name unexpected", "Test2", section1);
8
        assertEquals("Second section name unexpected", "Test2", section2);
8
        assertEquals("Second section name unexpected", "Test1", section2);
9
        Manifest.Section section = manifest.getSection("Test1");
9
        Manifest.Section section = manifest.getSection("Test1");
10
        e = section.getAttributeKeys();
10
        e = section.getAttributeKeys();
11
        String attr1Key = (String)e.nextElement();
11
        String attr1Key = (String)e.nextElement();
12
        String attr2Key = (String)e.nextElement();
12
        String attr2Key = (String)e.nextElement();
13
        String attr1 = section.getAttribute(attr1Key).getName();
13
        String attr1 = section.getAttribute(attr1Key).getName();
14
        String attr2 = section.getAttribute(attr2Key).getName();
14
        String attr2 = section.getAttribute(attr2Key).getName();
15
        assertEquals("First attribute name unexpected", "TestAttr1", attr1);
15
        assertEquals("First attribute name unexpected", "TestAttr2", attr1);
16
        assertEquals("Second attribute name unexpected", "TestAttr2", attr2);
16
        assertEquals("Second attribute name unexpected", "TestAttr1", attr2);
17
    
17
    
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