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/XPathAssertionTest.java | |||
Method name: void testAssertionOK()
|
Method name: void testAssertionNoResult()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | result.setResponseData(readFile("testfiles/XMLSchematest.xml"));↵ | 1 | result↵ | |
2 | assertion.setXsdFileName("testfiles/XMLSchema-pass.xsd");↵ | 2 | = new SampleResult();↵ | |
3 | AssertionResult res = assertion.getResult(jmctx.getPreviousResult());↵ | 3 | AssertionResult res = assertion.getResult(result);↵ | |
4 | testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());↵ | 4 | testLog.debug("isError() " + res.isError() + " isFailure() " + res.isFailure());↵ | |
5 | testLog.debug("failure " + res.getFailureMessage());↵ | 5 | testLog.debug("failure message: " + res.getFailureMessage());↵ | |
6 | ↵ | 6 | assertEquals(AssertionResult.RESPONSE_WAS_NULL, res.getFailureMessage());↵ | |
7 | assertFalse("Should not be an error", res.isError());↵ | 7 | assertFalse("Should not be an error", res.isError());↵ | |
8 | assertFalse("Should not be a failure", res.isFailure()); | 8 | assertTrue("Should 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 in different classes having the same super 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 | result = new SampleResult(); | ||||||||||||||||||||||||
1 | result.setResponseData(readFile("testfiles/XMLSchematest.xml")); |
| 7 | assertTrue("Should be a failure", res.isFailure()); | ||||||||||||||||||||||
2 | assertion.setXsdFileName("testfiles/XMLSchema-pass.xsd"); |
| 5 | assertEquals(AssertionResult.RESPONSE_WAS_NULL, res.getFailureMessage()); | ||||||||||||||||||||||
3 | AssertionResult res = assertion.getResult(jmctx.getPreviousResult()); |
| 2 | AssertionResult res = assertion.getResult(result); | ||||||||||||||||||||||
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 message: " + res.getFailureMessage()); | ||||||||||||||||||||||
6 | assertFalse("Should not be an error", res.isError()); | 6 | assertFalse("Should not be an error", res.isError()); | |||||||||||||||||||||||
7 | assertFalse("Should not be a failure", res.isFailure()); | |
Row | Violation |
---|---|
1 | Expression assertTrue("Should be a failure",res.isFailure()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression result.setResponseData(readFile("testfiles/XMLSchematest.xml")) is a void method call, and thus it cannot be parameterized |
3 | Expression assertTrue("Should be a failure",res.isFailure()) is a void method call, and thus it cannot be parameterized |
4 | Expression assertTrue("Should be a failure",res.isFailure()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression result.setResponseData(readFile("testfiles/XMLSchematest.xml")) is a void method call, and thus it cannot be parameterized |
6 | Expression assertTrue("Should be a failure",res.isFailure()) is a void method call, and thus it cannot be parameterized |
7 | Expression assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression assertion.setXsdFileName("testfiles/XMLSchema-pass.xsd") is a void method call, and thus it cannot be parameterized |
9 | Expression assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) is a void method call, and thus it cannot be parameterized |
10 | Expression assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression assertion.setXsdFileName("testfiles/XMLSchema-pass.xsd") is a void method call, and thus it cannot be parameterized |
12 | Expression assertEquals(AssertionResult.RESPONSE_WAS_NULL,res.getFailureMessage()) is a void method call, and thus it cannot be parameterized |
13 | Expression assertion cannot be unified with expression assertion , because common superclass org.apache.jmeter.testelement.AbstractTestElement does not declare member(s) public org.apache.jmeter.assertions.AssertionResult getResult(org.apache.jmeter.samplers.SampleResult) |
14 | Clone fragment #1 returns variables res , while Clone fragment #2 returns variables |