Search in sources :

Example 96 with JMeterVariables

use of org.apache.jmeter.threads.JMeterVariables in project jmeter by apache.

the class UserParameters method setValues.

@SuppressWarnings("SynchronizeOnNonFinalField")
private void setValues() {
    synchronized (lock) {
        if (log.isDebugEnabled()) {
            //$NON-NLS-1$
            log.debug("{} Running up named: {}", Thread.currentThread().getName(), getName());
        }
        PropertyIterator namesIter = getNames().iterator();
        PropertyIterator valueIter = getValues().iterator();
        JMeterVariables jmvars = getThreadContext().getVariables();
        while (namesIter.hasNext() && valueIter.hasNext()) {
            String name = namesIter.next().getStringValue();
            String value = valueIter.next().getStringValue();
            if (log.isDebugEnabled()) {
                //$NON-NLS-1$
                log.debug("{} saving variable: {}={}", Thread.currentThread().getName(), name, value);
            }
            jmvars.put(name, value);
        }
    }
}
Also used : JMeterVariables(org.apache.jmeter.threads.JMeterVariables) PropertyIterator(org.apache.jmeter.testelement.property.PropertyIterator)

Aggregations

JMeterVariables (org.apache.jmeter.threads.JMeterVariables)96 SampleResult (org.apache.jmeter.samplers.SampleResult)35 JMeterContext (org.apache.jmeter.threads.JMeterContext)33 Before (org.junit.Before)33 CompoundVariable (org.apache.jmeter.engine.util.CompoundVariable)17 Test (org.junit.Test)16 JSONPostProcessor (org.apache.jmeter.extractor.json.jsonpath.JSONPostProcessor)8 TestPlan (org.apache.jmeter.testelement.TestPlan)6 HashMap (java.util.HashMap)5 Sampler (org.apache.jmeter.samplers.Sampler)5 IOException (java.io.IOException)4 ArrayList (java.util.ArrayList)4 ValueReplacer (org.apache.jmeter.engine.util.ValueReplacer)4 Properties (java.util.Properties)3 TestSampler (org.apache.jmeter.junit.stubs.TestSampler)3 Logger (org.slf4j.Logger)3 URL (java.net.URL)2 Arguments (org.apache.jmeter.config.Arguments)2 ReplaceStringWithFunctions (org.apache.jmeter.engine.util.ReplaceStringWithFunctions)2 HTTPArgument (org.apache.jmeter.protocol.http.util.HTTPArgument)2