/** * Process the file or script from the test element. * <p> * Sets the following script variables: * <ul> * <li>FileName</li> * <li>Parameters</li> * <li>bsh.args</li> * </ul> * @param bsh the interpreter, not {@code null} * @return the result of the script, may be {@code null} * * @throws JMeterException when working with the bsh fails */ protected Object processFileOrScript(BeanShellInterpreter bsh) throws JMeterException{ String fileName = getFilename(); String params = getParameters(); bsh.set("FileName", fileName);//$NON-NLS-1$ // Set params as a single line bsh.set("Parameters", params); // $NON-NLS-1$ // and set as an array bsh.set("bsh.args",//$NON-NLS-1$ JOrphanUtils.split(params, " "));//$NON-NLS-1$ if (fileName.length() == 0) { return bsh.eval(getScript()); } return bsh.source(fileName); }