jmctx = JMeterContextService.getContext();
parser.setThreadContext(jmctx);
}
public void testProcessingHTMLFile(String HTMLFileName) throws Exception {
HTTPSamplerBase config = (HTTPSamplerBase) SaveService.loadTree(
new FileInputStream(System.getProperty("user.dir") + "/testfiles/load_bug_list.jmx")).getArray()[0];
config.setRunningVersion(true);
HTTPSampleResult result = new HTTPSampleResult();
HTTPSamplerBase context = (HTTPSamplerBase) SaveService.loadTree(
new FileInputStream(System.getProperty("user.dir") + "/testfiles/Load_JMeter_Page.jmx")).getArray()[0];
jmctx.setCurrentSampler(context);
jmctx.setCurrentSampler(config);
result.setResponseData(new TextFile(System.getProperty("user.dir") + HTMLFileName).getText(), null);
result.setSampleLabel(context.toString());
result.setSamplerData(context.toString());
result.setURL(new URL("http://issues.apache.org/fakepage.html"));
jmctx.setPreviousResult(result);
AnchorModifier modifier = new AnchorModifier();
modifier.setThreadContext(jmctx);
modifier.process();