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: 11 | Number of AST nodes: 11 | |||
1 | expectedPostBody = titleValue + descriptionValue;↵ | 1 | expectedPostBody = titleValue + descriptionValue;↵ | |
2 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody);↵ | 2 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody);↵ | |
3 | // Test sending data as UTF-8↵ | 3 | // Test sending data as UTF-8, with values similar to __VIEWSTATE parameter that .net uses↵ | |
4 | sampler = createHttpSampler(samplerType);↵ | 4 | sampler = createHttpSampler(samplerType);↵ | |
5 | contentEncoding = "UTF-8";↵ | 5 | contentEncoding = "UTF-8";↵ | |
6 | titleValue = "mytitle\u0153\u20a1\u0115\u00c5";↵ | 6 | titleValue = "/wEPDwULLTE2MzM2OTA0NTYPZBYCAgMPZ/rA+8DZ2dnZ2dnZ2d/GNDar6OshPwdJc=";↵ | |
7 | descriptionValue = "mydescription\u0153\u20a1\u0115\u00c5";↵ | 7 | descriptionValue = "mydescription";↵ | |
8 | setupUrl(sampler, contentEncoding);↵ | 8 | setupUrl(sampler, contentEncoding);↵ | |
9 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue);↵ | 9 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue);↵ | |
10 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false);↵ | 10 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false);↵ | |
11 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false);↵ | 11 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false);↵ | |
12 | res = executeSampler(sampler); | 12 |
| |
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 | 121 |
Number of mapped statements | 11 |
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
21 | expectedPostBody = titleValue + descriptionValue; | 72 | expectedPostBody = titleValue + descriptionValue; | |||||||||||
22 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | 73 | checkPostRequestBody(sampler, res, samplerDefaultEncoding, contentEncoding, expectedPostBody); | |||||||||||
23 | sampler = createHttpSampler(samplerType); | 74 | sampler = createHttpSampler(samplerType); | |||||||||||
24 | contentEncoding = "UTF-8"; | 75 | contentEncoding = "UTF-8"; | |||||||||||
25 | titleValue = "mytitle\u0153\u20a1\u0115\u00c5"; |
| 76 | titleValue = "/wEPDwULLTE2MzM2OTA0NTYPZBYCAgMPZ/rA+8DZ2dnZ2dnZ2d/GNDar6OshPwdJc="; | ||||||||||
26 | descriptionValue = "mydescription\u0153\u20a1\u0115\u00c5"; |
| 77 | descriptionValue = "mydescription"; | ||||||||||
27 | setupUrl(sampler, contentEncoding); | 78 | setupUrl(sampler, contentEncoding); | |||||||||||
28 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue); | 79 | setupFormData(sampler, false, titleField, titleValue, descriptionField, descriptionValue); | |||||||||||
29 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false); | 80 | ((HTTPArgument)sampler.getArguments().getArgument(0)).setAlwaysEncoded(false); | |||||||||||
30 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false); | 81 | ((HTTPArgument)sampler.getArguments().getArgument(1)).setAlwaysEncoded(false); | |||||||||||
31 | res = executeSampler(sampler); | 82 | res = executeSampler(sampler); |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables titleValue, descriptionValue, sampler, contentEncoding, res , while Clone fragment #2 returns variables titleValue, descriptionValue, sampler, contentEncoding, res |