a little refa

This commit is contained in:
coderfengyun 2014-02-24 09:27:08 +08:00
parent 2ce5a504ce
commit 456ce88646
2 changed files with 3 additions and 27 deletions

View File

@ -157,31 +157,7 @@ public class TestPlanController extends BaseController {
"You have not power to get test plan running info",
"/getRunningInfo");
}
// TestPlanContext testPlanContext = this.getTestPlanContainer()
// .queryTestPlanContext(testPlanId);
// if (testPlanContext == null) {
// this.getLogger().error("testPlanContext is null!!");
// throw new Bench4QException(CONTEXT_NOT_EXIST,
// THE_CONTEXT_IS_NULL_WHOSE_ID_IS + testPlanId,
// "/getRunningInfo");
// }
// TestPlanDBModel testPlanDBModel = this.getTestPlanService()
// .getTestPlanDBModel(testPlanId);
// this.getLogger().info("testPlanContext exists!");
//
// List<Integer> scriptIds = new LinkedList<Integer>();
// for (RunningScript runningScript : testPlanContext.getAllScript()) {
// scriptIds.add(runningScript.getScriptId());
// }
// List<MonitorModel> monitorModels = new ArrayList<MonitorModel>();
// for (Monitor monitorInBusiness : testPlanContext.getTestPlan()
// .getMonitors()) {
// monitorModels.add(BusinessModelMapFactory
// .toModel(monitorInBusiness));
// }
// return buildResponseModel(this.getTestPlanService()
// .queryTestPlanStatus(testPlanId), testPlanId, scriptIds,
// monitorModels);
return this.getTestPlanService().buildResultModel(testPlanId);
}

View File

@ -68,13 +68,13 @@ public class TestPlanEngine implements TaskCompleteCallback,
ExecutorService executorService = Executors.newCachedThreadPool();
final UUID testPlanId = UUID.randomUUID();
final TestPlanContext testPlanContext = new TestPlanContext(testPlan,
testPlanId);
if (!this.getTestPlanService().submitTestPlan(testPlan, user,
testPlanId)) {
return null;
}
final TestPlanContext testPlanContext = new TestPlanContext(testPlan,
testPlanId);
this.getContainer().addATask(testPlanId, testPlanContext);
Runnable runnable = new Runnable() {
public void run() {