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_Parameters(HTTPSamplerBase, HTTPSampleResult, String, URL, String, String, String, String, boolean)
|
Method name: void checkGetRequest(HTTPSamplerBase, HTTPSampleResult)
|
|||
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(), EncoderCache.URL_ARGUMENT_ENCODING);↵ | |
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.1 |
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.2 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
11 | String dataSentToMirrorServer = new String(res.getResponseData(), EncoderCache.URL_ARGUMENT_ENCODING); | 4 | String dataSentToMirrorServer = new String(res.getResponseData(), EncoderCache.URL_ARGUMENT_ENCODING); | |
12 | int posDividerHeadersAndBody = getPositionOfBody(dataSentToMirrorServer); | 5 | int posDividerHeadersAndBody = getPositionOfBody(dataSentToMirrorServer); | |
13 | String headersSent = null; | 6 | String headersSent = null; | |
14 | String bodySent = null; | 7 | String bodySent = null; | |
15 | if (posDividerHeadersAndBody >= 0) | 8 | if (posDividerHeadersAndBody >= 0) | |
16 | headersSent = dataSentToMirrorServer.substring(0, posDividerHeadersAndBody); | 9 | headersSent = dataSentToMirrorServer.substring(0, posDividerHeadersAndBody); | |
17 | bodySent = dataSentToMirrorServer.substring(posDividerHeadersAndBody + 2); | 10 | bodySent = dataSentToMirrorServer.substring(posDividerHeadersAndBody + 2); | |
else | else | |||
18 | fail("No header and body section found"); | 11 | fail("No header and body section found"); |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables bodySent, headersSent , while Clone fragment #2 returns variables bodySent, headersSent |