Examples of CompoundVariable


Examples of org.apache.jmeter.engine.util.CompoundVariable

            assertEquals("times", vars.getObject("OUTVAR_g2"));
        }

        public void testVariableExtraction2() throws Exception {
            params = new LinkedList<CompoundVariable>();
            params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
            params.add(new CompoundVariable("$1$"));
            params.add(new CompoundVariable("3"));
            variable.setParameters(params);
            String match = variable.execute(result, null);
            assertEquals("pinposition3", match);
        }
View Full Code Here

Examples of org.apache.jmeter.engine.util.CompoundVariable

            assertEquals("pinposition3", match);
        }

        public void testVariableExtraction5() throws Exception {
            params = new LinkedList<CompoundVariable>();
            params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
            params.add(new CompoundVariable("$1$"));
            params.add(new CompoundVariable("ALL"));
            params.add(new CompoundVariable("_"));
            variable.setParameters(params);
            String match = variable.execute(result, null);
            assertEquals("pinposition1_pinposition2_pinposition3", match);
        }
View Full Code Here

Examples of org.apache.jmeter.engine.util.CompoundVariable

            assertEquals("pinposition1_pinposition2_pinposition3", match);
        }

        public void testVariableExtraction6() throws Exception {
            params = new LinkedList<CompoundVariable>();
            params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
            params.add(new CompoundVariable("$2$"));
            params.add(new CompoundVariable("4"));
            params.add(new CompoundVariable(""));
            params.add(new CompoundVariable("default"));
            variable.setParameters(params);
            String match = variable.execute(result, null);
            assertEquals("default", match);
        }
View Full Code Here

Examples of org.apache.jmeter.engine.util.CompoundVariable

            assertEquals("default", match);
        }

        public void testComma() throws Exception {
            params = new LinkedList<CompoundVariable>();
            params.add(new CompoundVariable("<value,? field=\"(pinposition\\d+)\">(\\d+)</value>"));
            params.add(new CompoundVariable("$1$"));
            params.add(new CompoundVariable("3"));
            variable.setParameters(params);
            String match = variable.execute(result, null);
            assertEquals("pinposition3", match);
        }
View Full Code Here

Examples of org.apache.jmeter.engine.util.CompoundVariable

            assertEquals("pinposition3", match);
        }

        public void testVariableExtraction3() throws Exception {
            params = new LinkedList<CompoundVariable>();
            params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
            params.add(new CompoundVariable("_$1$"));
            params.add(new CompoundVariable("2"));
            variable.setParameters(params);
            String match = variable.execute(result, null);
            assertEquals("_pinposition2", match);
        }
View Full Code Here

Examples of org.apache.jmeter.engine.util.CompoundVariable

            assertEquals("_pinposition2", match);
        }

        public void testVariableExtraction4() throws Exception {
            params = new LinkedList<CompoundVariable>();
            params.add(new CompoundVariable("<value field=\"(pinposition\\d+)\">(\\d+)</value>"));
            params.add(new CompoundVariable("$2$, "));
            params.add(new CompoundVariable(".333"));
            variable.setParameters(params);
            String match = variable.execute(result, null);
            assertEquals("1, ", match);
        }
View Full Code Here

Examples of org.apache.jmeter.engine.util.CompoundVariable

            assertEquals("1, ", match);
        }

        public void testDefaultValue() throws Exception {
            params = new LinkedList<CompoundVariable>();
            params.add(new CompoundVariable("<value,, field=\"(pinposition\\d+)\">(\\d+)</value>"));
            params.add(new CompoundVariable("$2$, "));
            params.add(new CompoundVariable(".333"));
            params.add(new CompoundVariable(""));
            params.add(new CompoundVariable("No Value Found"));
            variable.setParameters(params);
            String match = variable.execute(result, null);
            assertEquals("No Value Found", match);
        }
View Full Code Here

Examples of org.apache.jmeter.engine.util.CompoundVariable

    public void testParameterCount() throws Exception {
        checkInvalidParameterCounts(function, 1, 2);
    }

    public void testSum() throws Exception {
        params.add(new CompoundVariable("1+2+3"));
        function.setParameters(params);
        String ret = function.execute(result, null);
        assertEquals("6", ret);
    }
View Full Code Here

Examples of org.apache.jmeter.engine.util.CompoundVariable

        String ret = function.execute(result, null);
        assertEquals("6", ret);
    }

    public void testSumVar() throws Exception {
        params.add(new CompoundVariable("1+2+3"));
        params.add(new CompoundVariable("TOTAL"));
        function.setParameters(params);
        String ret = function.execute(result, null);
        assertEquals("6", ret);
        assertEquals("6", vars.get("TOTAL"));
    }
View Full Code Here

Examples of org.apache.jmeter.engine.util.CompoundVariable

        assertEquals("6", ret);
        assertEquals("6", vars.get("TOTAL"));
    }

    public void testReplace1() throws Exception {
        params.add(new CompoundVariable(
                "sampleResult.getResponseDataAsString().replaceAll('T','t')"));
        function.setParameters(params);
        String ret = function.execute(result, null);
        assertEquals("the quick brown fox", ret);
    }
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.