You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2016/01/23 14:54:43 UTC

svn commit: r1726397 - /jmeter/trunk/xdocs/usermanual/functions.xml

Author: pmouawad
Date: Sat Jan 23 13:54:43 2016
New Revision: 1726397

URL: http://svn.apache.org/viewvc?rev=1726397&view=rev
Log:
Bug 58903 - Provide __jexl3 function that uses commons-jexl3 and deprecated __jexl (1.1) function
Fix test failure as per sebb note
Bugzilla Id: 58903

Modified:
    jmeter/trunk/xdocs/usermanual/functions.xml

Modified: jmeter/trunk/xdocs/usermanual/functions.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/functions.xml?rev=1726397&r1=1726396&r2=1726397&view=diff
==============================================================================
--- jmeter/trunk/xdocs/usermanual/functions.xml (original)
+++ jmeter/trunk/xdocs/usermanual/functions.xml Sat Jan 23 13:54:43 2016
@@ -125,7 +125,8 @@ Alternatively, just use <code>/</code> i
         <tr><td>Calculation</td><td> <a href="#__UUID">UUID</a></td><td>generate a random type 4 UUID</td><td>2.9</td></tr>
         <tr><td>Scripting</td><td> <a href="#__BeanShell">BeanShell</a></td><td>run a BeanShell script</td><td>1.X</td></tr>
         <tr><td>Scripting</td><td> <a href="#__javaScript">javaScript</a></td><td>process JavaScript (Mozilla Rhino)</td><td>1.9</td></tr>
-        <tr><td>Scripting</td><td> <a href="#__jexl2">jexl2</a></td><td>evaluate a Commons Jexl2 expression</td><td>jexl2(2.6)</td></tr>
+        <tr><td>Scripting</td><td> <a href="#__jexl">jexl</a></td><td>evaluate a Commons Jexl expression. This function is DEPRECATED as of JMeter 3.0, it will be removed in 3.1 version.</td><td>jexl1(1.1)</td></tr>
+        <tr><td>Scripting</td><td> <a href="#__jexl2">jexl2</a></td><td>evaluate a Commons Jexl2 expression</td><td>jexl2(2.1.1)</td></tr>
         <tr><td>Scripting</td><td> <a href="#__jexl3">jexl3</a></td><td>evaluate a Commons Jexl3 expression</td><td>jexl3 (3.0)</td></tr>
         <tr><td>Properties</td><td> <a href="#__property">property</a> </td><td>read a property</td><td>2.0</td></tr>
         <tr><td>Properties</td><td> <a href="#__P">P</a></td><td>read a property (shorthand method)</td><td>2.0</td></tr>
@@ -566,7 +567,7 @@ The following variables are made availab
 <li><code>log</code> - the logger for the function</li>
 <li><code>ctx</code> - JMeterContext object</li>
 <li><code>vars</code> - JMeterVariables object</li>
-<li><code>threadName</code> - String containing the current thread name (in 2.3.2 it was misspelt as "<code>theadName</code>")</li>
+<li><code>threadName</code> - String containing the current thread name</li>
 <li><code>sampler</code> - current Sampler object (if any)</li>
 <li><code>sampleResult</code> - previous SampleResult object (if any)</li>
 <li><code>props</code> - JMeter Properties object</li>
@@ -993,7 +994,59 @@ The following shorthand aliases are prov
 </p>
 </component>
 
-<component index="&sect-num;.5.18" name="__jexl2" >
+<component index="&sect-num;.5.18" name="__jexl">
+<description>
+    <p>The jexl function returns the result of evaluating a 
+    <a href="http://commons.apache.org/jexl">Commons JEXL expression</a>. 
+    See links below for more information on JEXL expressions.
+    </p>
+    <p>The <code>__jexl</code> function uses Commons JEXL</p>
+    <ul>
+    <li><a href="http://commons.apache.org/proper/commons-jexl/reference/syntax.html">JEXL syntax description</a></li>
+    <li><a href="http://commons.apache.org/proper/commons-jexl/reference/examples.html#Example_Expressions">JEXL examples</a></li>
+    </ul>
+    <note>THIS FUNCTION IS DEPRECATED and should not be used, it will be dropped in next JMeter version</note>
+    </description>
+
+<properties>
+        <property name="Expression" required="Yes">
+        The expression to be evaluated. For example, <code>6*(5+2)</code>
+        </property>
+        <property name="Name of variable" required="No">The name of the variable to set.</property>
+</properties>
+<p>
+The following variables are made available to the script:
+</p>
+<ul>
+<li><code>log</code> - the logger for the function</li>
+<li><code>ctx</code> - JMeterContext object</li>
+<li><code>vars</code> - JMeterVariables object</li>
+<li><code>props</code> - JMeter Properties object</li>
+<li><code>threadName</code> - String containing the current thread name</li>
+<li><code>sampler</code> - current Sampler object (if any)</li>
+<li><code>sampleResult</code> - previous SampleResult object (if any)</li>
+<li><code>OUT</code> - System.out - e.g. <code>OUT.println("message")</code></li>
+</ul>
+    <p>
+    Jexl can also create classes and call methods on them, for example:
+    </p>
+    <p>
+    <source>
+Systemclass=log.class.forName("java.lang.System");
+now=Systemclass.currentTimeMillis();
+</source>
+    Note that the Jexl documentation on the web-site wrongly suggests that "<code>div</code>" does integer division.
+    In fact "<code>div</code>" and "<code>/</code>" both perform normal division. One can get the same effect
+    as follows:
+    <source>
+i= 5 / 2;
+i.intValue(); // or use i.longValue()
+</source>
+    </p>
+    <note>JMeter allows the expression to contain multiple statements.</note>
+</component>
+
+<component index="&sect-num;.5.18" name="__jexl2">
 <description>
     <p>The jexl function returns the result of evaluating a 
     <a href="http://commons.apache.org/jexl">Commons JEXL expression</a>. 
@@ -1020,7 +1073,7 @@ The following variables are made availab
 <li><code>ctx</code> - JMeterContext object</li>
 <li><code>vars</code> - JMeterVariables object</li>
 <li><code>props</code> - JMeter Properties object</li>
-<li><code>threadName</code> - String containing the current thread name (in 2.3.2 it was misspelt as "<code>theadName</code>")</li>
+<li><code>threadName</code> - String containing the current thread name</li>
 <li><code>sampler</code> - current Sampler object (if any)</li>
 <li><code>sampleResult</code> - previous SampleResult object (if any)</li>
 <li><code>OUT</code> - System.out - e.g. <code>OUT.println("message")</code></li>
@@ -1071,7 +1124,7 @@ The following variables are made availab
 <li><code>ctx</code> - JMeterContext object</li>
 <li><code>vars</code> - JMeterVariables object</li>
 <li><code>props</code> - JMeter Properties object</li>
-<li><code>threadName</code> - String containing the current thread name (in 2.3.2 it was misspelt as "<code>theadName</code>")</li>
+<li><code>threadName</code> - String containing the current thread name</li>
 <li><code>sampler</code> - current Sampler object (if any)</li>
 <li><code>sampleResult</code> - previous SampleResult object (if any)</li>
 <li><code>OUT</code> - System.out - e.g. <code>OUT.println("message")</code></li>