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: void testOrder2()
|
Method name: void testOrder1()
|
|||
Number of AST nodes: 15 | Number of AST nodes: 15 | |||
1 | executeTarget("testOrder2");↵ | 1 | executeTarget("testOrder1");↵ | |
2 | Manifest manifest = getManifest(EXPANDED_MANIFEST);↵ | 2 | Manifest manifest = getManifest(EXPANDED_MANIFEST);↵ | |
3 | Enumeration e = manifest.getSectionNames();↵ | 3 | Enumeration e = manifest.getSectionNames();↵ | |
4 | String section1 = (String)e.nextElement();↵ | 4 | String section1 = (String)e.nextElement();↵ | |
5 | String section2 = (String)e.nextElement();↵ | 5 | String section2 = (String)e.nextElement();↵ | |
6 | assertEquals("First section name unexpected", "Test2", section1);↵ | 6 | assertEquals("First section name unexpected", "Test1", section1);↵ | |
7 | assertEquals("Second section name unexpected", "Test1", section2);↵ | 7 | assertEquals("Second section name unexpected", "Test2", section2);↵ | |
8 | Manifest.Section section = manifest.getSection("Test1");↵ | 8 | Manifest.Section section = manifest.getSection("Test1");↵ | |
9 | e = section.getAttributeKeys();↵ | 9 | e = section.getAttributeKeys();↵ | |
10 | String attr1Key = (String)e.nextElement();↵ | 10 | String attr1Key = (String)e.nextElement();↵ | |
11 | String attr2Key = (String)e.nextElement();↵ | 11 | String attr2Key = (String)e.nextElement();↵ | |
12 | String attr1 = section.getAttribute(attr1Key).getName();↵ | 12 | String attr1 = section.getAttribute(attr1Key).getName();↵ | |
13 | String attr2 = section.getAttribute(attr2Key).getName();↵ | 13 | String attr2 = section.getAttribute(attr2Key).getName();↵ | |
14 | assertEquals("First attribute name unexpected", "TestAttr2", attr1);↵ | 14 | assertEquals("First attribute name unexpected", "TestAttr1", attr1);↵ | |
15 | assertEquals("Second attribute name unexpected", "TestAttr1", attr2); | 15 | assertEquals("Second attribute name unexpected", "TestAttr2", attr2); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 125 |
Number of mapped statements | 15 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | executeTarget("testOrder2"); |
| 1 | executeTarget("testOrder1"); | ||||||||||
2 | Manifest manifest = getManifest(EXPANDED_MANIFEST); | 2 | Manifest manifest = getManifest(EXPANDED_MANIFEST); | |||||||||||
3 | Enumeration e = manifest.getSectionNames(); | 3 | Enumeration e = manifest.getSectionNames(); | |||||||||||
4 | String section1 = (String)e.nextElement(); | 4 | String section1 = (String)e.nextElement(); | |||||||||||
5 | String section2 = (String)e.nextElement(); | 5 | String section2 = (String)e.nextElement(); | |||||||||||
6 | assertEquals("First section name unexpected", "Test2", section1); |
| 6 | assertEquals("First section name unexpected", "Test1", section1); | ||||||||||
7 | assertEquals("Second section name unexpected", "Test1", section2); |
| 7 | assertEquals("Second section name unexpected", "Test2", section2); | ||||||||||
8 | Manifest.Section section = manifest.getSection("Test1"); | 8 | Manifest.Section section = manifest.getSection("Test1"); | |||||||||||
9 | e = section.getAttributeKeys(); | 9 | e = section.getAttributeKeys(); | |||||||||||
10 | String attr1Key = (String)e.nextElement(); | 10 | String attr1Key = (String)e.nextElement(); | |||||||||||
11 | String attr2Key = (String)e.nextElement(); | 11 | String attr2Key = (String)e.nextElement(); | |||||||||||
12 | String attr1 = section.getAttribute(attr1Key).getName(); | 12 | String attr1 = section.getAttribute(attr1Key).getName(); | |||||||||||
13 | String attr2 = section.getAttribute(attr2Key).getName(); | 13 | String attr2 = section.getAttribute(attr2Key).getName(); | |||||||||||
14 | assertEquals("First attribute name unexpected", "TestAttr2", attr1); |
| 14 | assertEquals("First attribute name unexpected", "TestAttr1", attr1); | ||||||||||
15 | assertEquals("Second attribute name unexpected", "TestAttr1", attr2); |
| 15 | assertEquals("Second attribute name unexpected", "TestAttr2", attr2); |
Row | Violation |
---|