add assisting methods for test

refactor, let the schedule be the stand-alone one
This commit is contained in:
coderfengyun 2014-09-02 14:31:38 +08:00
parent 5564c9d78b
commit 6e973cf6db
1 changed files with 11 additions and 1 deletions

View File

@ -129,6 +129,16 @@ public abstract class TestBase {
final Scenario scenario, int poolSize, PluginManager pluginManager) {
ScenarioContext scenarioContext = ScenarioContext.buildScenarioContextWithoutScenario(
testId, poolSize, pluginManager);
return scenarioContext.addScenrio(scenario, Schedule.build(new ScheduleModel()), new Date().getTime());
return scenarioContext.addScenrio(scenario, Schedule.build(buildScheduleModel()), new Date().getTime());
}
public static ScheduleModel buildScheduleModel(){
ScheduleModel scheduleModel = new ScheduleModel();
List<PointModel> points = new LinkedList<ScheduleModel.PointModel>();
points.add(new PointModel(0, 0));
points.add(new PointModel(20 * 1000, 20));
points.add(new PointModel(60 * 1000, 20));
scheduleModel.setPoints(points);
return scheduleModel;
}
}