result.setResponseData(readFile("testfiles/XMLSchematest.xml")); assertion.setXsdFileName("xtestfiles/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("Failed to read schema document") > 0); assertTrue(res.isError());// TODO - should this be a failure? assertFalse(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 testAssertionBadXSDFile() Method name: void testAssertionBlankResult()
Number of AST nodes: 8 Number of AST nodes: 8
1
result.setResponseData(readFile("testfiles/XMLSchematest.xml"));
1
result.setResponseData(" ".getBytes());
2
		assertion.setXsdFileName("xtestfiles/XMLSchema-fail.xsd");
2
		assertion.setXsdFileName("testfiles/XMLSchema-fail.xsd");
3
		AssertionResult res = assertion.getResult(jmctx.getPreviousResult());
3
		AssertionResult res = assertion.getResult(jmctx.getPreviousResult());
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 " + res.getFailureMessage());
6
		assertTrue(res.getFailureMessage().indexOf("Failed to read schema document") > 0);
6
		assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0);
7
		assertTrue(res.isError());// TODO - should this be a failure?
7
		assertTrue(res.isError());
8
		assertFalse(res.isFailure());
8
		assertFalse(res.isFailure());
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are declared in the same class
Number of node comparisons64
  1. {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
    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("xtestfiles/XMLSchema-fail.xsd");
    2
    assertion.setXsdFileName("xtestfiles/XMLSchema-fail.xsd");
    2
    assertion.setXsdFileName("testfiles/XMLSchema-fail.xsd");
    Differences
    Expression1Expression2Difference
    "xtestfiles/XMLSchema-fail.xsd""testfiles/XMLSchema-fail.xsd"LITERAL_VALUE_MISMATCH
    2
    assertion.setXsdFileName("testfiles/XMLSchema-fail.xsd");
    3
    AssertionResult res = assertion.getResult(jmctx.getPreviousResult());
    3
    AssertionResult res = assertion.getResult(jmctx.getPreviousResult());
    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 " + res.getFailureMessage());
    6
    assertTrue(res.getFailureMessage().indexOf("Failed to read schema document") > 0);
    6
    assertTrue(res.getFailureMessage().indexOf("Failed to read schema document") > 0);
    6
    assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0);
    Differences
    Expression1Expression2Difference
    "Failed to read schema document""Premature end of file"LITERAL_VALUE_MISMATCH
    6
    assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0);
    7
    assertTrue(res.isError());
    7
    assertTrue(res.isError());
    8
    assertFalse(res.isFailure());
    8
    assertFalse(res.isFailure());
    Precondition Violations (0)
    Row Violation