Package org.apache.jmeter.samplers

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


  /**
   * 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

   * (non-Javadoc)
   *
   * @see GenericController#nextIsAController(Controller)
   */
  protected Sampler nextIsAController(Controller controller) throws NextIsNullException {
    Sampler sampler = controller.next();
    if (sampler == null) {
      currentReturnedNull(controller);
      return next();
    }
    currentReturnedAtLeastOne = true;
View Full Code Here

      mod = new URLRewritingModifier();
      mod.setThreadContext(context);
    }

        public void testNonHTTPSampler() throws Exception {
            Sampler sampler = new NullSampler();
            response = new SampleResult();
            context.setCurrentSampler(sampler);
            context.setPreviousResult(response);
            mod.process();
        }
View Full Code Here

  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

          }
        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

 
  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

            // Assume success
            res.setSuccessful(true);
      res.sampleStart();
    }

        Sampler returnValue = super.next();
       
    if (returnValue == null) // Must be the end of the controller
    {
      if (res != null) {
        res.sampleEnd();
View Full Code Here

      log.debug("Calling next on: " + this.getClass().getName());
    }
    if (isDone()) {
      return null;
    }
    Sampler returnValue = null;
    try {
      TestElement currentElement = getCurrentElement();
      setCurrentElement(currentElement);
      if (currentElement == null) {
        // incrementCurrent();
View Full Code Here

   * @param controller
   * @return the next sampler
   * @throws NextIsNullException
   */
  protected Sampler nextIsAController(Controller controller) throws NextIsNullException {
    Sampler sampler = controller.next();
    if (sampler == null) {
      currentReturnedNull(controller);
      sampler = next();
    }
    return sampler;
View Full Code Here

TOP

Related Classes of org.apache.jmeter.samplers.Sampler

Copyright © 2018 www.massapicom. 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.