File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/modifier/TestAnchorModifier.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/modifier/TestAnchorModifier.java | |||
Method name: void testSimpleFormParse()
|
Method name: void testBadCharParse()
|
|||
Number of AST nodes: 15 | Number of AST nodes: 15 | |||
1 | HTTPSamplerBase config = makeUrlConfig(".*index.html");↵ | 1 | HTTPSamplerBase config = makeUrlConfig(".*index.html");↵ | |
2 | config.addArgument("test", "g.*");↵ | 2 | config.addArgument("te$st", "g.*");↵ | |
3 | config.setMethod(HTTPSamplerBase.POST);↵ | 3 | config.setMethod(HTTPSamplerBase.POST);↵ | |
4 | HTTPSamplerBase context = makeContext("http://www.apache.org/subdir/previous.html");↵ | 4 | HTTPSamplerBase context = makeContext("http://www.apache.org/subdir/previous.html");↵ | |
5 | String responseText = "<html><head><title>Test page</title></head><body>"↵ | 5 | String responseText = "<html><head><title>Test page</title></head><body>"↵ | |
6 | + "<form action=\"index.html\" method=\"POST\">" + "<input type=\"checkbox\" name=\"test\""↵ | 6 | + "<form action=\"index.html\" method=\"POST\">" + "<input type=\"checkbox\" name=\"te$st\""↵ | |
7 | + " value=\"goto\">Goto index page</form></body></html>";↵ | 7 | + " value=\"goto\">Goto index page</form></body></html>";↵ | |
8 | HTTPSampleResult result = new HTTPSampleResult();↵ | 8 | HTTPSampleResult result = new HTTPSampleResult();↵ | |
9 | result.setResponseData(responseText.getBytes());↵ | 9 | result.setResponseData(responseText.getBytes());↵ | |
10 | result.setSampleLabel(context.toString());↵ | 10 | result.setSampleLabel(context.toString());↵ | |
11 | result.setURL(context.getUrl());↵ | 11 | result.setURL(context.getUrl());↵ | |
12 | jmctx.setCurrentSampler(context);↵ | 12 | jmctx.setCurrentSampler(context);↵ | |
13 | jmctx.setCurrentSampler(config);↵ | 13 | jmctx.setCurrentSampler(config);↵ | |
14 | jmctx.setPreviousResult(result);↵ | 14 | jmctx.setPreviousResult(result);↵ | |
15 | parser.process();↵ | 15 | parser.process();↵ | |
16 | assertEquals("http://www.apache.org/subdir/index.html", config.getUrl().toString());↵ | 16 | assertEquals("http://www.apache.org/subdir/index.html", config.getUrl().toString());↵ | |
17 | assertEquals("test=goto", config.getQueryString()); | 17 | assertEquals("te%24st=goto", config.getQueryString()); | |
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 137 |
Number of mapped statements | 15 |
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 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | HTTPSamplerBase config = makeUrlConfig(".*index.html"); | 1 | HTTPSamplerBase config = makeUrlConfig(".*index.html"); | |||||||||||
2 | config.addArgument("test", "g.*"); |
| 2 | config.addArgument("te$st", "g.*"); | ||||||||||
3 | config.setMethod(HTTPSamplerBase.POST); | 3 | config.setMethod(HTTPSamplerBase.POST); | |||||||||||
4 | HTTPSamplerBase context = makeContext("http://www.apache.org/subdir/previous.html"); | 4 | HTTPSamplerBase context = makeContext("http://www.apache.org/subdir/previous.html"); | |||||||||||
5 | String responseText = "<html><head><title>Test page</title></head><body>" + "<form action=\"index.html\" method=\"POST\">" + "<input type=\"checkbox\" name=\"test\"" + " value=\"goto\">Goto index page</form></body></html>"; |
| 5 | String responseText = "<html><head><title>Test page</title></head><body>" + "<form action=\"index.html\" method=\"POST\">" + "<input type=\"checkbox\" name=\"te$st\"" + " value=\"goto\">Goto index page</form></body></html>"; | ||||||||||
6 | HTTPSampleResult result = new HTTPSampleResult(); | 6 | HTTPSampleResult result = new HTTPSampleResult(); | |||||||||||
7 | result.setResponseData(responseText.getBytes()); | 7 | result.setResponseData(responseText.getBytes()); | |||||||||||
8 | result.setSampleLabel(context.toString()); | 8 | result.setSampleLabel(context.toString()); | |||||||||||
9 | result.setURL(context.getUrl()); | 9 | result.setURL(context.getUrl()); | |||||||||||
10 | jmctx.setCurrentSampler(context); | 10 | jmctx.setCurrentSampler(context); | |||||||||||
11 | jmctx.setCurrentSampler(config); | 11 | jmctx.setCurrentSampler(config); | |||||||||||
12 | jmctx.setPreviousResult(result); | 12 | jmctx.setPreviousResult(result); | |||||||||||
13 | parser.process(); | 13 | parser.process(); | |||||||||||
14 | assertEquals("http://www.apache.org/subdir/index.html", config.getUrl().toString()); | 14 | assertEquals("http://www.apache.org/subdir/index.html", config.getUrl().toString()); | |||||||||||
15 | assertEquals("test=goto", config.getQueryString()); |
| 15 | assertEquals("te%24st=goto", config.getQueryString()); |
Row | Violation |
---|