public void testTolerance() throws Exception { 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());
public void testNoTolerance() throws Exception { 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: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public void testTolerance() throws Exception {
1
public void testNoTolerance() throws Exception {
2
			String data = "<html><head><title>testtitle</title></head>" + "<body>"
2
			String data = "<html><head><title>testtitle</title></head>" + "<body>"
3
					+ "<p><i><b>invalid tag nesting</i></b><hr>" + "</body></html>";
3
					+ "<p><i><b>invalid tag nesting</i></b><hr>" + "</body></html>";
4
			result.setResponseData(data.getBytes());
4
			result.setResponseData(data.getBytes());
5
			vars = new JMeterVariables();
5
			vars = new JMeterVariables();
6
			jmctx.setVariables(vars);
6
			jmctx.setVariables(vars);
7
			jmctx.setPreviousResult(result);
7
			jmctx.setPreviousResult(result);
8
			assertion.setXPathString("/html/head/title");
8
			assertion.setXPathString("/html/head/title");
9
			assertion.setValidating(true);
9
			assertion.setValidating(false);
10
			assertion.setTolerant(true);
10
			assertion.setTolerant(false);
11
			AssertionResult res = assertion.getResult(result);
11
			AssertionResult res = assertion.getResult(result);
12
			log.debug("failureMessage: " + res.getFailureMessage());
12
			log.debug("failureMessage: " + res.getFailureMessage());
13
			assertFalse(res.isFailure());
13
			assertTrue(res.isError());
14
			assertFalse(res.isError());
14
			assertFalse(res.isFailure());
15
		
15
		
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0