fix(接口测试): 修复脚本编译没有缓存导致tps下降问题

来源:https://github.com/metersphere/ms-jmeter-core/pull/46
感谢:@zhwq1216
This commit is contained in:
fit2-zhao 2022-12-20 17:21:09 +08:00 committed by fit2-zhao
parent a3c0ec4aca
commit 297828c2d0
1 changed files with 2 additions and 1 deletions

View File

@ -185,7 +185,8 @@ public abstract class JSR223TestElement extends ScriptingTestElement
File scriptFile = new File(getFilename());
// Hack: bsh-2.0b5.jar BshScriptEngine implements Compilable but throws
// "java.lang.Error: unimplemented"
boolean supportsCompilable = false;
boolean supportsCompilable = scriptEngine instanceof Compilable
&& !"bsh.engine.BshScriptEngine".equals(scriptEngine.getClass().getName()); // NOSONAR // $NON-NLS-1$
try {
if (!StringUtils.isEmpty(getFilename())) {
if (scriptFile.exists() && scriptFile.canRead()) {