Examples of JMeterContext


Examples of org.apache.jmeter.threads.JMeterContext

        super(arg0);
    }

    @Override
    public void setUp(){
        JMeterContext jmcx = JMeterContextService.getContext();
        jmcx.setVariables(new JMeterVariables());
        threadVars = jmcx.getVariables();       
        threadVars.put("b", "value");
    }
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterContext

     * @see org.apache.jmeter.processor.PostProcessor#process()
     */
    public void process()
    {
        initTemplate();
        JMeterContext context = getThreadContext();
        if (context.getPreviousResult() == null
            || context.getPreviousResult().getResponseData() == null)
        {
            return;
        }
        log.debug("RegexExtractor processing result");

        // Fetch some variables
    JMeterVariables vars = context.getVariables();
    String refName = getRefName();
    int matchNumber = getMatchNumber();

        vars.put(refName, getDefaultValue());
       
        Perl5Matcher matcher = (Perl5Matcher) localMatcher.get();
        PatternMatcherInput input =
            new PatternMatcherInput(
                useHeaders() ? context.getPreviousResult().getResponseHeaders()
                                 : new String(context.getPreviousResult().getResponseData())
        );
        log.debug("Regex = " + getRegex());
    try {
      Pattern pattern =
          patternCache.getPattern(getRegex(), Perl5Compiler.READ_ONLY_MASK);
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterContext

   /* (non-Javadoc)
     * @see org.apache.jmeter.control.Controller#isDone()
     */
    public boolean isDone()
    {
        JMeterContext context = getThreadContext();
      String inputVariable=getInputValString()+"_"+(loopCount+1);
      if (context.getVariables().get(inputVariable) != null)
      {
         context.getVariables().put(getReturnValString(), context.getVariables().get(inputVariable));
                   log.debug("ForEach resultstring isDone="+context.getVariables().get(getReturnValString()));
         return false;
      }
        return super.isDone();
    }
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterContext

        return super.isDone();
    }

    private boolean endOfArguments()
    {
        JMeterContext context = getThreadContext();
      String inputVariable=getInputValString()+"_"+(loopCount+1);
      if (context.getVariables().get(inputVariable) != null)
      {
           log.debug("ForEach resultstring eofArgs= false");
         return false;
      } else {
           log.debug("ForEach resultstring eofArgs= true");
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterContext

     * Check if there are any matching entries
     *
   * @return whethere any entries in the list
   */
  private boolean emptyList() {
        JMeterContext context = getThreadContext();
      String inputVariable=getInputValString()+"_1";
      if (context.getVariables().get(inputVariable) != null)
      {
         return false;
      }
      else
      {
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterContext

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

Examples of org.apache.jmeter.threads.JMeterContext

        return ret;
    }

    private JMeterVariables getVariables()
    {
        JMeterContext context = JMeterContextService.getContext();
        return context.getVariables();
    }
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterContext

        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.threads.JMeterContext

    /**
     * Add a cookie.
     */
    public void add(Cookie c)
    {
      JMeterContext context = getThreadContext();
        getCookies().addItem(c);
        if(context.isSamplingStarted())
        {
            context.getVariables().put(c.getName(),c.getValue());
        }
    }
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterContext

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