jmctx = JMeterContextService.getContext(); assertion = new SizeAssertion(); assertion.setThreadContext(jmctx); vars = new JMeterVariables(); jmctx.setVariables(vars); sample0 = new SampleResult(); sample1 = new SampleResult(); sample1.setResponseData(data1.getBytes());
super.setUp(); jmctx = JMeterContextService.getContext(); assertion = new XPathAssertion(); assertion.setThreadContext(jmctx);// This would be done by the run // command result = new SampleResult(); result.setResponseData(readFile("testfiles/XPathAssertionTest.xml")); vars = new JMeterVariables(); jmctx.setVariables(vars);
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/XPathAssertionTest.java
Method name: void setUp() Method name: void setUp()
Number of AST nodes: 8 Number of AST nodes: 8
1
super.setUp();
1
jmctx = JMeterContextService.getContext();
2
		jmctx = JMeterContextService.getContext();
2
			assertion = new SizeAssertion();
3
		assertion = new XPathAssertion();
3
			assertion.setThreadContext(jmctx);
4
		assertion.setThreadContext(jmctx);
4
			vars = new JMeterVariables();
5
			jmctx.setVariables(vars);
6
			sample0 = new SampleResult();
7
			sample1 = new SampleResult(
5
// This would be done by the run
6
											// command
7
		result = new SampleResult();
8
);
8
		result.setResponseData(readFile("testfiles/XPathAssertionTest.xml"));
9
			sample1.setResponseData(data1.getBytes()
9
		vars = new JMeterVariables();
10
);
10
		jmctx.setVariables(vars);
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 comparisons26
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    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
    jmctx = JMeterContextService.getContext();
    2
    jmctx = JMeterContextService.getContext();
    2
    assertion = new SizeAssertion();
    2
    assertion = new SizeAssertion();
    3
    assertion = new XPathAssertion();
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.assertions.SizeAssertionorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    org.apache.jmeter.assertions.SizeAssertionorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    3
    assertion = new XPathAssertion();
    3
    assertion.setThreadContext(jmctx);
    3
    assertion.setThreadContext(jmctx);
    4
    assertion.setThreadContext(jmctx);
    Differences
    Expression1Expression2Difference
    org.apache.jmeter.assertions.SizeAssertionorg.apache.jmeter.assertions.XPathAssertionSUBCLASS_TYPE_MISMATCH
    4
    assertion.setThreadContext(jmctx);
                                                                                                                                                    
    6
    result.setResponseData(readFile("testfiles/XPathAssertionTest.xml"));
    4
    vars = new JMeterVariables();
    7
    vars = new JMeterVariables();
    5
    jmctx.setVariables(vars);
    8
    jmctx.setVariables(vars);
    6
    sample0 = new SampleResult();
    6
    sample0 = new SampleResult();
    5
    result = new SampleResult();
    Differences
    Expression1Expression2Difference
    sample0resultVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression sample0 is a field being modified, and thus it cannot be parameterized
    Expression result is a field being modified, and thus it cannot be parameterized
    5
    result = new SampleResult();
    7
    sample1 = new SampleResult();
                                                                
    8
    sample1.setResponseData(data1.getBytes());
    8
    sample1.setResponseData(data1.getBytes());
    1
    super.setUp();
    Differences
    Expression1Expression2Difference
    sample1.setResponseData(data1.getBytes())super.setUp()TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression sample1.setResponseData(data1.getBytes()) is a void method call, and thus it cannot be parameterized
    Expression super.setUp() is a void method call, and thus it cannot be parameterized
    1
    super.setUp();
    Precondition Violations (4)
    Row Violation
    1Expression sample0 is a field being modified, and thus it cannot be parameterized
    2Expression result is a field being modified, and thus it cannot be parameterized
    3Expression sample1.setResponseData(data1.getBytes()) is a void method call, and thus it cannot be parameterized
    4Expression super.setUp() is a void method call, and thus it cannot be parameterized