Author: fschumacher Date: Sat Oct 22 12:11:30 2016 New Revision: 1766185 URL: http://svn.apache.org/viewvc?rev=1766185&view=rev Log: The groovy function is named __groovy. Add a note to add the utility-file to the groovy property. Add a bit of markup. Modified: jmeter/trunk/bin/jmeter.properties jmeter/trunk/bin/utility.groovy jmeter/trunk/xdocs/usermanual/functions.xml Modified: jmeter/trunk/bin/jmeter.properties URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/jmeter.properties?rev=1766185&r1=1766184&r2=1766185&view=diff ============================================================================== --- jmeter/trunk/bin/jmeter.properties (original) +++ jmeter/trunk/bin/jmeter.properties Sat Oct 22 12:11:30 2016 @@ -952,7 +952,7 @@ beanshell.server.file=../extras/startup. # Groovy function #--------------------------------------------------------------------------- -#Path to Groovy file containing utility functions to make available to __g function +#Path to Groovy file containing utility functions to make available to __groovy function #groovy.utilities= # Example @@ -1285,4 +1285,4 @@ system.properties=system.properties jmeter.reportgenerator.apdex_satisfied_threshold=500 # Change this parameter if you want to override the APDEX tolerance threshold. -jmeter.reportgenerator.apdex_tolerated_threshold=1500 \ No newline at end of file +jmeter.reportgenerator.apdex_tolerated_threshold=1500 Modified: jmeter/trunk/bin/utility.groovy URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/utility.groovy?rev=1766185&r1=1766184&r2=1766185&view=diff ============================================================================== --- jmeter/trunk/bin/utility.groovy (original) +++ jmeter/trunk/bin/utility.groovy Sat Oct 22 12:11:30 2016 @@ -15,6 +15,9 @@ * limitations under the License. * */ - -// Uncomment this function and use it with ${__g(factorial(10))} -// def factorial(n) { n == 1 ? 1 : n * factorial(n - 1) } \ No newline at end of file +// Remember to add this file to the property "groovy.utilities" in +// "bin/jmeter.properties", if you want to access it through +// the __groovy function +// +// Uncomment this function and use it with ${__groovy(factorial(10))} +// def factorial(n) { n == 1 ? 1 : n * factorial(n - 1) } Modified: jmeter/trunk/xdocs/usermanual/functions.xml URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/functions.xml?rev=1766185&r1=1766184&r2=1766185&view=diff ============================================================================== --- jmeter/trunk/xdocs/usermanual/functions.xml (original) +++ jmeter/trunk/xdocs/usermanual/functions.xml Sat Oct 22 12:11:30 2016 @@ -913,15 +913,16 @@ Remember to include any necessary quotes

- The g function evaluates Apache Groovy scripts passed to it, and returns the result. + The __groovy function evaluates Apache Groovy scripts passed to it, and returns the result.

If the property "groovy.utilities" is defined, it will be loaded by the ScriptEngine. This can be used to define common methods and variables. There is a -sample init file in the bin directory: utility.groovy. +sample init file in the bin directory: utility.groovy.

The following variables are set before the script is executed: +

+

(*) means that this is set before the init file, if any, is processed. Other variables vary from invocation to invocation.