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 checkGetRequest_Parameters(HTTPSamplerBase, HTTPSampleResult, String, URL, String, String, String, String, boolean)
|
Method name: void checkPostRequestUrlEncoded(HTTPSamplerBase, HTTPSampleResult, String, String, String, String, String, String, boolean)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | assertEquals(sampler.getMethod(), res.getHTTPMethod());↵ | 1 | assertEquals(sampler.getUrl(), res.getURL());↵ | |
2 | // Cannot check the query string of the result, because the mirror server↵ | 2 | ↵ | |
3 | // replies without including query string in URL↵ | |||
4 | ↵ | |||
5 | String expectedQueryString = null;↵ | 3 | String expectedPostBody = null;↵ | |
6 | if(!valuesAlreadyUrlEncoded) {↵ | 4 | if(!valuesAlreadyUrlEncoded) {↵ | |
7 | String expectedTitle = URLEncoder.encode(titleValue, contentEncoding);↵ | 5 | String expectedTitle = URLEncoder.encode(titleValue, contentEncoding);↵ | |
8 | String expectedDescription = URLEncoder.encode(descriptionValue, contentEncoding);↵ | 6 | String expectedDescription = URLEncoder.encode(descriptionValue, contentEncoding);↵ | |
9 | expectedQueryString = titleField + "=" + expectedTitle + "&" + descriptionField + "=" + expectedDescription;↵ | 7 | expectedPostBody = titleField + "=" + expectedTitle + "&" + descriptionField + "=" + expectedDescription;↵ | |
10 | }↵ | 8 | }↵ | |
11 | else {↵ | 9 | else {↵ | |
12 | expectedQueryString = titleField + "=" + titleValue + "&" + descriptionField + "=" + descriptionValue;↵ | 10 | expectedPostBody = titleField + "=" + titleValue + "&" + descriptionField + "=" + descriptionValue;↵ | |
13 | } | 11 |
| |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 29 |
Number of mapped statements | 7 |
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) | 50.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | assertEquals(sampler.getMethod(), res.getHTTPMethod()); |
| 3 | assertEquals(sampler.getUrl(), res.getURL()); | |||||||||||||||||||||
5 | String expectedQueryString = null; |
| 4 | String expectedPostBody = null; | |||||||||||||||||||||
6 | if (!valuesAlreadyUrlEncoded) | 5 | if (!valuesAlreadyUrlEncoded) | ||||||||||||||||||||||
7 | String expectedTitle = URLEncoder.encode(titleValue, contentEncoding); | 6 | String expectedTitle = URLEncoder.encode(titleValue, contentEncoding); | ||||||||||||||||||||||
8 | String expectedDescription = URLEncoder.encode(descriptionValue, contentEncoding); | 7 | String expectedDescription = URLEncoder.encode(descriptionValue, contentEncoding); | ||||||||||||||||||||||
9 | expectedQueryString = titleField + "=" + expectedTitle + "&" + descriptionField + "=" + expectedDescription; |
| 8 | expectedPostBody = titleField + "=" + expectedTitle + "&" + descriptionField + "=" + expectedDescription; | |||||||||||||||||||||
else | else | ||||||||||||||||||||||||
10 | expectedQueryString = titleField + "=" + titleValue + "&" + descriptionField + "=" + descriptionValue; |
| 9 | expectedPostBody = titleField + "=" + titleValue + "&" + descriptionField + "=" + descriptionValue; |
Row | Violation |
---|---|
1 | Type java.lang.String of variable sampler.getMethod() does not match with type java.net.URL of variable sampler.getUrl() |
2 | Type java.lang.String of variable res.getHTTPMethod() does not match with type java.net.URL of variable res.getURL() |