File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/assertions/XPathAssertionTest.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/assertions/XPathAssertionTest.java | |||
Method name: void testAssertionEmptyResult()
|
Method name: void testAssertionBlankResult()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | result.setResponseData("".getBytes());↵ | 1 | result.setResponseData(" ".getBytes());↵ | |
2 | AssertionResult res = assertion.getResult(result);↵ | 2 | AssertionResult res = assertion.getResult(result);↵ | |
3 | testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());↵ | 3 | testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());↵ | |
4 | testLog.debug("failure message: " + res.getFailureMessage());↵ | 4 | testLog.debug("failure message: " + res.getFailureMessage());↵ | |
5 | assertEquals(AssertionResult.RESPONSE_WAS_NULL, res.getFailureMessage());↵ | 5 | assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0);↵ | |
6 | assertFalse("Should not be an error", res.isError());↵ | 6 | assertTrue("Should be an error",res.isError());↵ | |
7 | assertTrue("Should be a failure",res.isFailure()); | 7 | assertFalse("Should not be a failure", 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 | 49 |
Number of mapped statements | 7 |
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 | result.setResponseData("".getBytes()); |
| 1 | result.setResponseData(" ".getBytes()); | |||||||||||||||||||||
2 | AssertionResult res = assertion.getResult(result); | 2 | AssertionResult res = assertion.getResult(result); | ||||||||||||||||||||||
3 | testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure()); | 3 | testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure()); | ||||||||||||||||||||||
4 | testLog.debug("failure message: " + res.getFailureMessage()); | 4 | testLog.debug("failure message: " + res.getFailureMessage()); | ||||||||||||||||||||||
5 | assertEquals(AssertionResult.RESPONSE_WAS_NULL, res.getFailureMessage()); |
| 5 | assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0); | |||||||||||||||||||||
6 | assertFalse("Should not be an error", res.isError()); |
| 6 | assertTrue("Should be an error", res.isError()); | |||||||||||||||||||||
7 | assertTrue("Should be a failure", res.isFailure()); |
| 7 | assertFalse("Should not be a failure", res.isFailure()); |
Row | Violation |
---|---|
1 | Expression assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) is a void method call, and thus it cannot be parameterized |
4 | Expression assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0) is a void method call, and thus it cannot be parameterized |
5 | Expression assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) is a void method call, and thus it cannot be parameterized |
8 | Expression assertTrue(res.getFailureMessage().indexOf("Premature end of file") > 0) is a void method call, and thus it cannot be parameterized |
9 | Expression assertFalse("Should not be an error",res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression assertTrue("Should be an error",res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression assertFalse("Should not be an error",res.isError()) is a void method call, and thus it cannot be parameterized |
12 | Expression assertTrue("Should be an error",res.isError()) is a void method call, and thus it cannot be parameterized |
13 | Expression assertTrue("Should be a failure",res.isFailure()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression assertFalse("Should not be a failure",res.isFailure()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Expression assertTrue("Should be a failure",res.isFailure()) is a void method call, and thus it cannot be parameterized |
16 | Expression assertFalse("Should not be a failure",res.isFailure()) is a void method call, and thus it cannot be parameterized |