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 testGetRequestEncodings()
|
Method name: void testGetRequestEncodings()
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | contentEncoding = "ISO-8859-1";↵ | 1 | contentEncoding = "UTF-8";↵ | |
2 | param1Value = "yes";↵ | 2 | param1Value = "yes";↵ | |
3 | param2Value = "0+5 -\u00c5%C3%85";↵ | 3 | param2Value = "0+5 -\u007c\u2aa1\u266a\u0153\u20a1\u0115\u0364\u00c5\u2052\uc385%C3%85";↵ | |
4 | param2ValueEncoded = URLEncoder.encode(param2Value, contentEncoding);↵ | 4 | param2ValueEncoded = URLEncoder.encode(param2Value, contentEncoding);↵ | |
5 | testGetRequest = ↵ | 5 | testGetRequest = ↵ | |
6 | "GET " + url↵ | 6 | "GET " + url↵ | |
7 | + "?param1=" + param1Value + "¶m2=" + param2ValueEncoded + " "↵ | 7 | + "?param1=" + param1Value + "¶m2=" + param2ValueEncoded + " "↵ | |
8 | + "HTTP/1.1\r\n\r\n";↵ | 8 | + "HTTP/1.1\r\n\r\n";↵ | |
9 | s = getSamplerForRequest(url, testGetRequest, contentEncoding);↵ | 9 | s = getSamplerForRequest(url, testGetRequest, contentEncoding);↵ | |
10 | assertEquals(HTTPSamplerBase.GET, s.getMethod());↵ | 10 | assertEquals(HTTPSamplerBase.GET, s.getMethod());↵ | |
11 | assertEquals(contentEncoding, s.getContentEncoding());↵ | 11 | assertEquals(contentEncoding, s.getContentEncoding());↵ | |
12 | // Check arguments↵ | 12 | // Check arguments↵ | |
13 | arguments = s.getArguments();↵ | 13 | arguments = s.getArguments();↵ | |
14 | assertEquals(2, arguments.getArgumentCount());↵ | 14 | assertEquals(2, arguments.getArgumentCount());↵ | |
15 | checkArgument((HTTPArgument)arguments.getArgument(0), "param1", param1Value, param1Value, contentEncoding, false);↵ | 15 | checkArgument((HTTPArgument)arguments.getArgument(0), "param1", param1Value, param1Value, contentEncoding, false);↵ | |
16 | checkArgument((HTTPArgument)arguments.getArgument(1), "param2", param2Value, param2ValueEncoded, contentEncoding, true); | 16 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in the same method |
Number of node comparisons | 144 |
Number of mapped statements | 12 |
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
26 | contentEncoding = "ISO-8859-1"; |
| 14 | contentEncoding = "UTF-8"; | ||||||||||
27 | param1Value = "yes"; | 15 | param1Value = "yes"; | |||||||||||
28 | param2Value = "0+5 -\u00c5%C3%85"; |
| 16 | param2Value = "0+5 -\u007c\u2aa1\u266a\u0153\u20a1\u0115\u0364\u00c5\u2052\uc385%C3%85"; | ||||||||||
29 | param2ValueEncoded = URLEncoder.encode(param2Value, contentEncoding); | 17 | param2ValueEncoded = URLEncoder.encode(param2Value, contentEncoding); | |||||||||||
30 | testGetRequest = "GET " + url + "?param1=" + param1Value + "¶m2=" + param2ValueEncoded + " " + "HTTP/1.1\r\n\r\n"; | 18 | testGetRequest = "GET " + url + "?param1=" + param1Value + "¶m2=" + param2ValueEncoded + " " + "HTTP/1.1\r\n\r\n"; | |||||||||||
31 | s = getSamplerForRequest(url, testGetRequest, contentEncoding); | 19 | s = getSamplerForRequest(url, testGetRequest, contentEncoding); | |||||||||||
32 | assertEquals(HTTPSamplerBase.GET, s.getMethod()); | 20 | assertEquals(HTTPSamplerBase.GET, s.getMethod()); | |||||||||||
33 | assertEquals(contentEncoding, s.getContentEncoding()); | 21 | assertEquals(contentEncoding, s.getContentEncoding()); | |||||||||||
34 | arguments = s.getArguments(); | 22 | arguments = s.getArguments(); | |||||||||||
35 | assertEquals(2, arguments.getArgumentCount()); | 23 | assertEquals(2, arguments.getArgumentCount()); | |||||||||||
36 | checkArgument((HTTPArgument)arguments.getArgument(0), "param1", param1Value, param1Value, contentEncoding, false); | 24 | checkArgument((HTTPArgument)arguments.getArgument(0), "param1", param1Value, param1Value, contentEncoding, false); | |||||||||||
37 | checkArgument((HTTPArgument)arguments.getArgument(1), "param2", param2Value, param2ValueEncoded, contentEncoding, true); | 25 | checkArgument((HTTPArgument)arguments.getArgument(1), "param2", param2Value, param2ValueEncoded, contentEncoding, true); |
Row | Violation |
---|