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: 13 | Number of AST nodes: 13 | |||
1 | setupUrl(sampler, contentEncoding);↵ | 1 | setupUrl(sampler, contentEncoding);↵ | |
2 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue);↵ | 2 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue);↵ | |
3 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false);↵ | 3 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false);↵ | |
4 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false);↵ | 4 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false);↵ | |
5 | res = executeSampler(sampler);↵ | 5 | res = executeSampler(sampler);↵ | |
6 | expectedPostBody = titleValue + descriptionValue;↵ | 6 | expectedPostBody = titleValue + descriptionValue;↵ | |
7 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody);↵ | 7 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody);↵ | |
8 | // Test sending data as UTF-8, with values that have been urlencoded, and↵ | 8 | // Test sending data as UTF-8↵ | |
9 | // where we tell the sampler to urlencode the parameter values↵ | |||
10 | sampler = createHttpSampler(samplerType);↵ | 9 | sampler = createHttpSampler(samplerType);↵ | |
11 | contentEncoding = "UTF-8";↵ | 10 | contentEncoding = "UTF-8";↵ | |
12 | titleValue = "mytitle%2F%3D";↵ | 11 | titleValue = "mytitle\u0153\u20a1\u0115\u00c5";↵ | |
13 | descriptionValue = "mydescription+++%2F%5C";↵ | 12 | descriptionValue = "mydescription\u0153\u20a1\u0115\u00c5";↵ | |
14 | setupUrl(sampler, contentEncoding);↵ | 13 | setupUrl(sampler, contentEncoding);↵ | |
15 | setupFormData(sampler, true, titleField, titleValue, descriptionField, descriptionValue); | 14 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue); | |
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 in the same method |
Number of node comparisons | 136 |
Number of mapped statements | 13 |
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 16 | setupUrl(sampler, contentEncoding); | ||||||||||||
58 | setupUrl(sampler, contentEncoding); | 27 | setupUrl(sampler, contentEncoding); | |||||||||||
59 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue); | 17 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue); | |||||||||||
60 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false); | 18 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false); | |||||||||||
61 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false); | 19 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false); | |||||||||||
62 | res = executeSampler(sampler); | 20 | res = executeSampler(sampler); | |||||||||||
63 | expectedPostBody = titleValue + descriptionValue; | 21 | expectedPostBody = titleValue + descriptionValue; | |||||||||||
64 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | 22 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | |||||||||||
65 | sampler = createHttpSampler(samplerType); | 23 | sampler = createHttpSampler(samplerType); | |||||||||||
66 | contentEncoding = "UTF-8"; | 24 | contentEncoding = "UTF-8"; | |||||||||||
67 | titleValue = "mytitle%2F%3D"; |
| 25 | titleValue = "mytitle\u0153\u20a1\u0115\u00c5"; | ||||||||||
68 | descriptionValue = "mydescription+++%2F%5C"; |
| 26 | descriptionValue = "mydescription\u0153\u20a1\u0115\u00c5"; | ||||||||||
69 | setupUrl(sampler, contentEncoding); | 27 | setupUrl(sampler, contentEncoding); | |||||||||||
70 | setupFormData(sampler, true, titleField, titleValue, descriptionField, descriptionValue); |
| 28 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue); |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables sampler, titleValue, descriptionValue, contentEncoding , while Clone fragment #2 returns variables sampler, titleValue, descriptionValue, contentEncoding |