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 | ↵ | |||
2 | // Test sending data as UTF-8, with values that have been urlencoded↵ | 3 | // Test sending data as UTF-8, with + as part of the value,↵ | |
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 | sampler = createHttpSampler(samplerType);↵ | 8 | sampler = createHttpSampler(samplerType);↵ | |
4 | contentEncoding = "UTF-8";↵ | 9 | contentEncoding = "UTF-8";↵ | |
5 | titleValue = "mytitle%2F%3D";↵ | 10 | titleValue = "mytitle++";↵ | |
6 | descriptionValue = "mydescription+++%2F%5C";↵ | 11 | descriptionValue = "mydescription+";↵ | |
7 | setupUrl(sampler, contentEncoding);↵ | 12 | setupUrl(sampler, contentEncoding);↵ | |
8 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue);↵ | 13 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue);↵ | |
9 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false);↵ | 14 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false);↵ | |
10 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false);↵ | 15 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false);↵ | |
11 | res = executeSampler(sampler);↵ | 16 | res = executeSampler(sampler);↵ | |
12 | expectedPostBody = titleValue + descriptionValue;↵ | 17 | expectedPostBody = titleValue + descriptionValue;↵ | |
13 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | 18 |
| |
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 | 104 |
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
53 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | 84 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | |||||||||||
54 | sampler = createHttpSampler(samplerType); | 85 | sampler = createHttpSampler(samplerType); | |||||||||||
55 | contentEncoding = "UTF-8"; | 86 | contentEncoding = "UTF-8"; | |||||||||||
56 | titleValue = "mytitle%2F%3D"; |
| 87 | titleValue = "mytitle++"; | ||||||||||
57 | descriptionValue = "mydescription+++%2F%5C"; |
| 88 | descriptionValue = "mydescription+"; | ||||||||||
58 | setupUrl(sampler, contentEncoding); | 89 | setupUrl(sampler, contentEncoding); | |||||||||||
59 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue); | 90 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue); | |||||||||||
60 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false); | 91 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false); | |||||||||||
61 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false); | 92 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false); | |||||||||||
62 | res = executeSampler(sampler); | 93 | res = executeSampler(sampler); | |||||||||||
63 | expectedPostBody = titleValue + descriptionValue; | 94 | expectedPostBody = titleValue + descriptionValue; | |||||||||||
64 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | 95 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); |
Row | Violation |
---|