From 6ba38aa94d8a8858781962b01af1a9ab5d827ffb Mon Sep 17 00:00:00 2001 From: daisyonly <1241945585@qq.com> Date: Mon, 1 Sep 2014 14:38:02 +0800 Subject: [PATCH 1/6] edit PluginEntitiFactory.java edit PluginEntitiFactory.java --- .../org/bench4q/master/domain/factory/PluginEntityFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/factory/PluginEntityFactory.java b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/factory/PluginEntityFactory.java index 58cafbc5..ed45204a 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/factory/PluginEntityFactory.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/factory/PluginEntityFactory.java @@ -287,7 +287,7 @@ public class PluginEntityFactory { ParamType parentContainer) { ChoiceType choiceType = new ChoiceType(); choiceType.setValue(XmlParseHelper.getAttribute(element, "value")); - choiceType.setDefaultValue(Boolean.getBoolean(XmlParseHelper + choiceType.setDefaultValue(Boolean.parseBoolean(XmlParseHelper .getAttribute(element, "default"))); choiceType.setParentContainer(parentContainer); return choiceType; From a72cb7a30749dbb9324405c6f878eec6282b3bc8 Mon Sep 17 00:00:00 2001 From: hmm Date: Mon, 1 Sep 2014 14:45:05 +0800 Subject: [PATCH 2/6] add expectedResCode and expectedResCntType to http ui.xml --- .../bench4q/agent/plugin/basic/http/ui.xml | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/ui.xml b/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/ui.xml index 305abc93..8b2b5902 100644 --- a/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/ui.xml +++ b/Bench4Q-Agent/src/main/java/org/bench4q/agent/plugin/basic/http/ui.xml @@ -19,7 +19,12 @@ - + + + + + + @@ -39,6 +44,12 @@ required="false">
+ + + + + + @@ -63,6 +74,12 @@ required="false">
+ + + + + + @@ -87,6 +104,12 @@ required="false">
+ + + + + + From 7ccd47d74ba7e03096d055c2135e7e1b7fde266f Mon Sep 17 00:00:00 2001 From: hmm Date: Mon, 1 Sep 2014 14:45:24 +0800 Subject: [PATCH 3/6] add loadFilterTypeList api --- .../bench4q/master/api/ScriptController.java | 55 ++++++++++++------- .../master/domain/service/ScriptService.java | 27 +++++++++ 2 files changed, 62 insertions(+), 20 deletions(-) diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/api/ScriptController.java b/Bench4Q-Master/src/main/java/org/bench4q/master/api/ScriptController.java index 8dbdcf04..dbfa49cf 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/api/ScriptController.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/api/ScriptController.java @@ -102,14 +102,14 @@ public class ScriptController extends BaseController { if (!this.checkScope(UserService.NORAML_AUTHENTICATION)) { return buildReponseModel(false, "has no power for recording script!!!", "", -1, null, null, - null); + null,null); } Port port = new Port(); synchronized (PORT_LOCK) { port = this.getPortPoolService().getAPortNotInUse(); if (port == null) { return buildReponseModel(false, "port is in use!", "", -1, - null, null, null); + null, null, null,null); } } UUID uuid = UUID.randomUUID(); @@ -118,7 +118,7 @@ public class ScriptController extends BaseController { return buildReponseModel(true, "", this.getScriptCapturer() .getIpHttpCaptureServerAdress(), port.getPort(), null, null, - uuid.toString()); + uuid.toString(),null); } @RequestMapping(value = "/startScriptRecording", method = { @@ -129,13 +129,13 @@ public class ScriptController extends BaseController { if (!checkScope(UserService.NORAML_AUTHENTICATION)) { return buildReponseModel(false, "has no power for stopScriptCapture!!!", "", -1, null, - null, null); + null, null,null); } this.getScriptCapturer().startRecording(port); return buildReponseModel(true, "RecordServer stop", "", port, null, - null, fileNameUUID); + null, fileNameUUID,null); } private String buildScriptSavePath() { @@ -158,7 +158,7 @@ public class ScriptController extends BaseController { if (!checkScope(UserService.NORAML_AUTHENTICATION)) { return buildReponseModel(false, "has no power for stopScriptCapture!!!", "", -1, null, - null, null); + null, null,null); } this.getScriptCapturer().stopCurrentRecord(port); @@ -167,7 +167,7 @@ public class ScriptController extends BaseController { } return buildReponseModel(true, "RecordServer stop", "", port, null, - null, fileNameUUID); + null, fileNameUUID,null); } @RequestMapping(value = "/saveScriptToDB", method = { RequestMethod.GET, @@ -179,14 +179,14 @@ public class ScriptController extends BaseController { if (!this.checkScope(UserService.NORAML_AUTHENTICATION)) { return buildReponseModel(false, "saveScriptToDB check your scope fail!", "", -1, null, - null, null); + null, null,null); } File file = new File(buildScriptSavePath() + System.getProperty("file.separator") + fileNameUUID + ".xml"); if (!file.exists()) { return buildReponseModel(false, "no that script", null, -1, null, - null, fileNameUUID); + null, fileNameUUID,null); } try { String content = FileUtils.readFileToString(file); @@ -195,10 +195,10 @@ public class ScriptController extends BaseController { this.getPrincipal().getId(), content, null); // this.getUserService().add return buildReponseModel(success, "Save to DataBase!!", "", port, - null, null, null); + null, null, null,null); } catch (Exception e) { return buildReponseModel(false, "exception when read from file", - null, -1, null, null, fileNameUUID); + null, -1, null, null, fileNameUUID,null); } } @@ -218,12 +218,12 @@ public class ScriptController extends BaseController { boolean success = this.getScriptService().saveScript(scriptName, this.getPrincipal().getId(), scenarioModel, paramFiles); logger.info("upload script:" + scenarioModel); - return buildReponseModel(success, null, null, -1, null, null, null); + return buildReponseModel(success, null, null, -1, null, null, null,null); } catch (Exception e) { this.logger.error(ExceptionLog.getStackTrace(e)); return buildReponseModel(false, "The script is not in the right format", null, -1, null, - null, null); + null, null,null); } } @@ -238,8 +238,22 @@ public class ScriptController extends BaseController { this.getPrincipal()); return this.buildReponseModel(true, null, null, 0, - dealWithCollection(scripts), null, null); + dealWithCollection(scripts), null, null,null); } + + @RequestMapping(value = "/loadFilterTypeList", method = { RequestMethod.POST, + RequestMethod.GET }) + @ResponseBody + public OperateScriptServerResponseModel loadFilterTypeList() { + if (!this.checkScope(UserService.NORAML_AUTHENTICATION)) { + return null; + } + String[] filterTypeList = this.getScriptService().loadFilterTypeList(); + + return this.buildReponseModel(true, null, null, 0, + null, null, null,filterTypeList); + } + @RequestMapping(value = "/queryScriptsByDate", method = RequestMethod.POST) @ResponseBody @@ -252,7 +266,7 @@ public class ScriptController extends BaseController { .queryScriptsByCreateTime(startDate, endDate, this.getPrincipal()); return this.buildReponseModel(true, null, null, 0, - dealWithCollection(scripts), null, null); + dealWithCollection(scripts), null, null,null); } private List dealWithCollection(Collection