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 | // Test sending data as UTF-8, with values similar to __VIEWSTATE parameter that .net uses↵ | 2 | // Test sending data as UTF-8, with values that have been urlencoded↵ | |
3 | sampler = createHttpSampler(samplerType);↵ | 3 | sampler = createHttpSampler(samplerType);↵ | |
4 | contentEncoding = "UTF-8";↵ | 4 | contentEncoding = "UTF-8";↵ | |
5 | titleValue = "/wEPDwULLTE2MzM2OTA0NTYPZBYCAgMPZ/rA+8DZ2dnZ2dnZ2d/GNDar6OshPwdJc=";↵ | 5 | titleValue = "mytitle%2F%3D";↵ | |
6 | descriptionValue = "mydescription";↵ | 6 | descriptionValue = "mydescription+++%2F%5C";↵ | |
7 | setupUrl(sampler, contentEncoding);↵ | 7 | setupUrl(sampler, contentEncoding);↵ | |
8 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue);↵ | 8 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue);↵ | |
9 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false);↵ | 9 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false);↵ | |
10 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false);↵ | 10 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false);↵ | |
11 | res = executeSampler(sampler);↵ | 11 | res = executeSampler(sampler);↵ | |
12 | expectedPostBody = titleValue + descriptionValue;↵ | 12 | expectedPostBody = titleValue + descriptionValue;↵ | |
13 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | 13 |
| |
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); | ||||||||||||
73 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | 64 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | |||||||||||
74 | sampler = createHttpSampler(samplerType); | 54 | sampler = createHttpSampler(samplerType); | |||||||||||
75 | contentEncoding = "UTF-8"; | 55 | contentEncoding = "UTF-8"; | |||||||||||
76 | titleValue = "/wEPDwULLTE2MzM2OTA0NTYPZBYCAgMPZ/rA+8DZ2dnZ2dnZ2d/GNDar6OshPwdJc="; |
| 56 | titleValue = "mytitle%2F%3D"; | ||||||||||
77 | descriptionValue = "mydescription"; |
| 57 | descriptionValue = "mydescription+++%2F%5C"; | ||||||||||
78 | setupUrl(sampler, contentEncoding); | 58 | setupUrl(sampler, contentEncoding); | |||||||||||
79 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue); | 59 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue); | |||||||||||
80 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false); | 60 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false); | |||||||||||
81 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false); | 61 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false); | |||||||||||
82 | res = executeSampler(sampler); | 62 | res = executeSampler(sampler); | |||||||||||
83 | expectedPostBody = titleValue + descriptionValue; | 63 | expectedPostBody = titleValue + descriptionValue; | |||||||||||
84 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | 64 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); |
Row | Violation |
---|