String data = "<html><head><title>testtitle</title></head>" + "<body>" + "<p><i><b>invalid tag nesting</i></b><hr>" + "</body></html>"; result.setResponseData(data.getBytes()); vars = new JMeterVariables(); jmctx.setVariables(vars); jmctx.setPreviousResult(result); assertion.setXPathString("/html/head/title"); assertion.setValidating(true); assertion.setTolerant(true); AssertionResult res = assertion.getResult(result); log.debug("failureMessage: " + res.getFailureMessage()); assertFalse(res.isFailure()); assertFalse(res.isError());
String data = "<html><head><title>testtitle</title></head>" + "<body>" + "<p><i><b>invalid tag nesting</i></b><hr>" + "</body></html>"; result.setResponseData(data.getBytes()); vars = new JMeterVariables(); jmctx.setVariables(vars); jmctx.setPreviousResult(result); assertion.setXPathString("/html/head/title"); assertion.setValidating(false); assertion.setTolerant(false); AssertionResult res = assertion.getResult(result); log.debug("failureMessage: " + res.getFailureMessage()); 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/PackageTest.java File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/assertions/PackageTest.java
Method name: void testTolerance() Method name: void testNoTolerance()
Number of AST nodes: 12 Number of AST nodes: 12
1
String data = "<html><head><title>testtitle</title></head>" + "<body>"
1
String data = "<html><head><title>testtitle</title></head>" + "<body>"
2
					+ "<p><i><b>invalid tag nesting</i></b><hr>" + "</body></html>";
2
					+ "<p><i><b>invalid tag nesting</i></b><hr>" + "</body></html>";
3
			result.setResponseData(data.getBytes());
3
			result.setResponseData(data.getBytes());
4
			vars = new JMeterVariables();
4
			vars = new JMeterVariables();
5
			jmctx.setVariables(vars);
5
			jmctx.setVariables(vars);
6
			jmctx.setPreviousResult(result);
6
			jmctx.setPreviousResult(result);
7
			assertion.setXPathString("/html/head/title");
7
			assertion.setXPathString("/html/head/title");
8
			assertion.setValidating(true);
8
			assertion.setValidating(false);
9
			assertion.setTolerant(true);
9
			assertion.setTolerant(false);
10
			AssertionResult res = assertion.getResult(result);
10
			AssertionResult res = assertion.getResult(result);
11
			log.debug("failureMessage: " + res.getFailureMessage());
11
			log.debug("failureMessage: " + res.getFailureMessage());
12
			assertFalse(res.isFailure());
12
			assertTrue(res.isError());
13
			assertFalse(res.isError());
13
			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 comparisons122
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    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
    String data = "<html><head><title>testtitle</title></head>" + "<body>" + "<p><i><b>invalid tag nesting</i></b><hr>" + "</body></html>";
    1
    String data = "<html><head><title>testtitle</title></head>" + "<body>" + "<p><i><b>invalid tag nesting</i></b><hr>" + "</body></html>";
    2
    result.setResponseData(data.getBytes());
    2
    result.setResponseData(data.getBytes());
    3
    vars = new JMeterVariables();
    3
    vars = new JMeterVariables();
    4
    jmctx.setVariables(vars);
    4
    jmctx.setVariables(vars);
    5
    jmctx.setPreviousResult(result);
    5
    jmctx.setPreviousResult(result);
    6
    assertion.setXPathString("/html/head/title");
    6
    assertion.setXPathString("/html/head/title");
    7
    assertion.setValidating(true);
    7
    assertion.setValidating(true);
    7
    assertion.setValidating(false);
    Differences
    Expression1Expression2Difference
    truefalseLITERAL_VALUE_MISMATCH
    7
    assertion.setValidating(false);
    8
    assertion.setTolerant(true);
    8
    assertion.setTolerant(true);
    8
    assertion.setTolerant(false);
    Differences
    Expression1Expression2Difference
    truefalseLITERAL_VALUE_MISMATCH
    8
    assertion.setTolerant(false);
    9
    AssertionResult res = assertion.getResult(result);
    9
    AssertionResult res = assertion.getResult(result);
    10
    log.debug("failureMessage: " + res.getFailureMessage());
    10
    log.debug("failureMessage: " + res.getFailureMessage());
    11
    assertFalse(res.isFailure());
    12
    assertFalse(res.isFailure());
    12
    assertFalse(res.isError());
    12
    assertFalse(res.isError());
    11
    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
    11
    assertTrue(res.isError());
    Precondition Violations (4)
    Row Violation
    1Expression assertFalse(res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression assertTrue(res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression assertFalse(res.isError()) is a void method call, and thus it cannot be parameterized
    4Expression assertTrue(res.isError()) is a void method call, and thus it cannot be parameterized