Bug 63484

Summary: Add apache velocity as JSR223 script language
Product: JMeter - Now in Github Reporter: orimarko <orimarko>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: enhancement CC: orimarko, p.mouawad
Priority: P2 Keywords: FixedInTrunk
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Add velocity JSR223 language docs comment
velocity as JSR223 script language

Description orimarko 2019-06-05 11:28:08 UTC
Apache velocity is under Apache License Version 2.0.
Latest velocity support JSR223 scripting
https://velocity.apache.org/download.cgi#tools

Velocity script can be executed, although there's an issue of using JMeter environment/variables:
https://stackoverflow.com/questions/56456881/jmeter-velocity-jsr223-script-cant-use-jmeter-variables-environment
Comment 1 orimarko 2019-06-06 08:17:27 UTC
When using Velocity user need to add $ in front of JMeter predefined variables, e.g:

$log.debug( "Hello " + $vars.get("a"));
Comment 2 Philippe Mouawad 2019-06-08 12:55:59 UTC
(In reply to orimarko from comment #1)
> When using Velocity user need to add $ in front of JMeter predefined
> variables, e.g:
> 
> $log.debug( "Hello " + $vars.get("a"));

Hello orimarko,
Thanks for analysis.

What can we do about it though except document ?

Would you contribute a patch amending documentation ? unless you have a better idea ?
Thanks
Comment 3 orimarko 2019-06-08 14:55:22 UTC
We can add velocity core and scripting jars and support velocity by default in JSR223
Comment 4 Felix Schumacher 2019-06-09 09:21:18 UTC
What is the use case for adding velocity to our runtime dependencies? At the moment velocity is a dependency for the generation of our docs, only. Is the updated version compatible with the docs generation?

Apart from that, a note about different conventions for variable syntax in script languages would be helpful in our documentation.
Comment 5 orimarko 2019-06-10 05:58:13 UTC
Created attachment 36616 [details]
Add velocity JSR223 language docs comment
Comment 6 Felix Schumacher 2019-06-10 09:34:16 UTC
Thanks for the patch.

You have patched the changes.html instead of the correct source changes.xml.
Comment 7 orimarko 2019-06-10 10:56:18 UTC
Created attachment 36621 [details]
velocity as JSR223 script language

update patch
Comment 8 orimarko 2019-06-10 10:56:36 UTC
updated patch
Comment 9 Felix Schumacher 2019-06-17 16:24:50 UTC
Thanks for the updated patch.

The documentation will be visible with the next version of JMeter (probably 5.2)

commit 7bbd39b026c3b638e07ca09d842f4134f902cf7a
AuthorDate: Mon Jun 17 18:20:08 2019 +0200

    Add notes to use Apache Velocity as JSR223 script language
    
    Based on a patch by Ori Marko (orimarko at gmail.com)
    Bugzilla Id: 63484
---
 xdocs/changes.xml                        | 1 +
 xdocs/usermanual/component_reference.xml | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
Comment 10 The ASF infrastructure team 2022-09-24 20:38:17 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/5096