Examples of Sampler


Examples of org.apache.jmeter.samplers.Sampler

    // PreProcessors are cloned per-thread, so this will be saved per-thread
    private transient String savedValue = ""; // $NON-NLS-1$

    public void process() {
        JMeterContext ctx = getThreadContext();
        Sampler sampler = ctx.getCurrentSampler();
        if (!(sampler instanceof HTTPSamplerBase)) {// Ignore non-HTTP samplers
            return;
        }
        SampleResult responseText = ctx.getPreviousResult();
        if (responseText == null) {
View Full Code Here

Examples of org.apache.jmeter.samplers.Sampler

    /**
     * Modifies an Entry object based on HTML response text.
     */
    public void process() {
        JMeterContext context = getThreadContext();
        Sampler sam = context.getCurrentSampler();
        SampleResult res = context.getPreviousResult();
        HTTPSamplerBase sampler = null;
        HTTPSampleResult result = null;
        if (res == null || !(sam instanceof HTTPSamplerBase) || !(res instanceof HTTPSampleResult)) {
            log.info("Can't apply HTML Link Parser when the previous" + " sampler run is not an HTTP Request.");
View Full Code Here

Examples of org.apache.jmeter.samplers.Sampler

     * Modifies an entry object to replace the value of any url parameter that
     * matches a parameter name in the XML file.
     *
     */
    public void process() {
        Sampler entry = getThreadContext().getCurrentSampler();
        if (!(entry instanceof HTTPSamplerBase)) {
            return;
        }
        HTTPSamplerBase config = (HTTPSamplerBase) entry;
        Map<String, String> currentUser = allAvailableUsers.getNextUserMods();
View Full Code Here

Examples of org.apache.jmeter.samplers.Sampler

            }
            transactionSampler = new TransactionSampler(this, getName());
        }

        // Sample the children of the transaction
        Sampler subSampler = super.next();
        transactionSampler.setSubSampler(subSampler);
        // If we do not get any sub samplers, the transaction is done
        if (subSampler == null) {
            transactionSampler.setTransactionDone();
        }
View Full Code Here

Examples of org.apache.jmeter.samplers.Sampler

    @Override
    protected Sampler nextIsAController(Controller controller) throws NextIsNullException {
        if (!isParent()) {
            return super.nextIsAController(controller);
        }
        Sampler returnValue;
        Sampler sampler = controller.next();
        if (sampler == null) {
            currentReturnedNull(controller);
            // We need to call the super.next, instead of this.next, which is done in GenericController,
            // because if we call this.next(), it will return the TransactionSampler, and we do not want that.
            // We need to get the next real sampler or controller
View Full Code Here

Examples of org.apache.jmeter.samplers.Sampler

            res.sampleStart();
            prevEndTime = res.getStartTime();//???
            pauseTime = 0;
        }

        Sampler returnValue = super.next();

        if (returnValue == null) // Must be the end of the controller
        {
            if (res != null) {
                res.setIdleTime(pauseTime+res.getIdleTime());
View Full Code Here

Examples of org.apache.jmeter.samplers.Sampler

    public String execute() {
        if (isDynamic) {
            JMeterContext context = JMeterContextService.getContext();
            SampleResult previousResult = context.getPreviousResult();
            Sampler currentSampler = context.getCurrentSampler();
            return execute(previousResult, currentSampler);
        }
        return permanentResults; // $NON-NLS-1$
    }
View Full Code Here

Examples of org.apache.jmeter.samplers.Sampler

    abstract public String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException;

    public String execute() throws InvalidVariableException {
        JMeterContext context = JMeterContextService.getContext();
        SampleResult previousResult = context.getPreviousResult();
        Sampler currentSampler = context.getCurrentSampler();
        return execute(previousResult, currentSampler);
    }
View Full Code Here

Examples of org.apache.jmeter.samplers.Sampler

        if (entry == null)
        {
          running = false;
          break;
        }
        Sampler sampler = null;
        try
        {
          sampler = getSampler(entry);
        }
        catch (Exception ex)
        {
          ex.printStackTrace();
          running = false;
        }
        SampleResult result = sampler.sample(entry);
        checkAssertions(entry, result);
        notifyListeners(result);
      }
    }
  }
View Full Code Here

Examples of org.apache.jmeter.samplers.Sampler

  }

  private Sampler getSampler(Entry entry) throws Exception
  {
    Class sClass = entry.getSamplerClass();
    Sampler sampler = (Sampler)samplers.get(sClass);
    if (sampler == null)
    {
      sampler = (Sampler)sClass.newInstance();
      samplers.put(sClass, sampler);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.