1 | HTTPSamplerBase config = makeUrlConfig("/subdir/index\\..*");↵ | | 1 | HTTPSamplerBase config = makeUrlConfig("/subdir/index\\.h.*");↵
|
2 | HTTPSamplerBase context = makeContext("http://www.apache.org/subdir/previous.html");↵ | | 2 | HTTPSamplerBase context = makeContext("http://www.apache.org/subdir/one/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=\"../index.html\">Goto index page</a></body></html>";↵
|
5 | HTTPSampleResult result = new HTTPSampleResult();↵ | | 5 | HTTPSampleResult result = new HTTPSampleResult();↵
|
6 | result.setResponseData(responseText.getBytes());↵ | | 6 | result.setResponseData(responseText.getBytes());↵
|
7 | result.setSampleLabel(context.toString());↵ | | 7 | result.setSampleLabel(context.toString());↵
|
8 | result.setURL(context.getUrl());↵ | | 8 | result.setURL(context.getUrl());↵
|
9 | jmctx.setCurrentSampler(context);↵ | | 9 | jmctx.setCurrentSampler(context);↵
|
10 | jmctx.setCurrentSampler(config);↵ | | 10 | jmctx.setCurrentSampler(config);↵
|
11 | jmctx.setPreviousResult(result);↵ | | 11 | jmctx.setPreviousResult(result);↵
|
12 | parser.process();↵ | | 12 | parser.process();↵
|
13 | String newUrl = config.getUrl().toString();↵ | | 13 | String newUrl = config.getUrl().toString();↵
|
14 | assertEquals("http://www.apache.org/subdir/index.html", newUrl); | | 14 | assertEquals("http://www.apache.org/subdir/index.html", newUrl);
|