File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java | |||
Method name: void _testScenario2()
|
Method name: void testScenario1()
|
|||
Number of AST nodes: 11 | Number of AST nodes: 12 | |||
1 | results = selectionString(s);↵ | |||
2 | //↵ | |||
3 | // ***** Check the result *****↵ | |||
4 | //↵ | |||
5 | // Mark all files which should be selected as (T)rue and all others↵ | |||
6 | // as (F)alse. Directories are always selected so they always are↵ | |||
7 | // (T)rue.↵ | |||
1 | StringBuffer expected = new StringBuffer();↵ | 8 | StringBuffer expected = new StringBuffer();↵ | |
2 | for (int i=0; i<filenames.length; i++) {↵ | 9 | for (int i=0; i<filenames.length; i++) {↵ | |
3 | String ch = "F";↵ | 10 | String ch = "F";↵ | |
4 | if (files[i].isDirectory()) ch = "T";↵ | 11 | if (files[i].isDirectory()) ch = "T";↵ | |
12 | // f2name shouldn't be selected: only timestamp has changed!↵ | |||
5 | if (filenames[i].equalsIgnoreCase(f3name)) ch = "T";↵ | 13 | if (filenames[i].equalsIgnoreCase(f3name)) ch = "T";↵ | |
6 | if (filenames[i].equalsIgnoreCase(f4name)) ch = "T";↵ | 14 | if (filenames[i].equalsIgnoreCase(f4name)) ch = "T";↵ | |
7 | expected.append(ch);↵ | 15 | expected.append(ch);↵ | |
8 | }↵ | 16 | }↵ | |
9 | assertEquals(↵ | 17 | assertEquals(↵ | |
10 | "Wrong files selected. Differing files: " // info text↵ | 18 | "Wrong files selected. Differing files: " // info text↵ | |
11 | + resolve(diff(expected.toString(), results)), // list of files↵ | 19 | + resolve(diff(expected.toString(), results)), // list of files↵ | |
12 | expected.toString(), // expected result↵ | 20 | expected.toString(), // expected result↵ | |
13 | results // result↵ | 21 | results // result↵ | |
14 | ); | 22 |
| |
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) | 1.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 35 |
Number of mapped statements | 11 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 11.2 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
| 17 | results = selectionString(s); | ||
23 | StringBuffer expected = new StringBuffer(); | 18 | StringBuffer expected = new StringBuffer(); | |
24 | for (int i = 0; i < filenames.length; i++) | 19 | for (int i = 0; i < filenames.length; i++) | |
25 | String ch = "F"; | 20 | String ch = "F"; | |
26 | if (files[i].isDirectory()) | 21 | if (files[i].isDirectory()) | |
27 | ch = "T"; | 22 | ch = "T"; | |
28 | if (filenames[i].equalsIgnoreCase(f3name)) | 23 | if (filenames[i].equalsIgnoreCase(f3name)) | |
29 | ch = "T"; | 24 | ch = "T"; | |
30 | if (filenames[i].equalsIgnoreCase(f4name)) | 25 | if (filenames[i].equalsIgnoreCase(f4name)) | |
31 | ch = "T"; | 26 | ch = "T"; | |
32 | expected.append(ch); | 27 | expected.append(ch); | |
33 | assertEquals("Wrong files selected. Differing files: " + resolve(diff(expected.toString(), results)), expected.toString(), results); | 28 | assertEquals("Wrong files selected. Differing files: " + resolve(diff(expected.toString(), results)), expected.toString(), results); |
Row | Violation |
---|