From 0fb9f69d83381c11e4a9c8bb8c8f94f6228f6e55 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Tue, 18 Aug 2020 16:38:27 +0800 Subject: [PATCH 1/4] =?UTF-8?q?refactor:=20=E6=89=93=E5=8C=85=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E4=BF=9D=E7=95=99jmeter=E7=9A=84jar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.gitignore | 3 ++- backend/pom.xml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/backend/.gitignore b/backend/.gitignore index 44cceecb40..b4e1c2fed7 100644 --- a/backend/.gitignore +++ b/backend/.gitignore @@ -31,4 +31,5 @@ target .settings .project .classpath -.factorypath \ No newline at end of file +.factorypath +*.jar \ No newline at end of file diff --git a/backend/pom.xml b/backend/pom.xml index af84159f0c..fad9718c97 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -299,6 +299,9 @@ src/main/resources + + jmeter/lib/ext/* + **/*.* @@ -372,6 +375,7 @@ org.apache.maven.plugins maven-antrun-plugin + 3.0.0 main-class-placement @@ -396,6 +400,35 @@ + + org.apache.maven.plugins + maven-dependency-plugin + + + copy + generate-resources + + copy + + + + + + + org.apache.jmeter + ApacheJMeter_functions + ${jmeter.version} + jar + true + src/main/resources/jmeter/lib/ext + ApacheJMeter_functions.jar + + + ${project.build.directory}/wars + false + true + + org.mybatis.generator mybatis-generator-maven-plugin From 052fae882e1f3be3dcc944935a63e30c64f6d6e7 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Tue, 18 Aug 2020 17:09:54 +0800 Subject: [PATCH 2/4] =?UTF-8?q?refactor:=20=E6=89=93=E5=8C=85=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E4=BF=9D=E7=95=99jmeter=E7=9A=84jar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/pom.xml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/backend/pom.xml b/backend/pom.xml index fad9718c97..50e2ee6ea5 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -299,9 +299,6 @@ src/main/resources - - jmeter/lib/ext/* - **/*.* @@ -372,10 +369,19 @@ 2.6 + + org.apache.maven.plugins + maven-jar-plugin + + + **/jmeter/lib/**/*.jar + + + + org.apache.maven.plugins maven-antrun-plugin - 3.0.0 main-class-placement From a26a12fb176146e7459cf2555557ac16c53d6100 Mon Sep 17 00:00:00 2001 From: q4speed Date: Tue, 18 Aug 2020 18:08:50 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=8E=A7=E4=BB=B6=E9=85=8D=E9=A2=9D=E6=97=B6?= =?UTF-8?q?=E8=B6=85=E5=87=BA=E7=BB=84=E7=BB=87=E7=9A=84=E9=85=8D=E9=A2=9D?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/java/io/metersphere/xpack | 2 +- .../src/main/resources/i18n/messages_en_US.properties | 9 +++++++-- .../src/main/resources/i18n/messages_zh_CN.properties | 8 +++++++- .../src/main/resources/i18n/messages_zh_TW.properties | 7 ++++++- frontend/src/business/components/xpack | 2 +- frontend/src/i18n/en-US.js | 2 ++ frontend/src/i18n/zh-CN.js | 2 ++ frontend/src/i18n/zh-TW.js | 2 ++ 8 files changed, 28 insertions(+), 6 deletions(-) diff --git a/backend/src/main/java/io/metersphere/xpack b/backend/src/main/java/io/metersphere/xpack index fadab72bb6..9b9208204c 160000 --- a/backend/src/main/java/io/metersphere/xpack +++ b/backend/src/main/java/io/metersphere/xpack @@ -1 +1 @@ -Subproject commit fadab72bb656a3a2644e43bf46783c1f6cd96d4f +Subproject commit 9b9208204ce138e2cb49d9549eac140019293160 diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index 6f07a9bf57..cc3c37684b 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -118,7 +118,6 @@ test_case_already_exists_excel=There are duplicate test cases in the import file test_case_module_already_exists=The module name already exists at the same level api_test_name_already_exists=Test name already exists functional_method_tip=Functional test not support auto method - #ldap ldap_url_is_null=LDAP address is empty ldap_dn_is_null=LDAP binding DN is empty @@ -136,4 +135,10 @@ login_fail_email_null=Login failed, user mailbox is empty login_fail_ou_error=Login failed, please check the user OU login_fail_filter_error=Login failed, please check the user filter check_ldap_mapping=Check LDAP attribute mapping -ldap_mapping_value_null=LDAP user attribute mapping field is empty \ No newline at end of file +ldap_mapping_value_null=LDAP user attribute mapping field is empty +#quota +quota_workspace_excess_org_api=The total number of interface tests in the workspace cannot exceed the organization's quota +quota_workspace_excess_org_performance=The total number of performance tests for the workspace cannot exceed the organization's quota +quota_workspace_excess_org_max_threads=The maximum concurrent number of workspaces cannot exceed the quota of the organization +quota_workspace_excess_org_max_duration=The stress test duration of the workspace cannot exceed the organization's quota +quota_workspace_excess_org_resource_pool=The resource pool of the workspace cannot exceed the resource pool of the organization \ No newline at end of file diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index a4e890d91c..e7870873c5 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -118,7 +118,6 @@ test_case_already_exists_excel=导入文件中存在重复用例 test_case_module_already_exists=同层级下已存在该模块名称 api_test_name_already_exists=测试名称已经存在 functional_method_tip=功能测试不支持自动方式 - #ldap ldap_url_is_null=LDAP地址为空 ldap_dn_is_null=LDAP绑定DN为空 @@ -137,5 +136,12 @@ login_fail_ou_error=登录失败,请检查用户OU login_fail_filter_error=登录失败,请检查用户过滤器 check_ldap_mapping=检查LDAP属性映射 ldap_mapping_value_null=LDAP用户属性映射字段为空值 +#quota +quota_workspace_excess_org_api=工作空间的接口测试数量总和不能超过组织的配额 +quota_workspace_excess_org_performance=工作空间的性能测试数量总和不能超过组织的配额 +quota_workspace_excess_org_max_threads=工作空间的最大并发数不能超过组织的配额 +quota_workspace_excess_org_max_duration=工作空间的压测时长不能超过组织的配额 +quota_workspace_excess_org_resource_pool=工作空间的资源池不能超过组织的资源池范围 + diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 326ed9f4f1..00aaf178ce 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -118,7 +118,6 @@ test_case_already_exists_excel=導入文件中存在重復用例 test_case_module_already_exists=同層級下已存在該模塊名稱 api_test_name_already_exists=測試名稱已經存在 functional_method_tip=功能測試不支持自動方式 - #ldap ldap_url_is_null=LDAP地址為空 ldap_dn_is_null=LDAP綁定DN為空 @@ -137,3 +136,9 @@ login_fail_ou_error=登錄失敗,請檢查用戶OU login_fail_filter_error=登錄失敗,請檢查用戶過濾器 check_ldap_mapping=檢查LDAP屬性映射 ldap_mapping_value_null=LDAP用戶屬性映射預設為空值 +#quota +quota_workspace_excess_org_api=工作空間的接口測試數量總和不能超過組織的配額 +quota_workspace_excess_org_performance=工作空間的性能測試數量總和不能超過組織的配額 +quota_workspace_excess_org_max_threads=工作空間的最大並發數不能超過組織的配額 +quota_workspace_excess_org_max_duration=工作空間的壓測時長不能超過組織的配額 +quota_workspace_excess_org_resource_pool=工作空間的資源池不能超過組織的資源池範圍 diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index 7e4d80cc2b..06fc0a321a 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit 7e4d80cc2b870a8cac6dbb9fe6711ab6041faf6d +Subproject commit 06fc0a321a9886419be5c607ddaa6b40efb5179b diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index eac216b9dd..4753741251 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -795,5 +795,7 @@ export default { modify: "Modify Quota", edit_quota_title: "{0} quota", workspace_quota_list: "Workspace quota list of {0}", + unlimited: "Unlimited", + clean: "Clean" } }; diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 8834497980..3791cba509 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -799,5 +799,7 @@ export default { modify: "修改配额", edit_quota_title: "{0}的配额", workspace_quota_list: "{0}的工作空间配额列表", + unlimited: "无限制", + clean: "清空" } }; diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 4b25792273..6aa9cdbc46 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -794,5 +794,7 @@ export default { modify: "修改配額", edit_quota_title: "{0}的配額", workspace_quota_list: "{0}的工作空間配額列表", + unlimited: "無限制", + clean: "清空" } }; From f60e06d4c0fa2ca656437b7cfe009bbe2c2b4f56 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 18 Aug 2020 18:42:55 +0800 Subject: [PATCH 4/4] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20BeanShell=20=E4=BB=A3=E7=A0=81=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../processor/BeanShellProcessor.vue | 78 +++++++++++++++++-- .../components/request/ApiHttpRequestForm.vue | 4 +- .../business/components/api/test/model/JMX.js | 5 +- .../api/test/model/ScenarioModel.js | 4 +- .../common/components/MsInstructionsIcon.vue | 53 +++++++++++++ frontend/src/i18n/en-US.js | 12 +++ frontend/src/i18n/zh-CN.js | 12 +++ frontend/src/i18n/zh-TW.js | 12 +++ 8 files changed, 167 insertions(+), 13 deletions(-) create mode 100644 frontend/src/business/components/common/components/MsInstructionsIcon.vue diff --git a/frontend/src/business/components/api/test/components/processor/BeanShellProcessor.vue b/frontend/src/business/components/api/test/components/processor/BeanShellProcessor.vue index e31efeccbc..f099b402e6 100644 --- a/frontend/src/business/components/api/test/components/processor/BeanShellProcessor.vue +++ b/frontend/src/business/components/api/test/components/processor/BeanShellProcessor.vue @@ -1,16 +1,54 @@ @@ -35,8 +83,28 @@ } .script-content { - padding: 15px 0; - height: 300px; + height: calc(100vh - 570px); + } + + .script-index { + padding: 0 20px; + } + + .script-index div:first-child { + font-weight: bold; + font-size: 15px; + } + + .template-title { + margin-bottom: 5px; + } + + .document-url { + margin-top: 10px; + } + + .instructions-icon { + margin-left: 5px; } diff --git a/frontend/src/business/components/api/test/components/request/ApiHttpRequestForm.vue b/frontend/src/business/components/api/test/components/request/ApiHttpRequestForm.vue index a3e8ff3c1f..363f807b5a 100644 --- a/frontend/src/business/components/api/test/components/request/ApiHttpRequestForm.vue +++ b/frontend/src/business/components/api/test/components/request/ApiHttpRequestForm.vue @@ -68,10 +68,10 @@ - + - + diff --git a/frontend/src/business/components/api/test/model/JMX.js b/frontend/src/business/components/api/test/model/JMX.js index be589de537..a30245399b 100644 --- a/frontend/src/business/components/api/test/model/JMX.js +++ b/frontend/src/business/components/api/test/model/JMX.js @@ -423,10 +423,7 @@ export class BeanShellPreProcessor extends BeanShellProcessor { } export class BeanShellPostProcessor extends BeanShellProcessor { - constructor(testName, script) { - let processor = { - script: script, - }; + constructor(testName, processor) { super('BeanShellPostProcessor', 'TestBeanGUI', 'BeanShellPostProcessor', testName, processor) } } diff --git a/frontend/src/business/components/api/test/model/ScenarioModel.js b/frontend/src/business/components/api/test/model/ScenarioModel.js index c7df9181a4..a2f261f2a8 100644 --- a/frontend/src/business/components/api/test/model/ScenarioModel.js +++ b/frontend/src/business/components/api/test/model/ScenarioModel.js @@ -1,5 +1,5 @@ import { - Arguments, BeanShellPreProcessor, + Arguments, BeanShellPostProcessor, BeanShellPreProcessor, CookieManager, DubboSample, DurationAssertion, @@ -906,7 +906,7 @@ class JMXGenerator { httpSamplerProxy.put(new BeanShellPreProcessor(name, request.beanShellPreProcessor)); } if (request.beanShellPostProcessor && request.beanShellPostProcessor.script) { - httpSamplerProxy.put(new BeanShellPreProcessor(name, request.beanShellPostProcessor)); + httpSamplerProxy.put(new BeanShellPostProcessor(name, request.beanShellPostProcessor)); } } diff --git a/frontend/src/business/components/common/components/MsInstructionsIcon.vue b/frontend/src/business/components/common/components/MsInstructionsIcon.vue new file mode 100644 index 0000000000..75222bd071 --- /dev/null +++ b/frontend/src/business/components/common/components/MsInstructionsIcon.vue @@ -0,0 +1,53 @@ + + + + + diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 8ee3794d6a..41f84c85bf 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -108,6 +108,7 @@ export default { formatErr: 'Format Error', id: 'ID', please_upload: 'Please upload file', + reference_documentation: "Reference documentation", date: { select_date: 'Select date', start_date: 'Start date', @@ -446,6 +447,17 @@ export default { json_path_expression: "JSONPath expression", xpath_expression: "XPath expression", }, + processor: { + pre_exec_script : "PreProcessor", + post_exec_script: "PostProcessor", + code_template: "Code template", + bean_shell_processor_tip: "Currently only BeanShell scripts are supported", + code_template_get_variable: "Get variable", + code_template_set_variable: "Set variable", + code_template_get_response_header: "Get response header", + code_template_get_response_code: "Get response code", + code_template_get_response_result: "Get response result" + }, dubbo: { protocol: "protocol", input_interface: "Please enter the interface", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 4e947594c5..c8dc1f4c9f 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -107,6 +107,7 @@ export default { please_upload: '请上传文件', formatErr: '格式错误', please_save: '请先保存', + reference_documentation: "参考文档", id: 'ID', date: { select_date: '选择日期', @@ -447,6 +448,17 @@ export default { json_path_expression: "JSONPath表达式", xpath_expression: "XPath表达式", }, + processor: { + pre_exec_script : "预执行脚本", + post_exec_script: "后执行脚本", + code_template: "代码模版", + bean_shell_processor_tip: "仅支持 BeanShell 脚本", + code_template_get_variable: "获取变量", + code_template_set_variable: "设置变量", + code_template_get_response_header: "获取响应头", + code_template_get_response_code: "获取响应码", + code_template_get_response_result: "获取响应结果" + }, dubbo: { protocol: "协议", input_interface: "请输入Interface", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 73523d27eb..41ef9669aa 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -105,6 +105,7 @@ export default { formatErr: '格式錯誤', please_save: '請先保存', id: 'ID', + reference_documentation: "參考文檔", please_upload: '請上傳文件', date: { select_date: '選擇日期', @@ -446,6 +447,17 @@ export default { json_path_expression: "JSONPath運算式", xpath_expression: "XPath運算式", }, + processor: { + pre_exec_script : "預執行腳本", + post_exec_script: "後執行腳本", + code_template: "代碼模版", + bean_shell_processor_tip: "僅支持 BeanShell 腳本", + code_template_get_variable: "獲取變量", + code_template_set_variable: "設置變量", + code_template_get_response_header: "獲取響應頭", + code_template_get_response_code: "獲取響應碼", + code_template_get_response_result: "獲取響應結果" + }, dubbo: { protocol: "協定", input_interface: "請輸入Interface",