a little refactor
This commit is contained in:
parent
ae730989ba
commit
40da5adf12
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue