expectLogContaining("testWithParams", "key1=value1,key2=value2"); 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);
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);
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: void testWithParams() Method name: void testSpecialSignsInSrcPath()
Number of AST nodes: 8 Number of AST nodes: 8
1
expectLogContaining("testWithParams", "key1=value1,key2=value2");
1
executeTarget("testSpecialSignsInSrcPath");
2
        File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html");
2
        File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html");
3
        // tests one the file object
3
        // tests one the file object
4
        assertTrue("No index.html present. Not generated?", reportFile.exists() );
4
        assertTrue("No index.html present. Not generated?", reportFile.exists() );
5
        assertTrue("Cant read the report file.", reportFile.canRead() );
5
        assertTrue("Cant read the report file.", reportFile.canRead() );
6
        assertTrue("File shouldnt be empty.", reportFile.length() > 0 );
6
        assertTrue("File shouldnt be empty.", reportFile.length() > 0 );
7
        // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report
7
        // conversion to URL via FileUtils like in XMLResultAggregator, not as suggested in the bug report
8
        URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) );
8
        URL reportUrl = new URL( FileUtils.getFileUtils().toURI(reportFile.getAbsolutePath()) );
9
        InputStream reportStream = reportUrl.openStream();
9
        InputStream reportStream = reportUrl.openStream();
10
        assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0);
10
        assertTrue("This shouldnt be an empty stream.", reportStream.available() > 0);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are declared in the same class
Number of node comparisons30
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    expectLogContaining("testWithParams", "key1=value1,key2=value2");
    1
    expectLogContaining("testWithParams", "key1=value1,key2=value2");
    1
    executeTarget("testSpecialSignsInSrcPath");
    Differences
    Expression1Expression2Difference
    expectLogContainingexecuteTargetMETHOD_INVOCATION_NAME_MISMATCH
    expectLogContaining("testWithParams","key1=value1,key2=value2")executeTarget("testSpecialSignsInSrcPath")ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression expectLogContaining("testWithParams","key1=value1,key2=value2") is a void method call, and thus it cannot be parameterized
    Expression executeTarget("testSpecialSignsInSrcPath") is a void method call, and thus it cannot be parameterized
    Expression expectLogContaining("testWithParams","key1=value1,key2=value2") is a void method call, and thus it cannot be parameterized
    Expression executeTarget("testSpecialSignsInSrcPath") is a void method call, and thus it cannot be parameterized
    1
    executeTarget("testSpecialSignsInSrcPath");
    2
    File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html");
    2
    File reportFile = new File(System.getProperty("root"), "src/etc/testcases/taskdefs/optional/junitreport/test/html/index.html");
    3
    assertTrue("No index.html present. Not generated?", reportFile.exists());
    3
    assertTrue("No index.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);
    Precondition Violations (4)
    Row Violation
    1Expression expectLogContaining("testWithParams","key1=value1,key2=value2") is a void method call, and thus it cannot be parameterized
    2Expression executeTarget("testSpecialSignsInSrcPath") is a void method call, and thus it cannot be parameterized
    3Expression expectLogContaining("testWithParams","key1=value1,key2=value2") is a void method call, and thus it cannot be parameterized
    4Expression executeTarget("testSpecialSignsInSrcPath") is a void method call, and thus it cannot be parameterized