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