From 40da5adf12fb90937f10105d0408a5c44653c284 Mon Sep 17 00:00:00 2001 From: coderfengyun Date: Wed, 19 Mar 2014 10:19:13 +0800 Subject: [PATCH] a little refactor --- .../java/org/bench4q/agent/api/TestController.java | 10 +++++----- .../org/bench4q/agent/test/TestWithScriptFile.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/bench4q/agent/api/TestController.java b/src/main/java/org/bench4q/agent/api/TestController.java index 7ac0e847..736b1032 100644 --- a/src/main/java/org/bench4q/agent/api/TestController.java +++ b/src/main/java/org/bench4q/agent/api/TestController.java @@ -65,24 +65,24 @@ public class TestController { this.paramFileCollector = paramFileCollector; } - @RequestMapping(value = "/submitScenarioWithModel", method = RequestMethod.POST) + @RequestMapping(value = "/submitScenarioWithParams", method = RequestMethod.POST) @ResponseBody public String submitParams( @RequestParam("files[]") List files, - @RequestParam("scenarioModel") String scenarioContent) { + @RequestParam("scenarioModel") String scenarioModel) { try { UUID runId = UUID.randomUUID(); this.getParamFileCollector().collectParamFiles(files, runId); - System.out.println(scenarioContent); + System.out.println(scenarioModel); RunScenarioModel runScenarioModel = (RunScenarioModel) MarshalHelper - .unmarshal(RunScenarioModel.class, scenarioContent); + .unmarshal(RunScenarioModel.class, scenarioModel); this.getScenarioEngine().submitScenario(runId, Scenario.scenarioBuilder(runScenarioModel), runScenarioModel.getPoolSize()); return MarshalHelper.tryMarshal(buildWith(runId)); } catch (Exception e) { - logger.error("/submit", e); + logger.error("/submitScenarioWithParams", e); return null; } } diff --git a/src/test/java/org/bench4q/agent/test/TestWithScriptFile.java b/src/test/java/org/bench4q/agent/test/TestWithScriptFile.java index 7793652c..e2aebbc4 100644 --- a/src/test/java/org/bench4q/agent/test/TestWithScriptFile.java +++ b/src/test/java/org/bench4q/agent/test/TestWithScriptFile.java @@ -193,7 +193,7 @@ public class TestWithScriptFile { files.add(new File("Scripts" + System.getProperty("file.separator") + "testJD.xml")); HttpResponse httpResponse = this.getHttpRequester().postFiles( - url + "/submitScenarioWithModel", "files[]", files, + url + "/submitScenarioWithParams", "files[]", files, "scenarioModel", new LinkedList() { private static final long serialVersionUID = 1L; {