mstover1    2003/06/11 07:58:45

  Modified:    src/core/org/apache/jmeter/engine/util CompoundVariable.java
  Log:
  continue processing functions even if one fails, make obvious which function failed
  
  Revision  Changes    Path
  1.13      +17 -11    
jakarta-jmeter/src/core/org/apache/jmeter/engine/util/CompoundVariable.java
  
  Index: CompoundVariable.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/engine/util/CompoundVariable.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- CompoundVariable.java     5 Jun 2003 00:13:40 -0000       1.12
  +++ CompoundVariable.java     11 Jun 2003 14:58:45 -0000      1.13
  @@ -71,10 +71,10 @@
   import org.apache.jmeter.threads.JMeterContextService;
   import org.apache.jmeter.threads.JMeterVariables;
   import org.apache.jmeter.util.JMeterUtils;
  +import org.apache.jorphan.logging.LoggingManager;
   import org.apache.jorphan.reflect.ClassFinder;
  -import org.apache.log.Hierarchy;
   import org.apache.log.Logger;
  -import org.apache.oro.text.perl.Perl5Util;
  +//import org.apache.oro.text.perl.Perl5Util;
   import org.apache.oro.text.regex.MalformedPatternException;
   import org.apache.oro.text.regex.Perl5Compiler;
   import org.apache.oro.text.regex.Perl5Matcher;
  @@ -91,17 +91,17 @@
   public class CompoundVariable implements Function
   {
       transient private static Logger log =
  -        Hierarchy.getDefaultHierarchy().getLoggerFor(JMeterUtils.ENGINE);
  +        LoggingManager.getLoggerForClass();
           
       private String rawParameters;
       
  -    private JMeterVariables threadVars;
  -     private Map varMap = new HashMap();
  +    //private JMeterVariables threadVars;
  +     //private Map varMap = new HashMap();
   
       static Map functions = new HashMap();
       private boolean hasFunction, isDynamic;
       private String staticSubstitution;
  -    private Perl5Util util = new Perl5Util();
  +    //private Perl5Util util = new Perl5Util();
       private Perl5Compiler compiler = new Perl5Compiler();
       private static final String unescapePattern = "[\\\\]([${}\\,])";
       private String permanentResults = "";
  @@ -275,7 +275,12 @@
                        
                        funcEndIndex = findMatching( "${", "}", current );
                        functionStr = current.substring( funcStartIndex+2, 
funcEndIndex );
  -                     Function newFunction = buildFunction( functionStr );
  +                     Function newFunction = null;
  +                     try {
  +                             newFunction = buildFunction( functionStr );
  +                     }
  +                     catch (InvalidVariableException e){// Don't abandon processing 
if function fails
  +                     }
                        
                        if ( newFunction == null ) {
                                components.addLast(new SimpleVariable(functionStr) );  
 
  @@ -299,7 +304,7 @@
                throws InvalidVariableException 
        {               
                Function returnFunction = null;
  -             LinkedList parameterList;
  +             //LinkedList parameterList;
                String functionName, params;
                int paramsStart = functionStr.indexOf("(");
   
  @@ -422,7 +427,8 @@
        private static int findMatching( String openStr, String closeStr, 
                String searchString ) 
        {
  -             int count, openIndex, closeIndex, previousMatch;
  +             //int count;
  +             int openIndex, closeIndex, previousMatch;
                boolean found = false;
    
                openIndex = closeIndex = previousMatch = -1;
  @@ -505,7 +511,7 @@
           return "";
       }
          
  -     private JMeterVariables getVariables()
  +     private JMeterVariables getVariables()//TODO: not used
        {
                return JMeterContextService.getContext().getVariables();
        }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to