Package org.apache.jmeter.engine.util

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


      assertEquals("1, ", match);
    }

    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


    if (vars == null){
        log.error("Variables have not yet been defined");
        return "**ERROR - see log file**";
    }
        String variableValue = vars.get(variableName);
    CompoundVariable cv = new CompoundVariable(variableValue);
    return cv.execute();
  }
View Full Code Here

  }

  public synchronized String execute(SampleResult previousResult, Sampler currentSampler)
      throws InvalidVariableException {
    String parameter = ((CompoundVariable) values[0]).execute();
    CompoundVariable cv = new CompoundVariable(parameter);
    return cv.execute();
  }
View Full Code Here

    public synchronized String execute(SampleResult previousResult, Sampler currentSampler)
            throws InvalidVariableException
    {
        String str = ""; //$NON-NLS-1$

        CompoundVariable var = (CompoundVariable) values[0];
        String exp = var.execute();

        String varName = ""; //$NON-NLS-1$
        if (values.length > 1) {
            varName = ((CompoundVariable) values[1]).execute().trim();
        }
View Full Code Here

  // Create the CSVRead function and set its parameters.
  private static CSVRead setCSVReadParams(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

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

  // 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 parms = new LinkedList();
    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 MakeParams(String p1, String p2, String p3) {
    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));
    }
    return parms;
  }
View Full Code Here

        }
    }

    private XPath setupXPath(String file, String expr) throws Exception{
        Collection parms = new LinkedList();
        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 parms = new LinkedList();
    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

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.