StringToObjectMap objects = new StringToObjectMap(context.getProperties());
objects.put("context", context);
objects.put("log", SoapUI.ensureGroovyLog());
if (context instanceof TestCaseRunContext) {
TestCaseRunContext testCaseRunContext = (TestCaseRunContext) context;
objects.put("testRunner", testCaseRunContext.getTestRunner());
objects.put("testStep", testCaseRunContext.getCurrentStep());
if (testCaseRunContext.getCurrentStep() instanceof SamplerTestStep) {
objects.put("request", ((SamplerTestStep) testCaseRunContext.getCurrentStep()).getTestRequest());
}
}
if (context instanceof LoadTestRunContext) {
objects.put("loadTestRunner", ((LoadTestRunContext) context).getLoadTestRunner());