Github user ra0077 commented on a diff in the pull request:
https://github.com/apache/jmeter/pull/223#discussion_r73664219
--- Diff: src/core/org/apache/jmeter/util/JSR223TestElement.java ---
@@ -86,11 +88,16 @@ public JSR223TestElement() {
}
protected ScriptEngine getScriptEngine() throws ScriptException {
- final String lang = getScriptLanguage();
+ String lang = getScriptLanguage();
+
+ if (lang.isEmpty()) {
+ lang = defaultScriptLanguage;
+ log.warn("Script language has not been chosen on the UI, the
script will be interpreted as a groovy script");
--- End diff --
Hi Vladimir,
getScriptEngine method is called for each sampler execution and I am OK
with your it's not the best solution for performance.
But you can dynamically change the script language during the execution of
the script.
It's why I have made this.
If you have a better solution, please let me know
The other solution will be to don't allow to dynamically modify/change the
script language during the execution. But I am not sure it's a good solution.
Antonio
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---