Package org.apache.jmeter.engine.util

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


    // Create the CSVRead function and set its parameters.
    private static CSVRead setCSVReadParams(String p1, String p2) throws Exception {
        CSVRead cr = new CSVRead();
        Collection<CompoundVariable> parms = new LinkedList<CompoundVariable>();
        if (p1 != null) {
            parms.add(new CompoundVariable(p1));
        }
        if (p2 != null) {
            parms.add(new CompoundVariable(p2));
        }
        cr.setParameters(parms);
        return cr;
    }
View Full Code Here


    // Create the StringFromFile function and set its parameters.
    private static StringFromFile SFFParams(String p1, String p2, String p3, String p4) throws Exception {
        StringFromFile sff = new StringFromFile();
        Collection<CompoundVariable> parms = new LinkedList<CompoundVariable>();
        if (p1 != null) {
            parms.add(new CompoundVariable(p1));
        }
        if (p2 != null) {
            parms.add(new CompoundVariable(p2));
        }
        if (p3 != null) {
            parms.add(new CompoundVariable(p3));
        }
        if (p4 != null) {
            parms.add(new CompoundVariable(p4));
        }
        sff.setParameters(parms);
        return sff;
    }
View Full Code Here

    // Create the SplitFile function and set its parameters.
    private static SplitFunction SplitParams(String p1, String p2, String p3) throws Exception {
        SplitFunction split = new SplitFunction();
        Collection<CompoundVariable> parms = new LinkedList<CompoundVariable>();
        parms.add(new CompoundVariable(p1));
        if (p2 != null) {
            parms.add(new CompoundVariable(p2));
        }
        if (p3 != null) {
            parms.add(new CompoundVariable(p3));
        }
        split.setParameters(parms);
        return split;
    }
View Full Code Here

    }

    private static Collection<CompoundVariable> MakeParams(String p1, String p2, String p3) {
        Collection<CompoundVariable> parms = new LinkedList<CompoundVariable>();
        if (p1 != null) {
            parms.add(new CompoundVariable(p1));
        }
        if (p2 != null) {
            parms.add(new CompoundVariable(p2));
        }
        if (p3 != null) {
            parms.add(new CompoundVariable(p3));
        }
        return parms;
    }
View Full Code Here

        }
    }

    private XPath setupXPath(String file, String expr) throws Exception{
        Collection<CompoundVariable> parms = new LinkedList<CompoundVariable>();
        parms.add(new CompoundVariable(file));
        parms.add(new CompoundVariable(expr));
        XPath xp = new XPath();
        xp.setParameters(parms);
        return xp;       
    }
View Full Code Here

   
    // Perform a sum and check the results
    private void checkSum(AbstractFunction func, String value, String [] addendsthrows Exception {
        Collection<CompoundVariable> parms = new LinkedList<CompoundVariable>();
        for (int i=0; i< addends.length; i++){
            parms.add(new CompoundVariable(addends[i]));
        }
        parms.add(new CompoundVariable("Result"));
        func.setParameters(parms);
        assertEquals(value,func.execute(null,null));
        assertEquals(value,vars.getObject("Result"));      
    }
View Full Code Here

    }
    // Perform a sum and check the results
    private void checkSumNoVar(AbstractFunction func, String value, String [] addendsthrows Exception {
        Collection<CompoundVariable> parms = new LinkedList<CompoundVariable>();
        for (int i=0; i< addends.length; i++){
            parms.add(new CompoundVariable(addends[i]));
        }
        func.setParameters(parms);
        assertEquals(value,func.execute(null,null));
    }
View Full Code Here

            long after = System.currentTimeMillis();
            assertTrue(now >= before && now <= after);
        }
       
        public void testDefault1() throws Exception {
            params.add(new CompoundVariable());
            variable.setParameters(params);
            long before = System.currentTimeMillis();
            value = variable.execute(result, null);
            long now= Long.parseLong(value);
            long after = System.currentTimeMillis();
View Full Code Here

            long after = System.currentTimeMillis();
            assertTrue(now >= before && now <= after);
        }
       
        public void testDefault2() throws Exception {
            params.add(new CompoundVariable());
            params.add(new CompoundVariable());
            variable.setParameters(params);
            long before = System.currentTimeMillis();
            value = variable.execute(result, null);
            long now= Long.parseLong(value);
            long after = System.currentTimeMillis();
View Full Code Here

            long after = System.currentTimeMillis();
            assertTrue(now >= before && now <= after);
        }
       
        public void testTooMany() throws Exception {
            params.add(new CompoundVariable("YMD"));
            params.add(new CompoundVariable("NAME"));
            params.add(new CompoundVariable("YMD"));
            try {
                variable.setParameters(params);
                fail("Should have raised InvalidVariableException");
            } catch (InvalidVariableException ignored){               
            }
View Full Code Here

TOP

Related Classes of org.apache.jmeter.engine.util.CompoundVariable

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.