File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitReportTest.java | |||
Method name: void testSpecialSignsInHtmlPath()
|
Method name: void testNoFrames()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html# $%\u00A7&-!report/index.html");↵ | 1 | File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/junit-noframes.html");↵ | |
2 | // tests one the file object↵ | 2 | // tests one the file object↵ | |
3 | assertTrue("No index.html present. Not generated?", reportFile.exists() );↵ | 3 | assertTrue("No junit-noframes.html present. Not generated?", reportFile.exists() );↵ | |
4 | assertTrue("Cant read the report file.", reportFile.canRead() );↵ | 4 | assertTrue("Cant read the report file.", reportFile.canRead() );↵ | |
5 | assertTrue("File shouldnt be empty.", reportFile.length() > 0 );↵ | 5 | assertTrue("File shouldnt be empty.", reportFile.length() > 0 );↵ | |
6 | // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report↵ | 6 | // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report↵ | |
7 | URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) );↵ | 7 | URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) );↵ | |
8 | InputStream reportStream = reportUrl.openStream();↵ | 8 | InputStream reportStream = reportUrl.openStream();↵ | |
9 | assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0); | 9 |
| |
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 | 25 |
Number of mapped statements | 7 |
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html# $%\u00A7&-!report/index.html"); |
| 2 | File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/junit-noframes.html"); | ||||||||||
3 | assertTrue("No index.html present. Not generated?", reportFile.exists()); |
| 3 | assertTrue("No junit-noframes.html present. Not generated?", reportFile.exists()); | ||||||||||
4 | assertTrue("Cant read the report file.", reportFile.canRead()); | 4 | assertTrue("Cant read the report file.", reportFile.canRead()); | |||||||||||
5 | assertTrue("File shouldnt be empty.", reportFile.length() > 0); | 5 | assertTrue("File shouldnt be empty.", reportFile.length() > 0); | |||||||||||
6 | URL reportUrl = new URL(FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath())); | 6 | URL reportUrl = new URL(FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath())); | |||||||||||
7 | InputStream reportStream = reportUrl.openStream(); | 7 | InputStream reportStream = reportUrl.openStream(); | |||||||||||
8 | assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0); | 8 | assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0); |
Row | Violation |
---|