refactor the runTestPlanWithTestPlanModel

This commit is contained in:
Tienan Chen 2013-11-18 09:03:25 +08:00
parent 479444691f
commit b60b33ab79
3 changed files with 5 additions and 6 deletions

View File

@ -109,7 +109,10 @@ public class TestPlanController extends BaseController {
UUID testPlanRunID = this.getTestPlanRunner().runTestPlanWithModel( UUID testPlanRunID = this.getTestPlanRunner().runTestPlanWithModel(
testPlanModel, this.getPrincipal()); testPlanModel, this.getPrincipal());
if (testPlanRunID == null) {
buildResponseModel(TestPlanStatus.ErrorInSubmitTask, null, null,
null);
}
return buildResponseModel(this.getTestPlanService() return buildResponseModel(this.getTestPlanService()
.queryTestPlanStatus(testPlanRunID), testPlanRunID, null, .queryTestPlanStatus(testPlanRunID), testPlanRunID, null,
testPlanModel.getMonitorModles()); testPlanModel.getMonitorModles());

View File

@ -1,5 +1,5 @@
package org.bench4q.master.api; package org.bench4q.master.api;
public enum TestPlanStatus { public enum TestPlanStatus {
NotStart, InRunning, Complete, PendingNoEnoughMaxLoad, PendingNoEnoughCurrentLoad, Error NotStart, InRunning, Complete, PendingNoEnoughMaxLoad, PendingNoEnoughCurrentLoad, Error, ErrorInSubmitTask
} }

View File

@ -97,10 +97,6 @@ public class TestPlanRunner implements TaskCompleteCallback,
ExecutorService executorService = Executors.newCachedThreadPool(); ExecutorService executorService = Executors.newCachedThreadPool();
final UUID testPlanId = UUID.randomUUID(); final UUID testPlanId = UUID.randomUUID();
// final TestPlanContext testPlanContext = new TestPlanContext();
// testPlanContext.fillScriptMap(testPlanModel.getRunningScriptModels(),
// testPlanId);
// testPlanContext.setTestPlanModel(testPlanModel);
final TestPlanContext testPlanContext = new TestPlanContext( final TestPlanContext testPlanContext = new TestPlanContext(
testPlanModel, testPlanId); testPlanModel, testPlanId);
if (!this.testPlanService.saveTestPlanToDB(testPlanModel, user, if (!this.testPlanService.saveTestPlanToDB(testPlanModel, user,