File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/functions/TestJexlFunction.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/sampler/PostWriterTest.java | |||
Method name: void setUp()
|
Method name: void setUp()
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | function = new JexlFunction();↵ | 1 | establishConnection();↵ | |
2 | result = new SampleResult();↵ | 2 | sampler = new HTTPSample↵ | |
3 | jmctx = JMeterContextService.getContext();↵ | |||
4 | String data = "The quick brown fox";↵ | |||
5 | result.setResponseData(data.getBytes());↵ | |||
6 | vars = new JMeterVariables();↵ | |||
7 | jmctx.setVariables(vars);↵ | |||
8 | jmctx.setPreviousResult(result);↵ | |||
9 | params = new LinkedList↵ | 3 | r();// This must be the original (Java) HTTP sampler↵ | |
4 | postWriter=new PostWriter();↵ | |||
5 | ↵ | |||
6 | // Create the test file content↵ | |||
7 | TEST_FILE_CONTENT = "foo content &?=01234+56789-\u007c\u2aa1\u266a\u0153\u20a1\u0115\u0364\u00c5\u2052".getBytes(UTF_8);↵ | |||
8 | // create a temporary file to make sure we always have a file to give to the PostWriter ↵ | |||
9 | // Whereever we are or Whatever the current path is.↵ | |||
10 | temporaryFile = File.createTempFile("foo", "txt");↵ | |||
11 | OutputStream output = new FileOutputStream(temporaryFile);↵ | |||
12 | output.write(TEST_FILE_CONTENT);↵ | |||
13 | output.flush();↵ | |||
10 | (); | 14 | output.close(); | |
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 different classes having the same super class |
Number of node comparisons | 81 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 8 |
Number of unmapped statements in the second code fragment | 8 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | function = new JexlFunction(); | | ||||||||||||||||||||||
| 2 | sampler = new HTTPSampler(); | ||||||||||||||||||||||
2 | result = new SampleResult(); | | ||||||||||||||||||||||
| 3 | postWriter = new PostWriter(); | ||||||||||||||||||||||
3 | jmctx = JMeterContextService.getContext(); | | ||||||||||||||||||||||
| 4 | TEST_FILE_CONTENT = "foo content &?=01234+56789-\u007c\u2aa1\u266a\u0153\u20a1\u0115\u0364\u00c5\u2052".getBytes(UTF_8); | ||||||||||||||||||||||
4 | String data = "The quick brown fox"; | | ||||||||||||||||||||||
5 | result.setResponseData(data.getBytes()); |
| 1 | establishConnection(); | ||||||||||||||||||||
| 5 | temporaryFile = File.createTempFile("foo", "txt"); | ||||||||||||||||||||||
| 6 | OutputStream output = new FileOutputStream(temporaryFile); | ||||||||||||||||||||||
6 | vars = new JMeterVariables(); | | ||||||||||||||||||||||
| 7 | output.write(TEST_FILE_CONTENT); | ||||||||||||||||||||||
7 | jmctx.setVariables(vars); | | ||||||||||||||||||||||
| 8 | output.flush(); | ||||||||||||||||||||||
8 | jmctx.setPreviousResult(result); | | ||||||||||||||||||||||
| 9 | output.close(); | ||||||||||||||||||||||
9 | params = new LinkedList(); | |
Row | Violation |
---|---|
1 | Expression result.setResponseData(data.getBytes()) is a void method call, and thus it cannot be parameterized |
2 | Expression establishConnection() is a void method call, and thus it cannot be parameterized |
3 | Expression result.setResponseData(data.getBytes()) is a void method call, and thus it cannot be parameterized |
4 | Expression establishConnection() is a void method call, and thus it cannot be parameterized |