File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java | |||
Method name: void checkGetRequest(HTTPSamplerBase, HTTPSampleResult)
|
Method name: void checkPostRequestFormMultipart(HTTPSamplerBase, HTTPSampleResult, String, String, String, String, String, String)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | String dataSentToMirrorServer = new String(res.getResponseData(), EncoderCache.URL_ARGUMENT_ENCODING);↵ | 1 | String dataSentToMirrorServer = new String(res.getResponseData(), contentEncoding);↵ | |
2 | int posDividerHeadersAndBody = getPositionOfBody(dataSentToMirrorServer);↵ | 2 | int posDividerHeadersAndBody = getPositionOfBody(dataSentToMirrorServer);↵ | |
3 | String headersSent = null;↵ | 3 | String headersSent = null;↵ | |
4 | String bodySent = null;↵ | 4 | String bodySent = null;↵ | |
5 | if(posDividerHeadersAndBody >= 0) {↵ | 5 | if(posDividerHeadersAndBody >= 0) {↵ | |
6 | headersSent = dataSentToMirrorServer.substring(0, posDividerHeadersAndBody);↵ | 6 | headersSent = dataSentToMirrorServer.substring(0, posDividerHeadersAndBody);↵ | |
7 | // Skip the blank line with crlf dividing headers and body↵ | 7 | // Skip the blank line with crlf dividing headers and body↵ | |
8 | bodySent = dataSentToMirrorServer.substring(posDividerHeadersAndBody+2);↵ | 8 | bodySent = dataSentToMirrorServer.substring(posDividerHeadersAndBody+2);↵ | |
9 | }↵ | 9 | }↵ | |
10 | else {↵ | 10 | else {↵ | |
11 | fail("No header and body section found");↵ | 11 | fail("No header and body section found");↵ | |
12 | } | 12 |
| |
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 26 |
Number of mapped statements | 8 |
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) | 2.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | String dataSentToMirrorServer = new String(res.getResponseData(), EncoderCache.URL_ARGUMENT_ENCODING); |
| 9 | String dataSentToMirrorServer = new String(res.getResponseData(), contentEncoding); | ||||||||||
5 | int posDividerHeadersAndBody = getPositionOfBody(dataSentToMirrorServer); | 10 | int posDividerHeadersAndBody = getPositionOfBody(dataSentToMirrorServer); | |||||||||||
6 | String headersSent = null; | 11 | String headersSent = null; | |||||||||||
7 | String bodySent = null; | 12 | String bodySent = null; | |||||||||||
8 | if (posDividerHeadersAndBody >= 0) | 13 | if (posDividerHeadersAndBody >= 0) | |||||||||||
9 | headersSent = dataSentToMirrorServer.substring(0, posDividerHeadersAndBody); | 14 | headersSent = dataSentToMirrorServer.substring(0, posDividerHeadersAndBody); | |||||||||||
10 | bodySent = dataSentToMirrorServer.substring(posDividerHeadersAndBody + 2); | 15 | bodySent = dataSentToMirrorServer.substring(posDividerHeadersAndBody + 2); | |||||||||||
else | else | |||||||||||||
11 | fail("No header and body section found"); | 16 | fail("No header and body section found"); |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables bodySent, headersSent , while Clone fragment #2 returns variables headersSent, bodySent |