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 testGetRequest()
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 151 |
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) | 10.7 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
37 | outputStream.write(secondChunk); | 49 | outputStream.write(secondChunk); | |
38 | response = new ByteArrayOutputStream(); | 50 | response = new ByteArrayOutputStream(); | |
39 | buffer = new byte[1024]; | 51 | buffer = new byte[1024]; | |
40 | length = 0; | 52 | length = 0; | |
41 | while ((length = inputStream.read(buffer)) != -1) | 53 | while ((length = inputStream.read(buffer)) != -1) | |
42 | response.write(buffer, 0, length); | 54 | response.write(buffer, 0, length); | |
43 | response.close(); | 55 | response.close(); | |
44 | mirroredResponse = getMirroredResponse(response.toByteArray()); | 56 | mirroredResponse = getMirroredResponse(response.toByteArray()); | |
45 | bos = new ByteArrayOutputStream(); | 57 | bos = new ByteArrayOutputStream(); | |
46 | bos.write(firstChunk); | 58 | bos.write(firstChunk); | |
47 | bos.write(secondChunk); | 59 | bos.write(secondChunk); | |
48 | bos.close(); | 60 | bos.close(); | |
49 | checkArraysHaveSameContent(bos.toByteArray(), mirroredResponse); | 61 | checkArraysHaveSameContent(bos.toByteArray(), mirroredResponse); | |
50 | clientSocket.close(); | 62 | clientSocket.close(); |
Row | Violation |
---|