1 | HTTPSamplerBase config = makeUrlConfig("/subdir/index\\..*");↵ | | 1 | HTTPSamplerBase config = makeUrlConfig("/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>↵ | | 4 | + "<a href=\"/index.html\">Goto index page</a>" + "hfdfjiudfjdfjkjfkdjf"↵
|
5 | </body></html>";↵ | | 5 | + "<b>bold text</b><a href=lowerdir/index.html>lower</a>" + "</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 | String newUrl = config.getUrl().toString();↵ | | 14 | String newUrl = config.getUrl().toString();↵
|
15 | assertEquals(↵ | | 15 | assertTrue("http://www.apache.org/index.html".equals(newUrl)↵
|
16 | "http://www.apache.org/subdir/index.html", newUrl); | | 16 | || "http://www.apache.org/subdir/lowerdir/index.html".equals(newUrl));
|