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