1 18 19 22 package org.apache.jmeter.engine.util; 23 24 import java.util.Map ; 25 26 import org.apache.jmeter.functions.InvalidVariableException; 27 import org.apache.jmeter.testelement.property.FunctionProperty; 28 import org.apache.jmeter.testelement.property.JMeterProperty; 29 30 35 public class ReplaceStringWithFunctions extends AbstractTransformer 36 { 37 public ReplaceStringWithFunctions( 38 CompoundVariable masterFunction, 39 Map variables) 40 { 41 super(); 42 setMasterFunction(masterFunction); 43 setVariables(variables); 44 } 45 46 49 public JMeterProperty transformValue(JMeterProperty prop) 50 throws InvalidVariableException 51 { 52 JMeterProperty newValue = prop; 53 getMasterFunction().clear(); 54 getMasterFunction().setParameters(prop.getStringValue()); 55 if (getMasterFunction().hasFunction()) 56 { 57 newValue = 58 new FunctionProperty( 59 prop.getName(), 60 getMasterFunction().getFunction()); 61 } 62 return newValue; 63 } 64 65 } 66 | Popular Tags |