checkContentLength(connection, expectedUrl.length);
checkArraysHaveSameContent(expectedUrl, connection.getOutputStreamContent());
assertEquals(
URLDecoder.decode(new String(expectedUrl, "US-ASCII"), "ISO-8859-1"),
URLDecoder.decode(new String(connection.getOutputStreamContent(), "US-ASCII"), "ISO-8859-1"));
connection.disconnect();
checkContentLength(connection, expectedUrl.length);
checkArraysHaveSameContent(expectedUrl, connection.getOutputStreamContent());
assertEquals(
URLDecoder.decode(new String(expectedUrl, "US-ASCII"), "ISO-8859-1"), // HTTPSampler uses ISO-8859-1 as default encoding
URLDecoder.decode(new String(connection.getOutputStreamContent(), "US-ASCII"), "ISO-8859-1")); // HTTPSampler uses ISO-8859-1 as default encoding
connection.disconnect();
Clone fragments detected by clone detection tool
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: 4
|
|
Number of AST nodes: 4
|
|
1 | checkContentLength(connection, expectedUrl.length);↵ | | 1 | checkContentLength(connection, expectedUrl.length);↵
|
2 | checkArraysHaveSameContent(expectedUrl, connection.getOutputStreamContent());↵ | | 2 | checkArraysHaveSameContent(expectedUrl, connection.getOutputStreamContent());↵
|
3 | assertEquals(↵ | | 3 | assertEquals(↵
|
4 | URLDecoder.decode(new String(expectedUrl, "US-ASCII"), "ISO-8859-1"), ↵ | | 4 | URLDecoder.decode(new String(expectedUrl, "US-ASCII"), "ISO-8859-1"), // HTTPSampler uses ISO-8859-1 as default encoding↵
|
5 | URLDecoder.decode(new String(connection.getOutputStreamContent(), "US-ASCII"), "ISO-8859-1")); ↵ | | 5 | URLDecoder.decode(new String(connection.getOutputStreamContent(), "US-ASCII"), "ISO-8859-1")); // HTTPSampler uses ISO-8859-1 as default encoding↵
|
6 | connection.disconnect(); | | 6 | connection.disconnect();
|
See real code fragment |
|
See real code fragment |
Summary
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 | 16 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
10 | checkContentLength(connection, expectedUrl.length); | | 86 | checkContentLength(connection, expectedUrl.length); |
11 | checkArraysHaveSameContent(expectedUrl, connection.getOutputStreamContent()); | | 87 | checkArraysHaveSameContent(expectedUrl, connection.getOutputStreamContent()); |
12 | assertEquals(URLDecoder.decode(new String(expectedUrl, "US-ASCII"), "ISO-8859-1"), URLDecoder.decode(new String(connection.getOutputStreamContent(), "US-ASCII"), "ISO-8859-1")); | | 88 | assertEquals(URLDecoder.decode(new String(expectedUrl, "US-ASCII"), "ISO-8859-1"), URLDecoder.decode(new String(connection.getOutputStreamContent(), "US-ASCII"), "ISO-8859-1")); |
13 | connection.disconnect(); | | 89 | connection.disconnect(); |
Precondition Violations (0)
Row |
Violation |