assertion.setXsdFileName("testfiles/XMLSchema-fail.xsd"); AssertionResult res = assertion.getResult(jmctx.getPreviousResult()); testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure()); testLog.debug("failure " + res.getFailureMessage()); assertEquals(AssertionResult.RESPONSE_WAS_NULL, res.getFailureMessage()); assertFalse(res.isError()); assertTrue(res.isFailure());
result.setResponseData(" ".getBytes()); assertion.setXsdFileName("testfiles/XMLSchema-fail.xsd"); AssertionResult res = assertion.getResult(jmctx.getPreviousResult()); testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure()); testLog.debug("failure " + res.getFailureMessage()); assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0); assertTrue(res.isError()); assertFalse(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/XMLSchemaAssertionTest.java
Method name: void testAssertionNoResult() Method name: void testAssertionBlankResult()
Number of AST nodes: 7 Number of AST nodes: 8
1
result.setResponseData(" ".getBytes());
1
assertion.setXsdFileName("testfiles/XMLSchema-fail.xsd");
2
		assertion.setXsdFileName("testfiles/XMLSchema-fail.xsd");
2
		AssertionResult res = assertion.getResult(jmctx.getPreviousResult());
3
		AssertionResult res = assertion.getResult(jmctx.getPreviousResult());
3
		testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());
4
		testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());
4
		testLog.debug("failure " + res.getFailureMessage());
5
		testLog.debug("failure " + res.getFailureMessage());
5
		assertEquals(AssertionResult.RESPONSE_WAS_NULL, res.getFailureMessage());
6
		assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0);
6
		assertFalse(res.isError());
7
		assertTrue(res.isError());
7
		assertTrue(res.isFailure());
8
		assertFalse(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 comparisons56
  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 fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                        
    1
    result.setResponseData(" ".getBytes());
    1
    assertion.setXsdFileName("testfiles/XMLSchema-fail.xsd");
    2
    assertion.setXsdFileName("testfiles/XMLSchema-fail.xsd");
    2
    AssertionResult res = assertion.getResult(jmctx.getPreviousResult());
    3
    AssertionResult res = assertion.getResult(jmctx.getPreviousResult());
    3
    testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());
    4
    testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());
    4
    testLog.debug("failure " + res.getFailureMessage());
    5
    testLog.debug("failure " + res.getFailureMessage());
    5
    assertEquals(AssertionResult.RESPONSE_WAS_NULL, res.getFailureMessage());
    5
    assertEquals(AssertionResult.RESPONSE_WAS_NULL, res.getFailureMessage());
    6
    assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0);
    Differences
    Expression1Expression2Difference
    assertEqualsassertTrueMETHOD_INVOCATION_NAME_MISMATCH
    assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage())assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) 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 assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) 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 assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) 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 assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) 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
    6
    assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0);
    6
    assertFalse(res.isError());
    6
    assertFalse(res.isError());
    7
    assertTrue(res.isError());
    Differences
    Expression1Expression2Difference
    assertFalseassertTrueMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression assertFalse(res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertTrue(res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertFalse(res.isError()) is a void method call, and thus it cannot be parameterized
    Expression assertTrue(res.isError()) is a void method call, and thus it cannot be parameterized
    7
    assertTrue(res.isError());
    7
    assertTrue(res.isFailure());
    7
    assertTrue(res.isFailure());
    8
    assertFalse(res.isFailure());
    Differences
    Expression1Expression2Difference
    assertTrueassertFalseMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression assertTrue(res.isFailure()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertFalse(res.isFailure()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertTrue(res.isFailure()) is a void method call, and thus it cannot be parameterized
    Expression assertFalse(res.isFailure()) is a void method call, and thus it cannot be parameterized
    8
    assertFalse(res.isFailure());
    Precondition Violations (16)
    Row Violation
    1Expression assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) is a void method call, and thus it cannot be parameterized
    4Expression assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0) is a void method call, and thus it cannot be parameterized
    5Expression assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) is a void method call, and thus it cannot be parameterized
    8Expression assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0) is a void method call, and thus it cannot be parameterized
    9Expression assertFalse(res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression assertTrue(res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression assertFalse(res.isError()) is a void method call, and thus it cannot be parameterized
    12Expression assertTrue(res.isError()) is a void method call, and thus it cannot be parameterized
    13Expression assertTrue(res.isFailure()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression assertFalse(res.isFailure()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression assertTrue(res.isFailure()) is a void method call, and thus it cannot be parameterized
    16Expression assertFalse(res.isFailure()) is a void method call, and thus it cannot be parameterized