File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/control/TestHTTPMirrorThread.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/control/TestHTTPMirrorThread.java | |||
Method name: void testPostRequest()
|
Method name: void testPostRequest()
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
1 | outputStream.write(secondChunk);↵ | 1 | outputStream.write(secondChunk);↵ | |
2 | // Read the response↵ | 2 | // Read the response↵ | |
3 | response = new ByteArrayOutputStream(); ↵ | 3 | response = new ByteArrayOutputStream(); ↵ | |
4 | buffer = new byte[1024];↵ | 4 | buffer = new byte[1024];↵ | |
5 | length = 0;↵ | 5 | length = 0;↵ | |
6 | while((length = inputStream.read(buffer)) != -1) {↵ | 6 | while((length = inputStream.read(buffer)) != -1) {↵ | |
7 | response.write(buffer, 0, length);↵ | 7 | response.write(buffer, 0, length);↵ | |
8 | }↵ | 8 | }↵ | |
9 | response.close();↵ | 9 | response.close();↵ | |
10 | mirroredResponse = getMirroredResponse(response.toByteArray());↵ | 10 | mirroredResponse = getMirroredResponse(response.toByteArray());↵ | |
11 | // The content sent↵ | 11 | // The content sent↵ | |
12 | bos = new ByteArrayOutputStream();↵ | 12 | bos = new ByteArrayOutputStream();↵ | |
13 | bos.write(firstChunk);↵ | 13 | bos.write(firstChunk);↵ | |
14 | bos.write(secondChunk);↵ | 14 | bos.write(secondChunk);↵ | |
15 | bos.close(); ↵ | 15 | bos.close();↵ | |
16 | // Check that the request and response matches↵ | 16 | // Check that the request and response matches ↵ | |
17 | checkArraysHaveSameContent(bos.toByteArray(), mirroredResponse);↵ | 17 | checkArraysHaveSameContent(bos.toByteArray(), mirroredResponse);↵ | |
18 | // Close the connection↵ | 18 | // Close the connection↵ | |
19 | clientSocket.close(); | 19 |
| |
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.3 |
Clones location | Clones are in the same method |
Number of node comparisons | 153 |
Number of mapped statements | 14 |
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) | 19.5 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
49 | outputStream.write(secondChunk); | 86 | outputStream.write(secondChunk); | |
50 | response = new ByteArrayOutputStream(); | 87 | response = new ByteArrayOutputStream(); | |
51 | buffer = new byte[1024]; | 88 | buffer = new byte[1024]; | |
52 | length = 0; | 89 | length = 0; | |
53 | while ((length = inputStream.read(buffer)) != -1) | 90 | while ((length = inputStream.read(buffer)) != -1) | |
54 | response.write(buffer, 0, length); | 91 | response.write(buffer, 0, length); | |
55 | response.close(); | 92 | response.close(); | |
56 | mirroredResponse = getMirroredResponse(response.toByteArray()); | 93 | mirroredResponse = getMirroredResponse(response.toByteArray()); | |
57 | bos = new ByteArrayOutputStream(); | 94 | bos = new ByteArrayOutputStream(); | |
58 | bos.write(firstChunk); | 95 | bos.write(firstChunk); | |
59 | bos.write(secondChunk); | 96 | bos.write(secondChunk); | |
60 | bos.close(); | 97 | bos.close(); | |
61 | checkArraysHaveSameContent(bos.toByteArray(), mirroredResponse); | 98 | checkArraysHaveSameContent(bos.toByteArray(), mirroredResponse); | |
62 | clientSocket.close(); | 99 | clientSocket.close(); |
Row | Violation |
---|