All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kg.apc.jmeter.functions.IterationNum Maven / Gradle / Ivy

There is a newer version: 2.2
Show newest version
package kg.apc.jmeter.functions;

import org.apache.jmeter.engine.util.CompoundVariable;
import org.apache.jmeter.functions.AbstractFunction;
import org.apache.jmeter.functions.InvalidVariableException;
import org.apache.jmeter.samplers.SampleResult;
import org.apache.jmeter.samplers.Sampler;

import java.util.Collection;
import java.util.LinkedList;
import java.util.List;

public class IterationNum extends AbstractFunction {

    private static final List desc = new LinkedList();
    private static final String KEY = "__iterationNum";

    @Override
    public synchronized String execute(SampleResult previousResult, Sampler currentSampler)
            throws InvalidVariableException {
        return String.valueOf(getVariables().getIteration());

    }

    @Override
    public synchronized void setParameters(Collection parameters) throws InvalidVariableException {
    }

    @Override
    public String getReferenceKey() {
        return KEY;
    }

    @Override
    public List getArgumentDesc() {
        return desc;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy