1 | HTTPSamplerBase config = makeUrlConfig(".*/index\\.html");↵ | | 1 | HTTPSamplerBase config = makeUrlConfig(".*login\\.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);↵ | | |
|
7 | jmctx.setCurrentSampler(config);↵ | | |
|
8 | result.setResponseData(responseText.getBytes());↵ | | 6 | result.setResponseData(responseText.getBytes());↵
|
9 | result.setSampleLabel(context.toString());↵ | | 7 | result.setSampleLabel(context.toString());↵
|
10 | result.setSamplerData(context.toString());↵ | | 8 | result.setURL(context.getUrl());↵
|
11 | result.setURL(context.getUrl());↵ | | 9 | jmctx.setCurrentSampler(context);↵
|
12 | jmctx.setPreviousResult(result);↵ | | 10 | jmctx.setPreviousResult(result);↵
|
13 | parser.process();↵ | | 11 | parser.process();↵
|
14 | assertEquals(↵ | | 12 | String newUrl = config.getUrl().toString();↵
|
15 | "http://www.apache.org/subdir/index.html", ↵ | | 13 | assertTrue(!"http://www.apache.org/home/index.html?param1=value1".equals(newUrl));↵
|
16 | config.getUrl().toString()); | | 14 | assertEquals(config.getUrl().toString(), newUrl);
|