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()); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 122 |
Number of mapped statements | 12 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
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(false); | ||||||||||||||
8 | assertion.setTolerant(true); |
| 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()); |
| 11 | assertTrue(res.isError()); |
Row | Violation |
---|---|
1 | Expression assertFalse(res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression assertTrue(res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression assertFalse(res.isError()) is a void method call, and thus it cannot be parameterized |
4 | Expression assertTrue(res.isError()) is a void method call, and thus it cannot be parameterized |