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 similar to __VIEWSTATE parameter that .net u↵ | 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↵ | |||
3 | ses↵ | 7 | // Proxy server calls in some cases↵ | |
4 | sampler = createHttpSampler(samplerType);↵ | 8 | sampler = createHttpSampler(samplerType);↵ | |
5 | contentEncoding = "UTF-8";↵ | 9 | contentEncoding = "UTF-8";↵ | |
6 | titleValue = "/wEPDwULLTE2MzM2OTA0NTYPZBYCAgMPZ/rA+8DZ2dnZ2dnZ2d/GNDar6OshPwdJc=";↵ | 10 | titleValue = "mytitle++";↵ | |
7 | descriptionValue = "mydescription";↵ | 11 | descriptionValue = "mydescription+";↵ | |
8 | setupUrl(sampler, contentEncoding);↵ | 12 | setupUrl(sampler, contentEncoding);↵ | |
9 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue);↵ | 13 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue);↵ | |
10 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false);↵ | 14 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false);↵ | |
11 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false);↵ | 15 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false);↵ | |
12 | res = executeSampler(sampler);↵ | 16 | res = executeSampler(sampler);↵ | |
13 | expectedPostBody = titleValue + descriptionValue;↵ | 17 | expectedPostBody = titleValue + descriptionValue;↵ | |
14 | 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 | 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 | 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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
73 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | 84 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | |||||||||||
74 | sampler = createHttpSampler(samplerType); | 85 | sampler = createHttpSampler(samplerType); | |||||||||||
75 | contentEncoding = "UTF-8"; | 86 | contentEncoding = "UTF-8"; | |||||||||||
76 | titleValue = "/wEPDwULLTE2MzM2OTA0NTYPZBYCAgMPZ/rA+8DZ2dnZ2dnZ2d/GNDar6OshPwdJc="; |
| 87 | titleValue = "mytitle++"; | ||||||||||
77 | descriptionValue = "mydescription"; |
| 88 | descriptionValue = "mydescription+"; | ||||||||||
78 | setupUrl(sampler, contentEncoding); | 89 | setupUrl(sampler, contentEncoding); | |||||||||||
79 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue); | 90 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue); | |||||||||||
80 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false); | 91 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false); | |||||||||||
81 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false); | 92 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false); | |||||||||||
82 | res = executeSampler(sampler); | 93 | res = executeSampler(sampler); | |||||||||||
83 | expectedPostBody = titleValue + descriptionValue; | 94 | expectedPostBody = titleValue + descriptionValue; | |||||||||||
84 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | 84 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | |||||||||||
| 95 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables sampler, contentEncoding, res, expectedPostBody |