@Test public void testExecute() throws Exception { System.out.println("execute"); SampleResult previousResult = null; Sampler currentSampler = null; LinkedList<CompoundVariable> list; list = new LinkedList<>(); list.add(new CompoundVariable("test")); list.add(new CompoundVariable("test")); FifoSize instance = new FifoSize(); instance.setParameters(list); String expResult = "0"; String result = instance.execute(null, null); Assert.assertEquals(expResult, result); }
@Override public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { String fifoName = ((CompoundVariable) values[0]).execute(); int size = FifoMap.getInstance().length(fifoName); String value = Integer.toString(size); JMeterVariables vars = getVariables(); if (vars != null && values.length > 1) { String varName = ((CompoundVariable) values[1]).execute().trim(); vars.put(varName, value); } return value; }
FifoSize extends AbstractFunction { @Override public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { String fifoName = ((CompoundVariable) values[0]).execute(); int size = FifoMap.getInstance().length(fifoName); String value = Integer.toString(size); JMeterVariables vars = getVariables(); if (vars != null && values.length > 1) { String varName = ((CompoundVariable) values[1]).execute().trim(); vars.put(varName, value); } return value; } }
FifoSize extends AbstractFunction { @Override public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { String fifoName = ((CompoundVariable) values[0]).execute(); int size = FifoMap.getInstance().length(fifoName); String value = Integer.toString(size); JMeterVariables vars = getVariables(); if (vars != null && values.length > 1) { String varName = ((CompoundVariable) values[1]).execute().trim(); vars.put(varName, value); } return value; } FifoSize(); }
FifoSize extends AbstractFunction { @Override public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { String fifoName = ((CompoundVariable) values[0]).execute(); int size = FifoMap.getInstance().length(fifoName); String value = Integer.toString(size); JMeterVariables vars = getVariables(); if (vars != null && values.length > 1) { String varName = ((CompoundVariable) values[1]).execute().trim(); vars.put(varName, value); } return value; } FifoSize(); @Override synchronized String execute(SampleResult previousResult, Sampler currentSampler); @Override synchronized void setParameters(Collection<CompoundVariable> parameters); @Override String getReferenceKey(); @Override List<String> getArgumentDesc(); }
FifoSize extends AbstractFunction { @Override public synchronized String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException { String fifoName = ((CompoundVariable) values[0]).execute(); int size = FifoMap.getInstance().length(fifoName); String value = Integer.toString(size); JMeterVariables vars = getVariables(); if (vars != null && values.length > 1) { String varName = ((CompoundVariable) values[1]).execute().trim(); vars.put(varName, value); } return value; } FifoSize(); @Override synchronized String execute(SampleResult previousResult, Sampler currentSampler); @Override synchronized void setParameters(Collection<CompoundVariable> parameters); @Override String getReferenceKey(); @Override List<String> getArgumentDesc();  }