File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/ExecTaskTest.java | |||
Method name: void testRedirector5or6(String)
|
Method name: void testRedirect4()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | if (getProject().getProperty("test.can.run") == null) {↵ | 1 | if (getProject().getProperty("test.can.run") == null) {↵ | |
2 | return;↵ | 2 | return;↵ | |
3 | }↵ | 3 | }↵ | |
4 | String expectedOut = getProject().getProperty("ant.file") + " out\n";↵ | 4 | String expectedOut = getProject().getProperty("ant.file") + " out\n";↵ | |
5 | String expectedErr = getProject().getProperty("ant.file") + " err\n";↵ | 5 | String expectedErr = getProject().getProperty("ant.file") + " err\n";↵ | |
6 | assertEquals("unexpected output",↵ | 6 | assertEquals("unexpected output",↵ | |
7 | expectedOut,↵ | 7 | expectedOut,↵ | |
8 | getFileString("redirector.out"));↵ | 8 | getFileString("redirect.out"));↵ | |
9 | assertPropertyEquals("redirector.out", expectedOut.trim());↵ | 9 | assertPropertyEquals("redirect.out", expectedOut.trim());↵ | |
10 | assertEquals("unexpected error output",↵ | 10 | assertEquals("unexpected error output",↵ | |
11 | expectedErr,↵ | 11 | expectedErr,↵ | |
12 | getFileString("redirector.err"));↵ | 12 | getFileString("redirect.err"));↵ | |
13 | assertPropertyEquals("redirector.err", expectedErr.trim()); | 13 | assertPropertyEquals("redirect.err", expectedErr.trim()); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 40 |
Number of mapped statements | 8 |
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) | 14.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | if (getProject().getProperty("test.can.run") == null) | 2 | if (getProject().getProperty("test.can.run") == null) | |||||||||||
3 | return; |
| 3 | return; | ||||||||||
4 | String expectedOut = getProject().getProperty("ant.file") + " out\n"; | 4 | String expectedOut = getProject().getProperty("ant.file") + " out\n"; | |||||||||||
5 | String expectedErr = getProject().getProperty("ant.file") + " err\n"; | 5 | String expectedErr = getProject().getProperty("ant.file") + " err\n"; | |||||||||||
6 | assertEquals("unexpected output", expectedOut, getFileString("redirector.out")); |
| 6 | assertEquals("unexpected output", expectedOut, getFileString("redirect.out")); | ||||||||||
7 | assertPropertyEquals("redirector.out", expectedOut.trim()); |
| 7 | assertPropertyEquals("redirect.out", expectedOut.trim()); | ||||||||||
8 | assertEquals("unexpected error output", expectedErr, getFileString("redirector.err")); |
| 8 | assertEquals("unexpected error output", expectedErr, getFileString("redirect.err")); | ||||||||||
9 | assertPropertyEquals("redirector.err", expectedErr.trim()); |
| 9 | assertPropertyEquals("redirect.err", expectedErr.trim()); |
Row | Violation |
---|---|
1 | Conditional return; |
2 | Conditional return; |