little refa

This commit is contained in:
coderfengyun 2013-12-30 14:48:29 +08:00
parent 5f0aa0a45c
commit 17888714a3
2 changed files with 10 additions and 1 deletions

View File

@ -47,7 +47,7 @@ public class TestPlanContext {
public void cleanUpFinishedContext() { public void cleanUpFinishedContext() {
this.setFinish(true); this.setFinish(true);
this.setTestPlan(null); this.setTestPlan(null);
this.setRunningScriptMap(null); this.setRunningScriptMap(new HashMap<Integer, RunningScript>());
System.gc(); System.gc();
} }

View File

@ -59,4 +59,13 @@ public class Test_TestPlanContext extends TestBase_MakeUpTestPlan {
public void testGetTotalLoad() { public void testGetTotalLoad() {
assertEquals(40, this.getTestPlanContext().getTotalLoad()); assertEquals(40, this.getTestPlanContext().getTotalLoad());
} }
@Test
public void testCleanUpFinishedContext() {
assertEquals(1, this.getTestPlanContext().getScriptCount());
this.getTestPlanContext().cleanUpFinishedContext();
assertEquals(0, this.getTestPlanContext().getScriptCount());
assertEquals(0, this.getTestPlanContext().getAllScript().size());
assertNull(this.getTestPlanContext().queryRunningScript(USE_SCRIPT));
}
} }