result.setResponseData("".getBytes()); AssertionResult res = assertion.getResult(result); testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure()); testLog.debug("failure message: " + res.getFailureMessage()); assertEquals(AssertionResult.RESPONSE_WAS_NULL, res.getFailureMessage()); assertFalse("Should not be an error", res.isError()); assertTrue("Should be a failure",res.isFailure());
result = new SampleResult(); AssertionResult res = assertion.getResult(result); testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure()); testLog.debug("failure message: " + res.getFailureMessage()); assertEquals(AssertionResult.RESPONSE_WAS_NULL, 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 testAssertionEmptyResult() Method name: void testAssertionNoResult()
Number of AST nodes: 7 Number of AST nodes: 7
1
result.setResponseData("".getBytes());
1
result = new SampleResult();
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
		assertEquals(AssertionResult.RESPONSE_WAS_NULL, res.getFailureMessage());
5
		assertEquals(AssertionResult.RESPONSE_WAS_NULL, res.getFailureMessage());
6
		assertFalse("Should not be an error", res.isError());
6
		assertFalse("Should not be an error", res.isError());
7
		assertTrue("Should be a failure",res.isFailure());
7
		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 comparisons49
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                              
    1
    result = new SampleResult();
    1
    result.setResponseData("".getBytes());
    1
    result.setResponseData("".getBytes());
    6
    assertFalse("Should not be an error", res.isError());
    Differences
    Expression1Expression2Difference
    setResponseDataassertFalseMETHOD_INVOCATION_NAME_MISMATCH
    result.setResponseData("".getBytes())assertFalse("Should not be an error",res.isError())ARGUMENT_NUMBER_MISMATCH
    resultMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression assertFalse("Should not be an error",res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression result.setResponseData("".getBytes()) is a void method call, and thus it cannot be parameterized
    Expression assertFalse("Should not be an error",res.isError()) is a void method call, and thus it cannot be parameterized
    Expression assertFalse("Should not be an error",res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression result.setResponseData("".getBytes()) is a void method call, and thus it cannot be parameterized
    Expression assertFalse("Should not be an error",res.isError()) is a void method call, and thus it cannot be parameterized
    6
    assertFalse("Should not be an error", res.isError());
    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
    assertEquals(AssertionResult.RESPONSE_WAS_NULL, res.getFailureMessage());
    5
    assertEquals(AssertionResult.RESPONSE_WAS_NULL, res.getFailureMessage());
    6
    assertFalse("Should not be an error", res.isError());
                                                                                                                  
    7
    assertTrue("Should be a failure", res.isFailure());
    7
    assertTrue("Should be a failure", res.isFailure());
    Precondition Violations (7)
    Row Violation
    1Expression assertFalse("Should not be an error",res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression result.setResponseData("".getBytes()) is a void method call, and thus it cannot be parameterized
    3Expression assertFalse("Should not be an error",res.isError()) is a void method call, and thus it cannot be parameterized
    4Expression assertFalse("Should not be an error",res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression result.setResponseData("".getBytes()) is a void method call, and thus it cannot be parameterized
    6Expression assertFalse("Should not be an error",res.isError()) is a void method call, and thus it cannot be parameterized
    7Clone fragment #1 returns variables res , while Clone fragment #2 returns variables