/** * {@inheritDoc} */ @Override public synchronized void setParameters(Collection<CompoundVariable> parameters) throws InvalidVariableException { checkParameterCount(parameters, MIN_PARAMETER_COUNT, MAX_PARAMETER_COUNT); values = parameters.toArray(new CompoundVariable[0]); }
/** * {@inheritDoc} */ @Override public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { String propertyName = values[0].execute(); String propertyDefault = propertyName; if (values.length > 2) { // We have a 3rd parameter propertyDefault = values[2].execute(); } String propertyValue = JMeterPluginsUtils.getEnvDefault(propertyName, propertyDefault); if (values.length > 1) { String variableName = values[1].execute(); if (variableName.length() > 0) {// Allow for empty name final JMeterVariables variables = getVariables(); if (variables != null) { variables.put(variableName, propertyValue); } } } return propertyValue; }
/** * {@inheritDoc} */ @Override public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { String propertyName = values[0].execute(); String propertyDefault = propertyName; if (values.length > 2) { // We have a 3rd parameter propertyDefault = values[2].execute(); } String propertyValue = JMeterPluginsUtils.getEnvDefault(propertyName, propertyDefault); if (values.length > 1) { String variableName = values[1].execute(); if (variableName.length() > 0) {// Allow for empty name final JMeterVariables variables = getVariables(); if (variables != null) { variables.put(variableName, propertyValue); } } } return propertyValue; }
/** * {@inheritDoc} */ @Override public synchronized void setParameters(Collection<CompoundVariable> parameters) throws InvalidVariableException { checkParameterCount(parameters, MIN_PARAMETER_COUNT, MAX_PARAMETER_COUNT); values = parameters.toArray(new CompoundVariable[0]); }