ok, i can run it now

ok, i can run it now
This commit is contained in:
coderfengyun 2014-09-04 14:45:42 +08:00
parent 5a0a1074c9
commit 5390aa5c05
3 changed files with 13 additions and 15 deletions

View File

@ -73,6 +73,15 @@ public class TestPlanScript implements RunningScriptInterface {
this.script = script;
}
@Column(name = "filteredScriptContent", columnDefinition = "LONGTEXT", nullable = true)
public String getFilteredScriptCnt() {
return filteredScriptCnt;
}
public void setFilteredScriptCnt(String filteredScriptCnt) {
this.filteredScriptCnt = filteredScriptCnt;
}
@Column(name = "requireLoad", nullable = false)
public int getRequireLoad() {
return requireLoad;
@ -307,12 +316,4 @@ public class TestPlanScript implements RunningScriptInterface {
return this.getPlanedConfig().getScheduleContent();
}
@Transient
public String getFilteredScriptCnt() {
return filteredScriptCnt;
}
public void setFilteredScriptCnt(String filteredScriptCnt) {
this.filteredScriptCnt = filteredScriptCnt;
}
}

View File

@ -54,11 +54,8 @@ public class Test_TestPlan extends TestBase_MakeUpTestPlan {
@Test
public void testRun() throws InterruptedException {
assertTrue(this.getHaPool().getCurrentAvailableLoad() >= 500);
TestPlan testPlanFromRepo = this.getTestPlanRepository()
TestPlan testPlanInDomain = this.getTestPlanRepository()
.getTestPlanInDomainBy(getTestPlanRunIdUuid());
TestPlan testPlanInDomain = this.getTestPlanFactory().convertToDomain(
testPlanFromRepo);
this.getTestPlanRepository().attachRunningTestPlan(testPlanInDomain);
testPlanInDomain.run();
this.getTestPlanRepository().attachRunningTestPlan(testPlanInDomain);
assertEquals(TestPlanStatus.InRunning.name(),

View File

@ -28,6 +28,7 @@ import org.bench4q.master.infrastructure.communication.AgentMessenger;
import org.bench4q.master.infrastructure.highavailable.HighAvailablePool;
import org.bench4q.master.unitTest.controller.TestBase;
import org.bench4q.share.enums.master.TestPlanStatus;
import org.bench4q.share.models.agent.ScriptFilterOptionsModel;
import org.bench4q.share.models.agent.scriptrecord.ScheduleModel;
import org.bench4q.share.models.agent.scriptrecord.ScheduleModel.PointModel;
import org.bench4q.share.models.master.MonitorModel;
@ -290,9 +291,7 @@ public class TestBase_MakeUpTestPlan extends TestBase {
model = createATestPlanWithOneScript(scriptOne);
}
try {
this.getTestPlanRepository().attach(
this.testPlanFactory.createATestPlanWithoutId(model, user,
testPlanRunId));
this.getTestPlanEngine().submitTestPlan(model, user, testPlanRunId);
} catch (Exception e) {
e.printStackTrace();
}
@ -396,6 +395,7 @@ public class TestBase_MakeUpTestPlan extends TestBase {
public static RunningScriptModel buildScriptModel(int scriptID) {
RunningScriptModel model = new RunningScriptModel();
model.setScriptId(scriptID);
model.setScriptFilterOptionsModel(new ScriptFilterOptionsModel());
model.setRequireLoad(EACH_SCRIPT_LOAD_SMALLSCALE);
ScheduleModel schedule = new ScheduleModel();
schedule.getPoints().add(new PointModel(0, 0));