Examples of JMeterVariables


Examples of org.apache.jmeter.threads.JMeterVariables

        jmctx = JMeterContextService.getContext();
        assertion = new XMLSchemaAssertion();
        assertion.setThreadContext(jmctx);// This would be done by the run
                                            // command
        result = new SampleResult();
        vars = new JMeterVariables();
        jmctx.setVariables(vars);
        jmctx.setPreviousResult(result);
        // LoggingManager.setPriority("DEBUG","jmeter");
    }
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterVariables

                    + "</row>" + "</company-xmlext-query-ret>";
            result.setResponseData(data, null);
            result.setResponseHeaders("Header1: Value1\nHeader2: Value2");
            result.setResponseCode("abcd");
            result.setResponseMessage("The quick brown fox");
            vars = new JMeterVariables();
            jmctx.setVariables(vars);
            jmctx.setPreviousResult(result);
        }
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterVariables

    public void setUp() {
          jmctx = JMeterContextService.getContext();
          assertion = new SizeAssertion();
          assertion.setThreadContext(jmctx);
          assertion.setTestFieldResponseBody();
          vars = new JMeterVariables();
          jmctx.setVariables(vars);
          sample0 = new SampleResult();
          sample1 = new SampleResult();
          sample1.setResponseData(data1, null);
      }
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterVariables

            extractor.setRefName(VAL_NAME);
            extractor.setDefaultValue("Default");
            result = new SampleResult();
            data = "<book><preface title='Intro'>zero</preface><page>one</page><page>two</page><empty></empty><a><b></b></a></book>";
            result.setResponseData(data.getBytes("UTF-8"));
            vars = new JMeterVariables();
            jmctx.setVariables(vars);
            jmctx.setPreviousResult(result);
        }
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterVariables

        // Test sending data as UTF-8, where user defined variables are used
        // to set the value for form data
        JMeterUtils.setLocale(Locale.ENGLISH);
        TestPlan testPlan = new TestPlan();
        JMeterVariables vars = new JMeterVariables();
        vars.put("title_prefix", "a test\u00c5");
        vars.put("description_suffix", "the_end");
        JMeterContextService.getContext().setVariables(vars);
        JMeterContextService.getContext().setSamplingStarted(true);
        ValueReplacer replacer = new ValueReplacer();
        replacer.setUserDefinedVariables(testPlan.getUserDefinedVariables());
       
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterVariables

       
        // Test sending data as UTF-8, where user defined variables are used
        // to set the value for form data
        JMeterUtils.setLocale(Locale.ENGLISH);
        TestPlan testPlan = new TestPlan();
        JMeterVariables vars = new JMeterVariables();
        vars.put("title_prefix", "a test\u00c5");
        vars.put("description_suffix", "the_end");
        JMeterContextService.getContext().setVariables(vars);
        JMeterContextService.getContext().setSamplingStarted(true);
        ValueReplacer replacer = new ValueReplacer();
        replacer.setUserDefinedVariables(testPlan.getUserDefinedVariables());
       
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterVariables

        String name = "";
        if (currentSampler != null) { // will be null if function is used on TestPlan
            name = currentSampler.getName();
        }
        if (values.length > 0){
            JMeterVariables vars = getVariables();
            if (vars != null) {// May be null if function is used on TestPlan
                String varName = ((CompoundVariable) values[0]).execute().trim();
                if (varName.length() > 0) {
                    vars.put(varName, name);
                }
            }
        }
        return name;
    }
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterVariables

       
        // Test sending data as UTF-8, where user defined variables are used
        // to set the value for form data
        JMeterUtils.setLocale(Locale.ENGLISH);
        TestPlan testPlan = new TestPlan();
        JMeterVariables vars = new JMeterVariables();
        vars.put("title_prefix", "a test\u00c5");
        vars.put("description_suffix", "the_end");
        JMeterContextService.getContext().setVariables(vars);
        JMeterContextService.getContext().setSamplingStarted(true);
        ValueReplacer replacer = new ValueReplacer();
        replacer.setUserDefinedVariables(testPlan.getUserDefinedVariables());
       
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterVariables

        // Test sending data as UTF-8, where user defined variables are used
        // to set the value for form data
        JMeterUtils.setLocale(Locale.ENGLISH);
        TestPlan testPlan = new TestPlan();
        JMeterVariables vars = new JMeterVariables();
        vars.put("title_prefix", "a test\u00c5");
        vars.put("description_suffix", "the_end");
        JMeterContextService.getContext().setVariables(vars);
        JMeterContextService.getContext().setSamplingStarted(true);
        ValueReplacer replacer = new ValueReplacer();
        replacer.setUserDefinedVariables(testPlan.getUserDefinedVariables());
       
View Full Code Here

Examples of org.apache.jmeter.threads.JMeterVariables

        long rand = min + (long) (Math.random() * (max - min + 1));

        String randString = Long.toString(rand);

        if (varName != null) {
            JMeterVariables vars = getVariables();
            final String varTrim = varName.execute().trim();
            if (vars != null && varTrim.length() > 0){// vars will be null on TestPlan
                vars.put(varTrim, randString);
            }
        }

        return randString;

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.