Package org.apache.jmeter.engine.util

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


        }

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


        }

        public void testVariableExtraction2() throws Exception
        {
            params = new LinkedList();
            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

        }

        public void testVariableExtraction5() throws Exception
        {
            params = new LinkedList();
            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

        }

        public void testVariableExtraction6() throws Exception
        {
            params = new LinkedList();
            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

        }

        public void testComma() throws Exception
        {
            params = new LinkedList();
            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

    // Create the CSVRead function and set its parameters.
  private static CSVRead setParams(String p1, String p2) throws Exception
  {
    CSVRead cr = new CSVRead();
    Collection parms = new LinkedList();
    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

  private static StringFromFile SFFParams(String p1, String p2, String p3, String p4)
  throws Exception
  {
    StringFromFile sff = new StringFromFile();
    Collection parms = new LinkedList();
    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

        }

        public void testVariableExtraction3() throws Exception
        {
            params = new LinkedList();
            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

        }

        public void testVariableExtraction4() throws Exception
        {
            params = new LinkedList();
            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

        }

        public void testDefaultValue() throws Exception
        {
            params = new LinkedList();
            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

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.