add observer to testplan when running

This commit is contained in:
hmm 2014-09-25 14:47:30 +08:00
parent 65aec6550e
commit d461e5f325
1 changed files with 1 additions and 1 deletions

View File

@ -128,7 +128,6 @@ public class TestPlanEngine implements TaskCompleteCallback,
throws IllegalParameterException { throws IllegalParameterException {
TestPlan testPlan = this.getTestPlanFactory().createATestPlanWithoutId( TestPlan testPlan = this.getTestPlanFactory().createATestPlanWithoutId(
testPlanBusinessModel, user, testPlanRunId); testPlanBusinessModel, user, testPlanRunId);
testPlan.addObserver(this);
Logger.getLogger(TestPlanService.class).info( Logger.getLogger(TestPlanService.class).info(
"test plan name:" + testPlan.getName()); "test plan name:" + testPlan.getName());
return this.getTestPlanRepository().attach(testPlan); return this.getTestPlanRepository().attach(testPlan);
@ -142,6 +141,7 @@ public class TestPlanEngine implements TaskCompleteCallback,
+ testPlanId.toString()); + testPlanId.toString());
return; return;
} }
testPlan.addObserver(this);
testPlan.run(); testPlan.run();
this.getTestPlanRepository().attachRunningTestPlan(testPlan); this.getTestPlanRepository().attachRunningTestPlan(testPlan);
} }