File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java | |||
Method name: void testSendFormData_Urlencoded()
|
Method name: void testSendFormData_Urlencoded()
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | establishConnection();↵ | 1 | establishConnection();↵ | |
2 | contentEncoding = "";↵ | 2 | contentEncoding = "ISO-8859-1";↵ | |
3 | sampler.setContentEncoding(contentEncoding); ↵ | 3 | sampler.setContentEncoding(contentEncoding); ↵ | |
4 | postWriter.setHeaders(connection, sampler);↵ | 4 | postWriter.setHeaders(connection, sampler);↵ | |
5 | postWriter.sendPostData(connection, sampler);↵ | 5 | postWriter.sendPostData(connection, sampler);↵ | |
6 | ↵ | 6 | ↵ | |
7 | checkContentTypeUrlEncoded(connection);↵ | 7 | checkContentTypeUrlEncoded(connection);↵ | |
8 | expectedUrl = new String("title=" + titleValue.replaceAll("%20", "+").replaceAll("%C3%85", "%C5") + "&description=" + descriptionValue.replaceAll("%C3%85", "%C5")).getBytes("US-ASCII");↵ | 8 | expectedUrl = new String("title=" + titleValue.replaceAll("%20", "+").replaceAll("%C3%85", "%C5") + "&description=" + descriptionValue.replaceAll("%C3%85", "%C5")).getBytes("US-ASCII");↵ | |
9 | checkContentLength(connection, expectedUrl.length);↵ | 9 | checkContentLength(connection, expectedUrl.length);↵ | |
10 | checkArraysHaveSameContent(expectedUrl, connection.getOutputStreamContent()); | 10 |
| |
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 | 65 |
Number of mapped statements | 9 |
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
79 | establishConnection(); | 90 | establishConnection(); | |||||||||||
80 | contentEncoding = ""; |
| 91 | contentEncoding = "ISO-8859-1"; | ||||||||||
81 | sampler.setContentEncoding(contentEncoding); | 92 | sampler.setContentEncoding(contentEncoding); | |||||||||||
82 | postWriter.setHeaders(connection, sampler); | 93 | postWriter.setHeaders(connection, sampler); | |||||||||||
83 | postWriter.sendPostData(connection, sampler); | 94 | postWriter.sendPostData(connection, sampler); | |||||||||||
84 | checkContentTypeUrlEncoded(connection); | 95 | checkContentTypeUrlEncoded(connection); | |||||||||||
85 | expectedUrl = new String("title=" + titleValue.replaceAll("%20", "+").replaceAll("%C3%85", "%C5") + "&description=" + descriptionValue.replaceAll("%C3%85", "%C5")).getBytes("US-ASCII"); | 96 | expectedUrl = new String("title=" + titleValue.replaceAll("%20", "+").replaceAll("%C3%85", "%C5") + "&description=" + descriptionValue.replaceAll("%C3%85", "%C5")).getBytes("US-ASCII"); | |||||||||||
86 | checkContentLength(connection, expectedUrl.length); | 97 | checkContentLength(connection, expectedUrl.length); | |||||||||||
87 | checkArraysHaveSameContent(expectedUrl, connection.getOutputStreamContent()); | 98 | checkArraysHaveSameContent(expectedUrl, connection.getOutputStreamContent()); |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables expectedUrl , while Clone fragment #2 returns variables contentEncoding, expectedUrl |