refactor
This commit is contained in:
coderfengyun 2014-04-17 15:14:41 +08:00
parent b1b7fa28a1
commit fcee930598
2 changed files with 5 additions and 10 deletions

View File

@ -158,7 +158,7 @@ public class TestPlan implements IAggregate {
} }
@Transient @Transient
public LoadDistribute getLoadDistribute() { private LoadDistribute getLoadDistribute() {
return loadDistribute; return loadDistribute;
} }
@ -167,7 +167,7 @@ public class TestPlan implements IAggregate {
} }
@Transient @Transient
public TestResultSave getTestResultSave() { private TestResultSave getTestResultSave() {
return testResultSave; return testResultSave;
} }
@ -207,8 +207,7 @@ public class TestPlan implements IAggregate {
if (isFinish()) { if (isFinish()) {
scheScheduledExecutorService.shutdown(); scheScheduledExecutorService.shutdown();
} }
getTestResultSave().update(TestPlan.this, collectResult());
doSaveResult(collectResult());
} }
}, 0, this.getSampleCycleInSeconds(), TimeUnit.SECONDS); }, 0, this.getSampleCycleInSeconds(), TimeUnit.SECONDS);
} catch (Exception e) { } catch (Exception e) {
@ -218,7 +217,7 @@ public class TestPlan implements IAggregate {
} }
public List<Object> collectResult() { private List<Object> collectResult() {
List<Object> resultList = new LinkedList<Object>(); List<Object> resultList = new LinkedList<Object>();
for (TestPlanScript testPlanScript : getTestPlanScripts()) { for (TestPlanScript testPlanScript : getTestPlanScripts()) {
List<TestPlanScriptResult> testPlanScriptResults = testPlanScript List<TestPlanScriptResult> testPlanScriptResults = testPlanScript
@ -237,10 +236,6 @@ public class TestPlan implements IAggregate {
} }
public void doSaveResult(List<Object> results) {
this.getTestResultSave().update(this, results);
}
@Transient @Transient
public boolean isFinish() { public boolean isFinish() {
for (TestPlanScript testPlanScript : this.getTestPlanScripts()) { for (TestPlanScript testPlanScript : this.getTestPlanScripts()) {

View File

@ -75,7 +75,7 @@ public class LoadDistribute {
testPlanInDomain.doAfterRun(); testPlanInDomain.doAfterRun();
} }
public boolean distributeLoadForScript(RunningScriptInterface runningScript) { private boolean distributeLoadForScript(RunningScriptInterface runningScript) {
return distributeLoadForScript(runningScript, return distributeLoadForScript(runningScript,
runningScript.getRequireLoad()); runningScript.getRequireLoad());
} }