fix(接口测试): 修复脚本断言语言名称找不到的问题

This commit is contained in:
Captain.B 2021-06-23 17:34:26 +08:00 committed by 刘瑞斌
parent 1c1a6ad74f
commit 23b28d11b5
4 changed files with 11 additions and 4 deletions

View File

@ -142,7 +142,14 @@ public class MsAssertions extends MsTestElement {
assertion.setProperty(TestElement.TEST_CLASS, JSR223Assertion.class.getName());
assertion.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("TestBeanGUI"));
assertion.setProperty("cacheKey", "true");
assertion.setProperty("scriptLanguage", assertionJSR223.getScriptLanguage());
String scriptLanguage = assertionJSR223.getScriptLanguage();
if (StringUtils.equals(scriptLanguage, "nashornScript")) {
scriptLanguage = "nashorn";
}
if (StringUtils.equals(scriptLanguage, "rhinoScript")) {
scriptLanguage = "rhino";
}
assertion.setProperty("scriptLanguage", scriptLanguage);
assertion.setProperty("script", assertionJSR223.getScript());
return assertion;
}

View File

@ -84,7 +84,7 @@ public class MsJSR223Processor extends MsTestElement {
processor.setProperty("scriptLanguage", "nashorn");
}
if (StringUtils.isNotEmpty(this.getScriptLanguage()) && this.getScriptLanguage().equals("rhinoScript")) {
processor.setProperty("scriptLanguage", "javascript");
processor.setProperty("scriptLanguage", "rhino");
}
processor.setProperty("script", this.getScript());

View File

@ -71,7 +71,7 @@ public class MsJSR223PostProcessor extends MsTestElement {
processor.setProperty("scriptLanguage", "nashorn");
}
if (StringUtils.isNotEmpty(this.getScriptLanguage()) && this.getScriptLanguage().equals("rhinoScript")) {
processor.setProperty("scriptLanguage", "javascript");
processor.setProperty("scriptLanguage", "rhino");
}
processor.setProperty("script", this.getScript());

View File

@ -81,7 +81,7 @@ public class MsJSR223PreProcessor extends MsTestElement {
processor.setProperty("scriptLanguage", "nashorn");
}
if (StringUtils.isNotEmpty(this.getScriptLanguage()) && this.getScriptLanguage().equals("rhinoScript")) {
processor.setProperty("scriptLanguage", "javascript");
processor.setProperty("scriptLanguage", "rhino");
}
processor.setProperty("script", this.getScript());