result.setResponseData(readFile("testfiles/XMLSchematest.xml")); assertion.setXsdFileName("testfiles/XMLSchema-pass.xsd"); AssertionResult res = assertion.getResult(jmctx.getPreviousResult()); testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure()); testLog.debug("failure " + res.getFailureMessage()); assertFalse("Should not be an error", res.isError()); assertFalse("Should not be a failure", res.isFailure());
result.setResponseData(" ".getBytes()); AssertionResult res = assertion.getResult(result); testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure()); testLog.debug("failure message: " + res.getFailureMessage()); assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0); assertTrue("Should be an error",res.isError()); assertFalse("Should not 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/XMLSchemaAssertionTest.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/assertions/XPathAssertionTest.java
Method name: void testAssertionOK() Method name: void testAssertionBlankResult()
Number of AST nodes: 7 Number of AST nodes: 7
1
result.setResponseData(readFile("testfiles/XMLSchematest.xml"));
1
result.setResponseData(
2
		assertion.setXsdFileName("testfiles/XMLSchema-pass.xsd");
2
" ".getBytes());
3
		AssertionResult res = assertion.getResult(jmctx.getPreviousResult());
3
		AssertionResult res = assertion.getResult(result);
4
		testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());
4
		testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());
5
		testLog.debug("failure " + res.getFailureMessage());
5
		testLog.debug("failure message: " + res.getFailureMessage());
6
		assertFals
6
		assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0);
7
e("Should not be an error", res.isError());
7
		assertTrue("Should be an error",res.isError());
8
		assertFalse("Should not be a failure", res.isFailure());
8
		assertFalse("Should not 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 in different classes having the same super class
Number of node comparisons49
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    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
    result.setResponseData(readFile("testfiles/XMLSchematest.xml"));
    1
    result.setResponseData(readFile("testfiles/XMLSchematest.xml"));
    1
    result.setResponseData(" ".getBytes());
    Differences
    Expression1Expression2Difference
    readFilegetBytesMETHOD_INVOCATION_NAME_MISMATCH
    readFile("testfiles/XMLSchematest.xml")" ".getBytes()ARGUMENT_NUMBER_MISMATCH
    " "MISSING_METHOD_INVOCATION_EXPRESSION
    1
    result.setResponseData(" ".getBytes());
    2
    assertion.setXsdFileName("testfiles/XMLSchema-pass.xsd");
    2
    assertion.setXsdFileName("testfiles/XMLSchema-pass.xsd");
    6
    assertTrue("Should be an error", res.isError());
    Differences
    Expression1Expression2Difference
    setXsdFileNameassertTrueMETHOD_INVOCATION_NAME_MISMATCH
    assertion.setXsdFileName("testfiles/XMLSchema-pass.xsd")assertTrue("Should be an error",res.isError())ARGUMENT_NUMBER_MISMATCH
    assertionMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression assertTrue("Should be an error",res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertion.setXsdFileName("testfiles/XMLSchema-pass.xsd") is a void method call, and thus it cannot be parameterized
    Expression assertTrue("Should be an error",res.isError()) is a void method call, and thus it cannot be parameterized
    Expression assertTrue("Should be an error",res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertion.setXsdFileName("testfiles/XMLSchema-pass.xsd") is a void method call, and thus it cannot be parameterized
    Expression assertTrue("Should be an error",res.isError()) is a void method call, and thus it cannot be parameterized
    6
    assertTrue("Should be an error", res.isError());
    3
    AssertionResult res = assertion.getResult(jmctx.getPreviousResult());
    3
    AssertionResult res = assertion.getResult(jmctx.getPreviousResult());
    2
    AssertionResult res = assertion.getResult(result);
    Differences
    Expression1Expression2Difference
    jmctx.getPreviousResult()resultTYPE_COMPATIBLE_REPLACEMENT
    org.apache.jmeter.assertions.XMLSchemaAssertionorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression assertion cannot be unified with expression assertion , because common superclass org.apache.jmeter.testelement.AbstractTestElement does not declare member(s) public org.apache.jmeter.assertions.AssertionResult getResult(org.apache.jmeter.samplers.SampleResult)
    2
    AssertionResult res = assertion.getResult(result);
    4
    testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());
    3
    testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());
    5
    testLog.debug("failure " + res.getFailureMessage());
    5
    testLog.debug("failure " + res.getFailureMessage());
    4
    testLog.debug("failure message: " + res.getFailureMessage());
    Differences
    Expression1Expression2Difference
    "failure ""failure message: "LITERAL_VALUE_MISMATCH
    4
    testLog.debug("failure message: " + res.getFailureMessage());
    6
    assertFalse("Should not be an error", res.isError());
    6
    assertFalse("Should not be an error", res.isError());
    5
    assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0);
    Differences
    Expression1Expression2Difference
    assertFalseassertTrueMETHOD_INVOCATION_NAME_MISMATCH
    assertFalse("Should not be an error",res.isError())assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0)ARGUMENT_NUMBER_MISMATCH
    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 assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertFalse("Should not be an error",res.isError()) is a void method call, and thus it cannot be parameterized
    Expression assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0) 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 assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertFalse("Should not be an error",res.isError()) is a void method call, and thus it cannot be parameterized
    Expression assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0) is a void method call, and thus it cannot be parameterized
    5
    assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0);
    7
    assertFalse("Should not be a failure", res.isFailure());
    7
    assertFalse("Should not be a failure", res.isFailure());
    Precondition Violations (15)
    Row Violation
    1Expression assertTrue("Should be an error",res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression assertion.setXsdFileName("testfiles/XMLSchema-pass.xsd") is a void method call, and thus it cannot be parameterized
    3Expression assertTrue("Should be an error",res.isError()) is a void method call, and thus it cannot be parameterized
    4Expression assertTrue("Should be an error",res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression assertion.setXsdFileName("testfiles/XMLSchema-pass.xsd") is a void method call, and thus it cannot be parameterized
    6Expression assertTrue("Should be an error",res.isError()) is a void method call, and thus it cannot be parameterized
    7Expression assertion cannot be unified with expression assertion , because common superclass org.apache.jmeter.testelement.AbstractTestElement does not declare member(s) public org.apache.jmeter.assertions.AssertionResult getResult(org.apache.jmeter.samplers.SampleResult)
    8Expression assertFalse("Should not be an error",res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression assertFalse("Should not be an error",res.isError()) is a void method call, and thus it cannot be parameterized
    11Expression assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0) is a void method call, and thus it cannot be parameterized
    12Expression assertFalse("Should not be an error",res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression assertFalse("Should not be an error",res.isError()) is a void method call, and thus it cannot be parameterized
    15Expression assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0) is a void method call, and thus it cannot be parameterized