mstover1    2003/06/23 07:09:12

  Modified:    .        eclipse.classpath
               docs/usermanual component_reference.html remote-test.html
               src/core/org/apache/jmeter/resources messages.properties
                        messages_de.properties messages_ja.properties
                        messages_no.properties
               xdocs/usermanual component_reference.xml
  Added:       src/functions/org/apache/jmeter/functions Property.java
  Log:
  New Property function
  
  Revision  Changes    Path
  1.2       +3 -3      jakarta-jmeter/eclipse.classpath
  
  Index: eclipse.classpath
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/eclipse.classpath,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- eclipse.classpath 20 Jun 2003 14:33:45 -0000      1.1
  +++ eclipse.classpath 23 Jun 2003 14:09:10 -0000      1.2
  @@ -15,11 +15,11 @@
       <classpathentry kind="src" output="build/protocol/ldap" 
path="src/protocol/ldap"/>
       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
       <classpathentry kind="lib" path="lib/avalon-excalibur-4.1.jar"/>
  -    <classpathentry kind="lib" path="lib/avalon-framework.jar"/>
  -    <classpathentry kind="lib" path="lib/jakarta-oro-2.0.1.jar"/>
  +    <classpathentry kind="lib" path="lib/avalon-framework-4.1.4.jar"/>
  +    <classpathentry kind="lib" path="lib/jakarta-oro-2.0.7.jar"/>
       <classpathentry kind="lib" path="lib/js.jar"/>
       <classpathentry kind="lib" path="lib/junit.jar"/>
  -    <classpathentry kind="lib" path="lib/logkit-1.0.1.jar"/>
  +    <classpathentry kind="lib" path="lib/logkit-1.2.jar"/>
       <classpathentry kind="lib" path="lib/Tidy.jar"/>
       <classpathentry kind="lib" path="lib/commons-collections.jar"/>
       <classpathentry kind="lib" path="lib/soap.jar"/>
  
  
  
  1.54      +66 -1     jakarta-jmeter/docs/usermanual/component_reference.html
  
  Index: component_reference.html
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/docs/usermanual/component_reference.html,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- component_reference.html  20 Jun 2003 14:15:30 -0000      1.53
  +++ component_reference.html  23 Jun 2003 14:09:10 -0000      1.54
  @@ -180,6 +180,7 @@
                                        <li><a 
href="#__javaScript">__javaScript</a></li>
                                        <li><a href="#__Random">__Random</a></li>
                                        <li><a href="#__CSVRead">__CSVRead</a></li>
  +                                     <li><a href="#__property">__property</a></li>
                                </ul>
                </ul>
                                                                                       
                                                                                  
<table border="0" cellspacing="0" cellpadding="2" width="100%">
  @@ -4628,7 +4629,31 @@
        <tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
                        <tr>
                        <td>Expression</td>
  -                     <td>                                            The JavaScript 
expression to be executed.
  +                     <td>                                            The JavaScript 
expression to be executed. For example:
  +             
  +                                                                                    
         <ul     >
  +                                                             
  +                     
  +                                                                                    
         <li     >
  +                                                             new Date() - return 
the current date and time
  +                                             </li>
  +                                                                     
  +                     
  +                                                                                    
         <li     >
  +                                                             
Math.floor(Math.random()*(${maxRandom}+1))
  +                             - a random number between 0 and the variable maxRandom
  +                                             </li>
  +                                                                     
  +                     
  +                                                                                    
         <li     >
  +                                                             
${minRandom}+Math.floor(Math.random()*(${maxRandom}-${minRandom}+1))
  +                             - a random number between the variables minRandom and 
maxRandom
  +                                             </li>
  +                                                                     
  +             
  +                                             </ul>
  +                                                                     
  +             
                        </td>
                        <td>
                                                                                       
 Yes
  @@ -4735,6 +4760,46 @@
                        </td>
                        <td>
                                                                                       
 Yes
  +                                                             </td>
  +             </tr>
  +             </table>
  +     </p>
  +                                                                     </td></tr>
  +             <tr><td><br></td></tr>
  +      </table>
  +     <hr>
  +                                                                                    
                                                                         <table 
border="0" cellspacing="0" cellpadding="2">
  +             <tr><td>
  +               <font face="arial,helvetica,sanserif">
  +                      <a name="__property"><h3>13.10.9 __property</h3></a>
  +               </font>
  +             </td></tr>
  +                             <tr><td>
  +                                                                                    
                                                                                 <p    
  >
  +                                                             The property function 
returns the value of a JMeter property. 
  +     If the property value cannot be found, it returns the property name.
  +                                             </p>
  +                                                                     
  +     
  +                                                                                    
                                                                                       
                                   <p>
  +     <b>Parameters</b>
  +     <table border="1" cellspacing="0" cellpadding="2">
  +     <tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
  +                     <tr>
  +                     <td>Property Name</td>
  +                     <td>                                            The property 
name to be retrieved.
  +                     </td>
  +                     <td>
  +                                                                                    
 Yes
  +                                                             </td>
  +             </tr>
  +                     <tr>
  +                     <td>Name of function</td>
  +                     <td>                                            A reference 
name for reusing the value
  +                computed by this function.
  +                     </td>
  +                     <td>
  +                                                                                    
 No
                                                                </td>
                </tr>
                </table>
  
  
  
  1.33      +1 -1      jakarta-jmeter/docs/usermanual/remote-test.html
  
  Index: remote-test.html
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/docs/usermanual/remote-test.html,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- remote-test.html  15 Jun 2003 16:09:24 -0000      1.32
  +++ remote-test.html  23 Jun 2003 14:09:11 -0000      1.33
  @@ -233,7 +233,7 @@
                                                                        
        
                                                                                       
         <li     >
  -                                                             
JMETER_HOME/lib/logkit-1.0.1.jar
  +                                                             
JMETER_HOME/lib/logkit-1.2.jar
                                                </li>
                                                                        
   
  
  
  
  1.48      +3 -2      
jakarta-jmeter/src/core/org/apache/jmeter/resources/messages.properties
  
  Index: messages.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/resources/messages.properties,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- messages.properties       11 Jun 2003 15:38:32 -0000      1.47
  +++ messages.properties       23 Jun 2003 14:09:11 -0000      1.48
  @@ -365,7 +365,7 @@
   search_base=Search base
   entry_dn=Entry DN
   test_configuration=Test Configuration
  -test =Test
  +test=Test
   ldap_testing_title= LDAP Request
   webservice_sampler_title=WebService(SOAP) Request (Alpha Code)
   soap_action=Soap Action
  @@ -375,4 +375,5 @@
   starttime=StartTime
   endtime=EndTime
   scheduler=Scheduler
  -scheduler_configuration=Scheduler Configuration
  \ No newline at end of file
  +scheduler_configuration=Scheduler Configuration
  +property_name_param=Name of property
  \ No newline at end of file
  
  
  
  1.40      +2 -1      
jakarta-jmeter/src/core/org/apache/jmeter/resources/messages_de.properties
  
  Index: messages_de.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/resources/messages_de.properties,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- messages_de.properties    11 Jun 2003 15:38:33 -0000      1.39
  +++ messages_de.properties    23 Jun 2003 14:09:11 -0000      1.40
  @@ -364,4 +364,5 @@
   starttime=StartTime
   endtime=EndTime
   scheduler=Scheduler
  -scheduler_configuration=Scheduler Configuration
  \ No newline at end of file
  +scheduler_configuration=Scheduler Configuration
  +property_name_param=Name of property
  \ No newline at end of file
  
  
  
  1.36      +2 -1      
jakarta-jmeter/src/core/org/apache/jmeter/resources/messages_ja.properties
  
  Index: messages_ja.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/resources/messages_ja.properties,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- messages_ja.properties    11 Jun 2003 15:38:33 -0000      1.35
  +++ messages_ja.properties    23 Jun 2003 14:09:11 -0000      1.36
  @@ -359,4 +359,5 @@
   starttime=StartTime
   endtime=EndTime
   scheduler=Scheduler
  -scheduler_configuration=Scheduler Configuration
  \ No newline at end of file
  +scheduler_configuration=Scheduler Configuration
  +property_name_param=Name of property
  \ No newline at end of file
  
  
  
  1.36      +2 -1      
jakarta-jmeter/src/core/org/apache/jmeter/resources/messages_no.properties
  
  Index: messages_no.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/resources/messages_no.properties,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- messages_no.properties    11 Jun 2003 15:38:33 -0000      1.35
  +++ messages_no.properties    23 Jun 2003 14:09:11 -0000      1.36
  @@ -351,4 +351,5 @@
   starttime=StartTime
   endtime=EndTime
   scheduler=Scheduler
  -scheduler_configuration=Scheduler Configuration
  \ No newline at end of file
  +scheduler_configuration=Scheduler Configuration
  +property_name_param=Name of property
  \ No newline at end of file
  
  
  
  1.1                  
jakarta-jmeter/src/functions/org/apache/jmeter/functions/Property.java
  
  Index: Property.java
  ===================================================================
  /*
   * ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   * notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   * notice, this list of conditions and the following disclaimer in
   * the documentation and/or other materials provided with the
   * distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   * if any, must include the following acknowledgment:
   * "This product includes software developed by the
   * Apache Software Foundation (http://www.apache.org/)."
   * Alternately, this acknowledgment may appear in the software itself,
   * if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   * "Apache JMeter" must not be used to endorse or promote products
   * derived from this software without prior written permission. For
   * written permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache",
   * "Apache JMeter", nor may "Apache" appear in their name, without
   * prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   * 
   * $ID$
   */
   
  package org.apache.jmeter.functions;
  
  import java.io.Serializable;
  import java.util.Collection;
  import java.util.LinkedList;
  import java.util.List;
  
  import org.apache.jmeter.engine.util.CompoundVariable;
  import org.apache.jmeter.samplers.SampleResult;
  import org.apache.jmeter.samplers.Sampler;
  import org.apache.jmeter.util.JMeterUtils;
  
  /**
   * GetProperty (Function)
   * 
   * @author default
   *
   * @version $Id: Property.java,v 1.1 2003/06/23 14:09:11 mstover1 Exp $
   * 
   * Function to get a JMeter property
   * 
   * Parameters:
   *            - property name
   *            - variable name (optional)
   * 
   * Returns:
   *            - the property value or the property name if not found
   * 
   */
  
  public class Property extends AbstractFunction implements Serializable {
  
        private static final List desc = new LinkedList();
        private static final String KEY = "__property";
        
        // Number of parameters expected - used to reject invalid calls
        private static final int MIN_PARAMETER_COUNT = 1;
        private static final int MAX_PARAMETER_COUNT = 2;
        static {
                desc.add(JMeterUtils.getResString("property_name_param"));
                desc.add(JMeterUtils.getResString("function_name_param"));
        }
  
        
        private Object[] values;
  
  
        public Property() {}
  
        public Object clone()   {
                return new Property();
        }
  
        public synchronized String execute(SampleResult previousResult, Sampler 
currentSampler)
                        throws InvalidVariableException {
  
                String propertyName = ((CompoundVariable)values[0]).execute();
                String propertyValue = 
JMeterUtils.getPropDefault(propertyName,propertyName);
                if (values.length > 1) {
                        String variableName = ((CompoundVariable)values[1]).execute();
                        getVariables().put(variableName,propertyValue);
                }
                return propertyValue;
  
        }
  
        public void setParameters(Collection parameters)
                        throws InvalidVariableException {
  
                values = parameters.toArray();
                
                if (( values.length < MIN_PARAMETER_COUNT ) || ( values.length > 
MAX_PARAMETER_COUNT )) {
                        throw new InvalidVariableException("Parameter Count not 
between "
                                +MIN_PARAMETER_COUNT+" & "+MAX_PARAMETER_COUNT);
                }
  
        }
  
        public String getReferenceKey() {
                return KEY;
        }
  
        public List getArgumentDesc() {
                return desc;
        }
  
  }
  
  
  1.50      +22 -2     jakarta-jmeter/xdocs/usermanual/component_reference.xml
  
  Index: component_reference.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/xdocs/usermanual/component_reference.xml,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- component_reference.xml   20 Jun 2003 14:15:36 -0000      1.49
  +++ component_reference.xml   23 Jun 2003 14:09:12 -0000      1.50
  @@ -1484,7 +1484,15 @@
        </description>
   
   <properties>
  -        <property name="Expression" required="Yes">The JavaScript expression to be 
executed.</property>
  +        <property name="Expression" required="Yes">The JavaScript expression to be 
executed. For example:
  +             <ul>
  +                     <li>new Date() - return the current date and time</li>
  +                     <li>Math.floor(Math.random()*(${maxRandom}+1))
  +                             - a random number between 0 and the variable 
maxRandom</li>
  +                     
<li>${minRandom}+Math.floor(Math.random()*(${maxRandom}-${minRandom}+1))
  +                             - a random number between the variables minRandom and 
maxRandom</li>
  +             </ul>
  +             </property>
           <property name="Name of function" required="Yes">A reference name for 
reusing the value
                   computed by this function.</property>
   </properties>
  @@ -1512,6 +1520,18 @@
                0 = first column, 1 = second etc.
                "next" - go to next line of file.
                </property>
  +</properties>
  +</component>
  +
  +<component index="13.10.9" name="__property">
  +<description><p>The property function returns the value of a JMeter property. 
  +     If the property value cannot be found, it returns the property name.</p>
  +     </description>
  +
  +<properties>
  +        <property name="Property Name" required="Yes">The property name to be 
retrieved.</property>
  +        <property name="Name of function" required="No">A reference name for 
reusing the value
  +                computed by this function.</property>
   </properties>
   </component>
   
  
  
  

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

Reply via email to