File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/modifier/TestURLRewritingModifier.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/modifier/TestURLRewritingModifier.java | |||
Method name: void testGrabSessionId()
|
Method name: void testGrabSessionIdURLinJSON()
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | String html = "location: http://server.com/index.html" + "?↵ | 1 | String html = ↵ | |
2 | session_id=jfdkjdkf%20jddkfdfjkdjfdf%22;";↵ | 2 | "<a href=\"#\" onclick=\"$(\'frame\').src=\'/index?param1=bla&sessionid=xyzxyzxyz\\'";↵ | |
3 | response = new SampleResult();↵ | 3 | response = new SampleResult();↵ | |
4 | response.setResponseData(html.getBytes());↵ | 4 | response.setResponseData(html.getBytes());↵ | |
5 | mod.setArgumentName("session_id");↵ | 5 | mod.setArgumentName("sessionid");↵ | |
6 | HTTPSamplerBase sampler = createSampler();↵ | 6 | HTTPSamplerBase sampler = createSampler();↵ | |
7 | sampler.addArgument("session_id", "adfasdfdsafasdfasd");↵ | 7 | sampler.addArgument("sessionid", "xyzxyzxyz");↵ | |
8 | context.setCurrentSampler(sampler);↵ | 8 | context.setCurrentSampler(sampler);↵ | |
9 | context.setPreviousResult(response);↵ | 9 | context.setPreviousResult(response);↵ | |
10 | mod.process();↵ | 10 | mod.process();↵ | |
11 | Arguments args = sampler.getArguments();↵ | 11 | Arguments args = sampler.getArguments();↵ | |
12 | assertEquals("jfdkjdkf jddkfdfjkdjfdf\"", ((Argument) args.getArguments().get(0).getObjectValue())↵ | 12 | assertEquals("xyzxyzxyz", ((Argument) args.getArguments().get(0).getObjectValue())↵ | |
13 | .getValue()); | 13 |
| |
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 declared in the same class |
Number of node comparisons | 101 |
Number of mapped statements | 11 |
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 2 |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables sampler , while Clone fragment #2 returns variables |