@Override public synchronized void setParameters(Collection<CompoundVariable> parameters) throws InvalidVariableException { checkMinParameterCount(parameters, 3); values = parameters.toArray(); }
@Override public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { String str = getParameter(0); int begin = Integer.parseInt(getParameter(1).trim()); int len = Integer.parseInt(getParameter(2).trim()); String totalString = str.substring(begin, len); JMeterVariables vars = getVariables(); if (values.length > 3) { String varName = getParameter(3); if (vars != null && varName != null && varName.length() > 0) {// vars will be null on TestPlan vars.put(varName, totalString); } } return totalString; }
@Override public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { String str = getParameter(0); int begin = Integer.parseInt(getParameter(1).trim()); int len = Integer.parseInt(getParameter(2).trim()); String totalString = str.substring(begin, len); JMeterVariables vars = getVariables(); if (values.length > 3) { String varName = getParameter(3); if (vars != null && varName != null && varName.length() > 0) {// vars will be null on TestPlan vars.put(varName, totalString); } } return totalString; }
@Override public synchronized void setParameters(Collection<CompoundVariable> parameters) throws InvalidVariableException { checkMinParameterCount(parameters, 3); values = parameters.toArray(); }