assertion.setXPathString("//*[code=1]"); AssertionResult res = assertion.getResult(result); testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure()); testLog.debug("failure message: " + res.getFailureMessage()); assertFalse("Should not be an error", res.isError()); assertFalse("Should not be a failure",res.isFailure());
assertion.setXPathString("count(//error)");// not yet handled AssertionResult res = assertion.getResult(result); testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure()); testLog.debug("failure message: " + res.getFailureMessage()); assertFalse("Should not be an error", res.isError()); assertTrue("Should be a failure",res.isFailure());
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/assertions/XPathAssertionTest.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/assertions/XPathAssertionTest.java
Method name: void testAssertionPath1() Method name: void testAssertionNumber()
Number of AST nodes: 6 Number of AST nodes: 6
1
assertion.setXPathString("//*[code=1]");
1
assertion.setXPathString("count(//error)");// not yet handled
2
		AssertionResult res = assertion.getResult(result);
2
		AssertionResult res = assertion.getResult(result);
3
		testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());
3
		testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());
4
		testLog.debug("failure message: " + res.getFailureMessage());
4
		testLog.debug("failure message: " + res.getFailureMessage());
5
		assertFalse("Should not be an error", res.isError());
5
		assertFalse("Should not be an error", res.isError());
6
		assertFalse("Should not be a failure",res.isFailure());
6
		assertTrue("Should be a failure",res.isFailure());
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 comparisons36
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    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
    assertion.setXPathString("//*[code=1]");
    1
    assertion.setXPathString("//*[code=1]");
    1
    assertion.setXPathString("count(//error)");
    Differences
    Expression1Expression2Difference
    "//*[code=1]""count(//error)"LITERAL_VALUE_MISMATCH
    1
    assertion.setXPathString("count(//error)");
    2
    AssertionResult res = assertion.getResult(result);
    2
    AssertionResult res = assertion.getResult(result);
    3
    testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());
    3
    testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());
    4
    testLog.debug("failure message: " + res.getFailureMessage());
    4
    testLog.debug("failure message: " + res.getFailureMessage());
    5
    assertFalse("Should not be an error", res.isError());
    5
    assertFalse("Should not be an error", res.isError());
    6
    assertFalse("Should not be a failure", res.isFailure());
    6
    assertFalse("Should not be a failure", res.isFailure());
    6
    assertTrue("Should be a failure", res.isFailure());
    Differences
    Expression1Expression2Difference
    assertFalseassertTrueMETHOD_INVOCATION_NAME_MISMATCH
    "Should not be a failure""Should be a failure"LITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression assertFalse("Should not be a failure",res.isFailure()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertTrue("Should be a failure",res.isFailure()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertFalse("Should not be a failure",res.isFailure()) is a void method call, and thus it cannot be parameterized
    Expression assertTrue("Should be a failure",res.isFailure()) is a void method call, and thus it cannot be parameterized
    6
    assertTrue("Should be a failure", res.isFailure());
    Precondition Violations (4)
    Row Violation
    1Expression assertFalse("Should not be a failure",res.isFailure()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression assertTrue("Should be a failure",res.isFailure()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression assertFalse("Should not be a failure",res.isFailure()) is a void method call, and thus it cannot be parameterized
    4Expression assertTrue("Should be a failure",res.isFailure()) is a void method call, and thus it cannot be parameterized