File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplers.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/samplers/TestSampleResult.java | |||
Method name: void testArgumentWithoutEquals()
|
Method name: void testByteCount()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 7 | |||
1 | HTTPSamplerBase sampler = new HTTPNullSampler();↵ | 1 | Sample↵ | |
2 | sampler.setProtocol("http"↵ | 2 | Result res = new SampleResult();↵ | |
3 | ↵ | |||
3 | );↵ | 4 | res.sampleStart();↵ | |
4 | sampler.setMethod(HTTPSamplerBase.GET);↵ | 5 | res.setBytes(100);↵ | |
5 | sampler.setPath("/index.html?pear");↵ | 6 | res.setSampleLabel("sample of size 100 bytes");↵ | |
6 | sampler.setDomain("www.apache.org");↵ | 7 | res.sample↵ | |
7 | assertEquals("http://www.apache.org/index.html?pear", sampler.getUrl().toString↵ | 8 | End();↵ | |
9 | assertEquals(100, res.getBytes());↵ | |||
8 | ()); | 10 | assertEquals("sample of size 100 bytes", res.getSampleLabel()); | |
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 | 42 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | SampleResult res = new SampleResult(); | ||||||||||||||||||||||
1 | HTTPSamplerBase sampler = new HTTPNullSampler(); | | ||||||||||||||||||||||
| 2 | res.sampleStart(); | ||||||||||||||||||||||
| 3 | res.setBytes(100); | ||||||||||||||||||||||
| 4 | res.setSampleLabel("sample of size 100 bytes"); | ||||||||||||||||||||||
2 | sampler.setProtocol("http"); |
| 7 | assertEquals("sample of size 100 bytes", res.getSampleLabel()); | ||||||||||||||||||||
3 | sampler.setMethod(HTTPSamplerBase.GET); |
| 6 | assertEquals(100, res.getBytes()); | ||||||||||||||||||||
4 | sampler.setPath("/index.html?pear"); | | ||||||||||||||||||||||
5 | sampler.setDomain("www.apache.org"); | | ||||||||||||||||||||||
6 | assertEquals("http://www.apache.org/index.html?pear", sampler.getUrl().toString()); |
| 5 | res.sampleEnd(); |
Row | Violation |
---|---|
1 | Expression sampler.setProtocol("http") is a void method call, and thus it cannot be parameterized |
2 | Expression assertEquals("sample of size 100 bytes",res.getSampleLabel()) is a void method call, and thus it cannot be parameterized |
3 | Expression sampler.setProtocol("http") is a void method call, and thus it cannot be parameterized |
4 | Expression assertEquals("sample of size 100 bytes",res.getSampleLabel()) is a void method call, and thus it cannot be parameterized |
5 | Expression sampler.setMethod(HTTPSamplerBase.GET) is a void method call, and thus it cannot be parameterized |
6 | Expression assertEquals(100,res.getBytes()) is a void method call, and thus it cannot be parameterized |
7 | Expression sampler.setMethod(HTTPSamplerBase.GET) is a void method call, and thus it cannot be parameterized |
8 | Expression assertEquals(100,res.getBytes()) is a void method call, and thus it cannot be parameterized |
9 | Expression assertEquals("http://www.apache.org/index.html?pear",sampler.getUrl().toString()) is a void method call, and thus it cannot be parameterized |
10 | Expression res.sampleEnd() is a void method call, and thus it cannot be parameterized |
11 | Expression assertEquals("http://www.apache.org/index.html?pear",sampler.getUrl().toString()) is a void method call, and thus it cannot be parameterized |
12 | Expression res.sampleEnd() is a void method call, and thus it cannot be parameterized |