@Test public void testExecute() throws Exception { System.out.println("execute"); Collection<CompoundVariable> parameters = new ArrayList<CompoundVariable>(); parameters.add(new CompoundVariable("ABC")); parameters.add(new CompoundVariable("var")); SampleResult previousResult = null; Sampler currentSampler = null; LowerCase instance = new LowerCase(); instance.setParameters(parameters); String expResult = "abc"; String result = instance.execute(previousResult, currentSampler); Assert.assertEquals(expResult, result); Assert.assertEquals(expResult, JMeterContextService.getContext().getVariables().get("var")); }
@Override public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { JMeterVariables vars = getVariables(); String res = ((CompoundVariable) values[0]).execute().toLowerCase(); if (vars != null && values.length > 1) { String varName = ((CompoundVariable) values[1]).execute().trim(); vars.put(varName, res); } return res; }
LowerCase extends AbstractFunction { @Override public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { JMeterVariables vars = getVariables(); String res = ((CompoundVariable) values[0]).execute().toLowerCase(); if (vars != null && values.length > 1) { String varName = ((CompoundVariable) values[1]).execute().trim(); vars.put(varName, res); } return res; } }
LowerCase extends AbstractFunction { @Override public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { JMeterVariables vars = getVariables(); String res = ((CompoundVariable) values[0]).execute().toLowerCase(); if (vars != null && values.length > 1) { String varName = ((CompoundVariable) values[1]).execute().trim(); vars.put(varName, res); } return res; } LowerCase(); }
LowerCase extends AbstractFunction { @Override public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { JMeterVariables vars = getVariables(); String res = ((CompoundVariable) values[0]).execute().toLowerCase(); if (vars != null && values.length > 1) { String varName = ((CompoundVariable) values[1]).execute().trim(); vars.put(varName, res); } return res; } LowerCase(); @Override synchronized String execute(SampleResult previousResult, Sampler currentSampler); @Override synchronized void setParameters(Collection<CompoundVariable> parameters); @Override String getReferenceKey(); @Override List<String> getArgumentDesc(); }
LowerCase extends AbstractFunction { @Override public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { JMeterVariables vars = getVariables(); String res = ((CompoundVariable) values[0]).execute().toLowerCase(); if (vars != null && values.length > 1) { String varName = ((CompoundVariable) values[1]).execute().trim(); vars.put(varName, res); } return res; } LowerCase(); @Override synchronized String execute(SampleResult previousResult, Sampler currentSampler); @Override synchronized void setParameters(Collection<CompoundVariable> parameters); @Override String getReferenceKey(); @Override List<String> getArgumentDesc();  }