File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/assertions/XMLSchemaAssertionTest.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/assertions/XMLSchemaAssertionTest.java | |||
Method name: void testAssertionBadXSDFile()
|
Method name: void testAssertionNoResult()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 7 | |||
1 | result.setResponseData(readFile("testfiles/XMLSchematest.xml"));↵ | |||
2 | assertion.setXsdFileName("xtestfiles/XMLSchema-fail.xsd");↵ | 1 | assertion.setXsdFileName("testfiles/XMLSchema-fail.xsd");↵ | |
3 | AssertionResult res = assertion.getResult(jmctx.getPreviousResult());↵ | 2 | AssertionResult res = assertion.getResult(jmctx.getPreviousResult());↵ | |
4 | testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());↵ | 3 | testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());↵ | |
5 | testLog.debug("failure " + res.getFailureMessage());↵ | 4 | testLog.debug("failure " + res.getFailureMessage());↵ | |
6 | assertTrue(res.getFailureMessage().indexOf("Failed to read schema document") > 0);↵ | 5 | assertEquals(AssertionResult.RESPONSE_WAS_NULL, res.getFailureMessage());↵ | |
7 | assertTrue(res.isError());// TODO - should this be a failure?↵ | 6 | assertFalse(res.isError());↵ | |
8 | assertFalse(res.isFailure()); | 7 | assertTrue(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 | 56 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | result.setResponseData(readFile("testfiles/XMLSchematest.xml")); | | |||||||||||||||||||||||
2 | assertion.setXsdFileName("xtestfiles/XMLSchema-fail.xsd"); |
| 1 | assertion.setXsdFileName("testfiles/XMLSchema-fail.xsd"); | |||||||||||||||||||||
3 | AssertionResult res = assertion.getResult(jmctx.getPreviousResult()); | 2 | AssertionResult res = assertion.getResult(jmctx.getPreviousResult()); | ||||||||||||||||||||||
4 | testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure()); | 3 | testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure()); | ||||||||||||||||||||||
5 | testLog.debug("failure " + res.getFailureMessage()); | 4 | testLog.debug("failure " + res.getFailureMessage()); | ||||||||||||||||||||||
6 | assertTrue(res.getFailureMessage().indexOf("Failed to read schema document") > 0); |
| 5 | assertEquals(AssertionResult.RESPONSE_WAS_NULL, res.getFailureMessage()); | |||||||||||||||||||||
7 | assertTrue(res.isError()); |
| 6 | assertFalse(res.isError()); | |||||||||||||||||||||
8 | assertFalse(res.isFailure()); |
| 7 | assertTrue(res.isFailure()); |
Row | Violation |
---|---|
1 | Expression assertTrue(res.getFailureMessage().indexOf("Failed to read schema document") > 0) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression assertTrue(res.getFailureMessage().indexOf("Failed to read schema document") > 0) is a void method call, and thus it cannot be parameterized |
4 | Expression assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) is a void method call, and thus it cannot be parameterized |
5 | Expression assertTrue(res.getFailureMessage().indexOf("Failed to read schema document") > 0) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression assertTrue(res.getFailureMessage().indexOf("Failed to read schema document") > 0) is a void method call, and thus it cannot be parameterized |
8 | Expression assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) is a void method call, and thus it cannot be parameterized |
9 | Expression assertTrue(res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression assertFalse(res.isError()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression assertTrue(res.isError()) is a void method call, and thus it cannot be parameterized |
12 | Expression assertFalse(res.isError()) is a void method call, and thus it cannot be parameterized |
13 | Expression assertFalse(res.isFailure()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression assertTrue(res.isFailure()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Expression assertFalse(res.isFailure()) is a void method call, and thus it cannot be parameterized |
16 | Expression assertTrue(res.isFailure()) is a void method call, and thus it cannot be parameterized |