a little refactor

This commit is contained in:
coderfengyun 2014-03-19 10:19:13 +08:00
parent ae730989ba
commit 40da5adf12
2 changed files with 6 additions and 6 deletions

View File

@ -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<MultipartFile> 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;
}
}

View File

@ -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<String>() {
private static final long serialVersionUID = 1L;
{