Examples of Sampler


Examples of org.apache.jmeter.samplers.Sampler

  }

  public byte[] sampleServer(Entry entry) throws IllegalAccessException,
      InstantiationException
  {
    Sampler sampler = (Sampler)entry.getSamplerClass().newInstance();
    SampleResult result = sampler.sample(entry);
    return (byte[])result.getValue(SampleResult.TEXT_RESPONSE);
  }
View Full Code Here

Examples of org.apache.jmeter.samplers.Sampler

     * matches a parameter name in the XML file.
     *
     */
    public void process()
    {
        Sampler entry = getThreadContext().getCurrentSampler();
        if (!(entry instanceof HTTPSampler))
        {
            return;
        }
        HTTPSampler config = (HTTPSampler) entry;
View Full Code Here

Examples of org.apache.jmeter.samplers.Sampler

     * matches a defined mask.
     *
     */
    public void process()
    {
        Sampler sam = getThreadContext().getCurrentSampler();
        HTTPSampler sampler = null;
        if (!(sam instanceof HTTPSampler))
        {
            return;
        }
View Full Code Here

Examples of org.apache.jmeter.samplers.Sampler

        "path_extension_no_equals";

    public void process()
    {
      JMeterContext ctx = getThreadContext();
        Sampler sampler = ctx.getCurrentSampler();
        SampleResult responseText = ctx.getPreviousResult();
        if(responseText == null)
        {
            return;
        }
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();
        HTTPSampler sampler = null;
        HTTPSampleResult result = null;
        if (res == null
            || !(sam instanceof HTTPSampler)
View Full Code Here

Examples of org.apache.jmeter.samplers.Sampler

            controller.addIterationListener(new IterationListener());
            threadContext.setSamplingStarted(true);
            threadStarted();
            while (running)
            {
                Sampler sam;
                while (running && (sam=controller.next())!=null)
                {
                    try
                    {
                        threadContext.setCurrentSampler(sam);
                        SamplePackage pack = compiler.configureSampler(sam);
                       
                        //Hack: save the package for any transaction controllers
                        threadContext.getVariables().putObject(PACKAGE_OBJECT,pack);
                       
                        delay(pack.getTimers());
                        Sampler sampler= pack.getSampler();
                        sampler.setThreadContext(threadContext);
                        sampler.setThreadName(threadName);
                        if (sampler instanceof TestBean) ((TestBean)sampler).prepare();              
                        SampleResult result = sampler.sample(null); // TODO: remove this useless Entry parameter
                        result.setThreadName(threadName);
                        threadContext.setPreviousResult(result);
                        runPostProcessors(pack.getPostProcessors());
                        checkAssertions(pack.getAssertions(), result);
                        notifyListeners(pack.getSampleListeners(), result);
View Full Code Here

Examples of org.apache.jmeter.samplers.Sampler

     *    - if isDone is true
     *    - if its the first time this is run. The first time is special
     *       cause it is called prior the iteration even starts !
     */
    public Sampler next() {
      Sampler currentElement = super.next();

      if (!isDone()) {
          return currentElement;
      } else {
          return null;
View Full Code Here

Examples of org.apache.jmeter.samplers.Sampler

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

Examples of org.apache.jmeter.samplers.Sampler

    }

    protected Sampler nextIsAController(Controller controller)
        throws NextIsNullException
    {
        Sampler returnValue;
        Sampler sampler = controller.next();
        if (sampler == null)
        {
            currentReturnedNull(controller);
            returnValue = next();
        }
View Full Code Here

Examples of org.apache.jmeter.samplers.Sampler

   ***************************************/
  public SamplePackage configureSampler(Sampler sampler)
  {
    currentSampler = sampler;
    SamplePackage ret = new SamplePackage();
    Sampler clonedSampler = sampler;
    SamplerConfigs configs = (SamplerConfigs)samplerConfigMap.get(sampler);
    if(sampler instanceof PerSampleClonable)
    {
      clonedSampler = (Sampler)sampler.clone();
    }
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.