File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/proxy/TestHttpRequestHdr.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/proxy/TestHttpRequestHdr.java | |||
Method name: void testEncodedArguments()
|
Method name: void testRepeatedArguments()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | checkArgument((HTTPArgument)arguments.getArgument(0), "abc?SPACE", "a b", "a+b", contentEncoding, true);↵ | 1 | checkArgument((HTTPArgument)arguments.getArgument(10), "d", "1", "1", contentEncoding, false);↵ | |
2 | checkArgument((HTTPArgument)arguments.getArgument(1), "space", "a b", "a+b", contentEncoding, true);↵ | 2 | checkArgument((HTTPArgument)arguments.getArgument(11), "d", "", "", contentEncoding, false);↵ | |
3 | checkArgument((HTTPArgument)arguments.getArgument(2), "query", "What?", "What%3F", contentEncoding, true);↵ | 3 | checkArgument((HTTPArgument)arguments.getArgument(12), "d", "", "", contentEncoding, false);↵ | |
4 | ↵ | |||
5 | // A HTTP POST request, with unknown encoding↵ | 4 | // A HTTP POST request↵ | |
6 | contentEncoding = "";↵ | 5 | contentEncoding = "UTF-8";↵ | |
7 | String postBody = "abc%3FSPACE=a+b&space=a%20b&query=What%3F";↵ | 6 | String postBody = "update=yes&d=1&d=2&d=&d=&d=&d=&d=&d=1&d=2&d=1&d=&d=";↵ | |
8 | String testPostRequest = "POST " + url + " HTTP/1.1\r\n"↵ | 7 | String testPostRequest = "POST " + url + " HTTP/1.0\n"↵ | |
9 | + "Content-type: "↵ | 8 | + "Content-type: "↵ | |
10 | + HTTPSamplerBase.APPLICATION_X_WWW_FORM_URLENCODED + "\r\n"↵ | 9 | + HTTPSamplerBase.APPLICATION_X_WWW_FORM_URLENCODED + "\r\n"↵ | |
11 | + "Content-length: " + getBodyLength(postBody, contentEncoding) + "\r\n"↵ | 10 | + "Content-length: " + getBodyLength(postBody, contentEncoding) + "\r\n"↵ | |
12 | + "\r\n"↵ | 11 | + "\r\n"↵ | |
13 | + postBody; | 12 | + postBody; | |
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 | 36 |
Number of mapped statements | 6 |
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 | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
24 | checkArgument((HTTPArgument)arguments.getArgument(0), "abc?SPACE", "a b", "a+b", contentEncoding, true); |
| 21 | checkArgument((HTTPArgument)arguments.getArgument(12), "d", "", "", contentEncoding, false); | ||||||||||||||||||||||
25 | checkArgument((HTTPArgument)arguments.getArgument(1), "space", "a b", "a+b", contentEncoding, true); |
| 20 | checkArgument((HTTPArgument)arguments.getArgument(11), "d", "", "", contentEncoding, false); | ||||||||||||||||||||||
26 | checkArgument((HTTPArgument)arguments.getArgument(2), "query", "What?", "What%3F", contentEncoding, true); |
| 19 | checkArgument((HTTPArgument)arguments.getArgument(10), "d", "1", "1", contentEncoding, false); | ||||||||||||||||||||||
27 | contentEncoding = ""; |
| 22 | contentEncoding = "UTF-8"; | ||||||||||||||||||||||
28 | String postBody = "abc%3FSPACE=a+b&space=a%20b&query=What%3F"; |
| 23 | String postBody = "update=yes&d=1&d=2&d=&d=&d=&d=&d=&d=1&d=2&d=1&d=&d="; | ||||||||||||||||||||||
29 | String testPostRequest = "POST " + url + " HTTP/1.1\r\n" + "Content-type: " + HTTPSamplerBase.APPLICATION_X_WWW_FORM_URLENCODED + "\r\n" + "Content-length: " + getBodyLength(postBody, contentEncoding) + "\r\n" + "\r\n" + postBody; |
| 24 | String testPostRequest = "POST " + url + " HTTP/1.0\n" + "Content-type: " + HTTPSamplerBase.APPLICATION_X_WWW_FORM_URLENCODED + "\r\n" + "Content-length: " + getBodyLength(postBody, contentEncoding) + "\r\n" + "\r\n" + postBody; |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables testPostRequest, contentEncoding, postBody , while Clone fragment #2 returns variables contentEncoding, testPostRequest, postBody |