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 testPostRequest_BodyFromParameterValues(int, String)
|
Method name: void testPostRequest_BodyFromParameterValues(int, String)
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody);↵ | 1 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody);↵ | |
2 | ↵ | |||
3 | // Test sending data as UTF-8, with + as part of the value,↵ | 2 | // Test sending data as UTF-8, with ↵ | |
4 | // where the value is set in sampler as not urluencoded, but the ↵ | |||
5 | // isalwaysencoded flag of the argument is set to false.↵ | |||
6 | // This mimics the HTTPSamplerBase.addNonEncodedArgument, which the↵ | |||
7 | // Proxy server calls in some cases↵ | 3 | values that have been urlencoded↵ | |
8 | sampler = createHttpSampler(samplerType);↵ | 4 | sampler = createHttpSampler(samplerType);↵ | |
9 | contentEncoding = "UTF-8";↵ | 5 | contentEncoding = "UTF-8";↵ | |
10 | titleValue = "mytitle++";↵ | 6 | titleValue = "mytitle%2F%3D";↵ | |
11 | descriptionValue = "mydescription+";↵ | 7 | descriptionValue = "mydescription+++%2F%5C";↵ | |
12 | setupUrl(sampler, contentEncoding);↵ | 8 | setupUrl(sampler, contentEncoding);↵ | |
13 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue);↵ | 9 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue);↵ | |
14 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false);↵ | 10 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false);↵ | |
15 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false);↵ | 11 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false);↵ | |
16 | res = executeSampler(sampler);↵ | 12 | res = executeSampler(sampler);↵ | |
17 | expectedPostBody = titleValue + descriptionValue;↵ | 13 | expectedPostBody = titleValue + descriptionValue;↵ | |
18 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | 14 |
| |
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 | 114 |
Number of mapped statements | 12 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 53 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | ||||||||||||
84 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | 64 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | |||||||||||
85 | sampler = createHttpSampler(samplerType); | 54 | sampler = createHttpSampler(samplerType); | |||||||||||
86 | contentEncoding = "UTF-8"; | 55 | contentEncoding = "UTF-8"; | |||||||||||
87 | titleValue = "mytitle++"; |
| 56 | titleValue = "mytitle%2F%3D"; | ||||||||||
88 | descriptionValue = "mydescription+"; |
| 57 | descriptionValue = "mydescription+++%2F%5C"; | ||||||||||
89 | setupUrl(sampler, contentEncoding); | 58 | setupUrl(sampler, contentEncoding); | |||||||||||
90 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue); | 59 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue); | |||||||||||
91 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false); | 60 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false); | |||||||||||
92 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false); | 61 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false); | |||||||||||
93 | res = executeSampler(sampler); | 62 | res = executeSampler(sampler); | |||||||||||
94 | expectedPostBody = titleValue + descriptionValue; | 63 | expectedPostBody = titleValue + descriptionValue; | |||||||||||
95 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | 64 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); |
Row | Violation |
---|