1 | HTTPSamplerBase config = makeUrlConfig(".*/index\\.html↵ | | 1 | HTTPSamplerBase config = makeUrlConfig(".*index.*");↵
|
2 | ");↵ | | 2 | config.getArguments().addArgument("param1", "value1");↵
|
3 | HTTPSamplerBase context = makeContext("http://www.apache.org/subdir/previous.html");↵ | | 3 | HTTPSamplerBase context = makeContext("http://www.apache.org/subdir/previous.html");↵
|
4 | String responseText = "<html><head><title>Test page</title></head><body>"↵ | | 4 | String responseText = "<html><head><title>Test page</title></head><body>"↵
|
5 | + "<a href=\"index.html\">Goto index page</a></body></html>";↵ | | 5 | + "<a href=\"/home/index.html?param1=value1\">" + "Goto index page</a></body></html>";↵
|
6 | HTTPSampleResult result = new HTTPSampleResult();↵ | | 6 | HTTPSampleResult result = new HTTPSampleResult();↵
|
7 | jmctx.setCurrentSampler(context);↵ | | |
|
8 | jmctx.setCurrentSampler(config);↵ | | |
|
9 | result.setResponseData(responseText.getBytes());↵ | | 7 | result.setResponseData(responseText.getBytes());↵
|
10 | result.setSampleLabel(context.toString());↵ | | 8 | result.setSampleLabel(context.toString());↵
|
11 | result.setSamplerData(context.toString());↵ | | 9 | result.setURL(context.getUrl());↵
|
12 | result.setURL(context.getUrl()↵ | | 10 | jmctx.setCurrentSampler(context);↵
|
13 | );↵ | | 11 | jmctx.setCurrentSampler(config);↵
|
14 | jmctx.setPreviousResult(result);↵ | | 12 | jmctx.setPreviousResult(result);↵
|
15 | parser.process();↵ | | 13 | parser.process();↵
|
| | | 14 | String newUrl = config.getUrl().toString();↵
|
16 | assertEquals("http://www.apache.org/subdir/index.html", config.getUrl().toString()); | | 15 | assertEquals("http://www.apache.org/home/index.html?param1=value1", newUrl);
|