/** * {@inheritDoc} */ @Override public synchronized void setParameters(Collection<CompoundVariable> parameters) throws InvalidVariableException { checkMinParameterCount(parameters, 3); values = parameters.toArray(); }
/** * {@inheritDoc} */ @Override public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { JMeterVariables vars = getVariables(); String varName = ((CompoundVariable) values[values.length - 1]).execute().trim(); int index = random.nextInt(values.length - 1); String choice = ((CompoundVariable) values[index]).execute(); if (vars != null && varName != null && varName.length() > 0) {// vars will be null on TestPlan vars.put(varName, choice); } return choice; }
/** * {@inheritDoc} */ @Override public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { JMeterVariables vars = getVariables(); String varName = ((CompoundVariable) values[values.length - 1]).execute().trim(); int index = random.nextInt(values.length - 1); String choice = ((CompoundVariable) values[index]).execute(); if (vars != null && varName != null && varName.length() > 0) {// vars will be null on TestPlan vars.put(varName, choice); } return choice; }
/** * {@inheritDoc} */ @Override public synchronized void setParameters(Collection<CompoundVariable> parameters) throws InvalidVariableException { checkMinParameterCount(parameters, 3); values = parameters.toArray(); }