Package org.apache.jmeter.samplers

Examples of org.apache.jmeter.samplers.Sampler


                    "Sample1", "Sample2", "Sample3" };
            int counter = 0;
            controller.setRunningVersion(true);
            ifCont.setRunningVersion(true);
           
            Sampler sampler = null;
            while ((sampler = controller.next()) != null) {
                sampler.sample(null);
                assertEquals(order[counter], sampler.getName());
                counter++;
            }
            assertEquals(counter, 6);
        }
View Full Code Here


                    "Sample1", "Sample2", "Sample3" };
            int counter = 0;
            controller.setRunningVersion(true);
            ifCont.setRunningVersion(true);
           
            Sampler sampler = null;
            while ((sampler = controller.next()) != null) {
                sampler.sample(null);
                if (sampler.getName().equals("Sample3")) {
                    ifCont.setCondition("true==false");
                }
                assertEquals(order[counter], sampler.getName());
                counter++;
            }
            assertEquals(counter, 6);
        }
View Full Code Here

            int counter = 0;
            controller.setRunningVersion(true);
            ifCont.setRunningVersion(true);
            genericCont.setRunningVersion(true);

            Sampler sampler = null;
            while ((sampler = controller.next()) != null) {
                sampler.sample(null);
                if (sampler.getName().equals("Sample3")) {
                    ifCont.setCondition("true==false");
                }
                assertEquals(order[counter], sampler.getName());
                counter++;
            }
            assertEquals(counter, 6);
        }
View Full Code Here

            }
        }

        // Get next sample and its name
        private String nextName(GenericController c) {
            Sampler s = c.next();
            if (s == null) {
                return null;
            }
            return s.getName();
        }
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

     * Modifies an entry object to replace the value of any url parameter that
     * matches a defined mask.
     *
     */
    public void process() {
        Sampler sam = getThreadContext().getCurrentSampler();
        HTTPSamplerBase sampler = null;
        if (!(sam instanceof HTTPSamplerBase)) {
            return;
        } else {
            sampler = (HTTPSamplerBase) sam;
View Full Code Here

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

     * 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

            }
            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

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.