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 testNegateAssertion()
|
Method name: void testValidationFailure()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | assertion.setXPathString("//row/value[@field = 'noalias']");↵ | 1 | assertion.setXPathString("//row/value[@field = 'alias']");↵ | |
2 | assertion.setNegated(↵ | 2 | assertion.setNegated(false);↵ | |
3 | true);↵ | 3 | assertion.setValidating(true);↵ | |
4 | AssertionResult res = assertion.getResult(jmctx.getPreviousResult());↵ | 4 | AssertionResult res = assertion.getResult(jmctx.getPreviousResult());↵ | |
5 | log.debug(" res " + res.isError());↵ | 5 | log.debug(res.getFailureMessage() + " error: " + res.isError()↵ | |
6 | log.debug(" failure " + res.getFailureMessage());↵ | 6 | + " failure: " + res.isFailure());↵ | |
7 | assertFalse(res.isError());↵ | 7 | assertTrue(res.isError());↵ | |
8 | assertFalse(res.isFailure()); | 8 |
| |
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 | 49 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | assertion.setXPathString("//row/value[@field = 'noalias']"); |
| 1 | assertion.setXPathString("//row/value[@field = 'alias']"); | ||||||||||||||||||||
2 | assertion.setNegated(true); |
| 2 | assertion.setNegated(false); | ||||||||||||||||||||
| 3 | assertion.setValidating(true); | ||||||||||||||||||||||
3 | AssertionResult res = assertion.getResult(jmctx.getPreviousResult()); | 4 | AssertionResult res = assertion.getResult(jmctx.getPreviousResult()); | |||||||||||||||||||||
4 | log.debug(" res " + res.isError()); | | ||||||||||||||||||||||
5 | log.debug(" failure " + res.getFailureMessage()); |
| 5 | log.debug(res.getFailureMessage() + " error: " + res.isError() + " failure: " + res.isFailure()); | ||||||||||||||||||||
6 | assertFalse(res.isError()); |
| 6 | assertTrue(res.isError()); | ||||||||||||||||||||
7 | assertFalse(res.isFailure()); | 7 | assertFalse(res.isFailure()); |
Row | Violation |
---|---|
1 | Expression res.getFailureMessage() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression res.getFailureMessage() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression " failure " + res.getFailureMessage() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression res.getFailureMessage() + " error: " + res.isError()+ " failure: "+ res.isFailure() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression assertFalse(res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression assertTrue(res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression assertFalse(res.isError()) is a void method call, and thus it cannot be parameterized |
8 | Expression assertTrue(res.isError()) is a void method call, and thus it cannot be parameterized |
9 | Clone fragment #1 returns variables res , while Clone fragment #2 returns variables |