void testSpecialSignsInSrcPath() throws Exception { executeTarget("testSpecialSignsInSrcPath"); File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html"); // tests one the file object assertTrue("No index.html present. Not generated?", reportFile.exists() ); assertTrue("Cant read the report file.", reportFile.canRead() ); assertTrue("File shouldnt be empty.", reportFile.length() > 0 ); // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) ); InputStream reportStream = reportUrl.openStream(); assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0); } public void testSpecialSignsInHtmlPath() throws Exception { executeTarget("testSpecialSignsInHtmlPath"); File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html# $%\u00A7&-!report/index.html"); // tests one the file object assertTrue("No index.html present. Not generated?", reportFile.exists() ); assertTrue("Cant read the report file.", reportFile.canRead() ); assertTrue("File shouldnt be empty.", reportFile.length() > 0 ); // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) ); InputStream reportStream = reportUrl.openStream(); assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0); } //Bugzilla Report 39708 public void testWithStyleFromDir() throws Exception { executeTarget("testWithStyleFromDir"); File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html"); // tests one the file object assertTrue("No index.html present. Not generated?", reportFile.exists() ); assertTrue("Cant read the report file.", reportFile.canRead() ); assertTrue("File shouldnt be empty.", reportFile.length() > 0 ); // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) ); InputStream reportStream = reportUrl.openStream(); assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0); } //Bugzilla Report 40021 public void testNoFrames() throws Exception { executeTarget("testNoFrames"); File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/junit-noframes.html"); // tests one the file object assertTrue("No junit-noframes.html present. Not generated?", reportFile.exists() ); assertTrue("Cant read the report file.", reportFile.canRead() ); assertTrue("File shouldnt be empty.", reportFile.length() > 0 ); // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) ); InputStream reportStream = reportUrl.openStream(); assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0); } //Bugzilla Report 39708 public void testWithStyleFromDirAndXslImport() throws Exception { executeTarget("testWithStyleFromDirAndXslImport"); File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html"); // tests one the file object assertTrue("No index.html present. Not generated?", reportFile.exists() ); assertTrue("Cant read the report file.", reportFile.canRead() ); assertTrue("File shouldnt be empty.", reportFile.length() > 0 ); // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) ); InputStream reportStream = reportUrl.openStream(); assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0);
void testSpecialSignsInHtmlPath() throws Exception { executeTarget("testSpecialSignsInHtmlPath"); File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html# $%\u00A7&-!report/index.html"); // tests one the file object assertTrue("No index.html present. Not generated?", reportFile.exists() ); assertTrue("Cant read the report file.", reportFile.canRead() ); assertTrue("File shouldnt be empty.", reportFile.length() > 0 ); // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) ); InputStream reportStream = reportUrl.openStream(); assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0); } //Bugzilla Report 39708 public void testWithStyleFromDir() throws Exception { executeTarget("testWithStyleFromDir"); File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html"); // tests one the file object assertTrue("No index.html present. Not generated?", reportFile.exists() ); assertTrue("Cant read the report file.", reportFile.canRead() ); assertTrue("File shouldnt be empty.", reportFile.length() > 0 ); // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) ); InputStream reportStream = reportUrl.openStream(); assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0); } //Bugzilla Report 40021 public void testNoFrames() throws Exception { executeTarget("testNoFrames"); File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/junit-noframes.html"); // tests one the file object assertTrue("No junit-noframes.html present. Not generated?", reportFile.exists() ); assertTrue("Cant read the report file.", reportFile.canRead() ); assertTrue("File shouldnt be empty.", reportFile.length() > 0 ); // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) ); InputStream reportStream = reportUrl.openStream(); assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0); } //Bugzilla Report 39708 public void testWithStyleFromDirAndXslImport() throws Exception { executeTarget("testWithStyleFromDirAndXslImport"); File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html"); // tests one the file object assertTrue("No index.html present. Not generated?", reportFile.exists() ); assertTrue("Cant read the report file.", reportFile.canRead() ); assertTrue("File shouldnt be empty.", reportFile.length() > 0 ); // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) ); InputStream reportStream = reportUrl.openStream(); assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0); } public void testWithStyleFromClasspath() throws Exception { executeTarget("testWithStyleFromClasspath"); File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html"); // tests one the file object assertTrue("No index.html present. Not generated?", reportFile.exists() ); assertTrue("Cant read the report file.", reportFile.canRead() ); assertTrue("File shouldnt be empty.", reportFile.length() > 0 ); // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) ); InputStream reportStream = reportUrl.openStream(); assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0);
Clone fragments detected by clone detection tool
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: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
void testSpecialSignsInSrcPath() throws Exception {
2
        executeTarget("testSpecialSignsInSrcPath");
3
        File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html");
4
        // tests one the file object
5
        assertTrue("No index.html present. Not generated?", reportFile.exists() );
6
        assertTrue("Cant read the report file.", reportFile.canRead() );
7
        assertTrue("File shouldnt be empty.", reportFile.length() > 0 );
8
        // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report
9
        URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) );
10
        InputStream reportStream = reportUrl.openStream();
11
        assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0);
12
    }
13
    public void testSpecialSignsInHtmlPath() throws Exception {
1
void testSpecialSignsInHtmlPath() throws Exception {
14
        executeTarget("testSpecialSignsInHtmlPath");
2
        executeTarget("testSpecialSignsInHtmlPath");
15
        File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html# $%\u00A7&-!report/index.html");
3
        File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html# $%\u00A7&-!report/index.html");
16
        // tests one the file object
4
        // tests one the file object
17
        assertTrue("No index.html present. Not generated?", reportFile.exists() );
5
        assertTrue("No index.html present. Not generated?", reportFile.exists() );
18
        assertTrue("Cant read the report file.", reportFile.canRead() );
6
        assertTrue("Cant read the report file.", reportFile.canRead() );
19
        assertTrue("File shouldnt be empty.", reportFile.length() > 0 );
7
        assertTrue("File shouldnt be empty.", reportFile.length() > 0 );
20
        // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report
8
        // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report
21
        URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) );
9
        URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) );
22
        InputStream reportStream = reportUrl.openStream();
10
        InputStream reportStream = reportUrl.openStream();
23
        assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0);
11
        assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0);
24
    }
12
    }
25
    //Bugzilla Report 39708
13
    //Bugzilla Report 39708
26
    public void testWithStyleFromDir() throws Exception {
14
    public void testWithStyleFromDir() throws Exception {
27
        executeTarget("testWithStyleFromDir");
15
        executeTarget("testWithStyleFromDir");
28
        File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html");
16
        File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html");
29
        // tests one the file object
17
        // tests one the file object
30
        assertTrue("No index.html present. Not generated?", reportFile.exists() );
18
        assertTrue("No index.html present. Not generated?", reportFile.exists() );
31
        assertTrue("Cant read the report file.", reportFile.canRead() );
19
        assertTrue("Cant read the report file.", reportFile.canRead() );
32
        assertTrue("File shouldnt be empty.", reportFile.length() > 0 );
20
        assertTrue("File shouldnt be empty.", reportFile.length() > 0 );
33
        // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report
21
        // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report
34
        URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) );
22
        URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) );
35
        InputStream reportStream = reportUrl.openStream();
23
        InputStream reportStream = reportUrl.openStream();
36
        assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0);
24
        assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0);
37
    }
25
    }
38
    //Bugzilla Report 40021
26
    //Bugzilla Report 40021
39
    public void testNoFrames() throws Exception {
27
    public void testNoFrames() throws Exception {
40
        executeTarget("testNoFrames");
28
        executeTarget("testNoFrames");
41
        File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/junit-noframes.html");
29
        File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/junit-noframes.html");
42
        // tests one the file object
30
        // tests one the file object
43
        assertTrue("No junit-noframes.html present. Not generated?", reportFile.exists() );
31
        assertTrue("No junit-noframes.html present. Not generated?", reportFile.exists() );
44
        assertTrue("Cant read the report file.", reportFile.canRead() );
32
        assertTrue("Cant read the report file.", reportFile.canRead() );
45
        assertTrue("File shouldnt be empty.", reportFile.length() > 0 );
33
        assertTrue("File shouldnt be empty.", reportFile.length() > 0 );
46
        // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report
34
        // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report
47
        URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) );
35
        URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) );
48
        InputStream reportStream = reportUrl.openStream();
36
        InputStream reportStream = reportUrl.openStream();
49
        assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0);
37
        assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0);
50
    }
38
    }
51
    //Bugzilla Report 39708
39
    //Bugzilla Report 39708
52
    public void testWithStyleFromDirAndXslImport() throws Exception {
40
    public void testWithStyleFromDirAndXslImport() throws Exception {
53
        executeTarget("testWithStyleFromDirAndXslImport");
41
        executeTarget("testWithStyleFromDirAndXslImport");
54
        File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html");
42
        File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html");
55
        // tests one the file object
43
        // tests one the file object
56
        assertTrue("No index.html present. Not generated?", reportFile.exists() );
44
        assertTrue("No index.html present. Not generated?", reportFile.exists() );
57
        assertTrue("Cant read the report file.", reportFile.canRead() );
45
        assertTrue("Cant read the report file.", reportFile.canRead() );
58
        assertTrue("File shouldnt be empty.", reportFile.length() > 0 );
46
        assertTrue("File shouldnt be empty.", reportFile.length() > 0 );
59
        // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report
47
        // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report
60
        URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) );
48
        URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) );
61
        InputStream reportStream = reportUrl.openStream();
49
        InputStream reportStream = reportUrl.openStream();
62
        assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0);
50
        assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0);
63
    
51
    }
52
    public void testWithStyleFromClasspath() throws Exception {
53
        executeTarget("testWithStyleFromClasspath");
54
        File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html");
55
        // tests one the file object
56
        assertTrue("No index.html present. Not generated?", reportFile.exists() );
57
        assertTrue("Cant read the report file.", reportFile.canRead() );
58
        assertTrue("File shouldnt be empty.", reportFile.length() > 0 );
59
        // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report
60
        URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) );
61
        InputStream reportStream = reportUrl.openStream();
62
        assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0);
63
    
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