refactor
This commit is contained in:
coderfengyun 2014-09-26 17:02:02 +08:00
parent ef5571feae
commit 13e83c16df
2 changed files with 11 additions and 4 deletions

View File

@ -1,6 +1,7 @@
package org.bench4q.agent.api;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@ -87,6 +88,7 @@ public class TestController {
try {
this.getParamFileCollector().collectParamFiles(files, runId);
System.out.println(scenarioModel);
logger.info("Real start time is:" + new Date(realStartTime));
RunScenarioModel runScenarioModel = MarshalHelper.unmarshal(
RunScenarioModel.class, scenarioModel);
System.out.println(scheduleContent);
@ -166,6 +168,9 @@ public class TestController {
.getBehaviorBriefResult(scenarioContext
.getDataCollector());
logger.info(pluginImplementBehavior.getId());
if (briefModel == null) {
continue;
}
briefModel.setBehaviorUrl(pluginImplementBehavior
.getSpecificParamValue("url"));
behaviorBriefModels.add(briefModel);

View File

@ -91,13 +91,15 @@ public class Schedule extends Observable {
* @return get the segment by binary search
*/
public Segment getSegment(long timeInMilliSecond) {
if (this.getSegments() == null
|| this.getSegments().size() < 1
|| timeInMilliSecond < this.getSegments().get(0).start
.getTimeInMilliSecond()) {
if (this.getSegments() == null || this.getSegments().size() < 1) {
throw new Bench4QRunTimeException(
"can't getSegment when segments' size is LT 1");
}
if (timeInMilliSecond < this.getSegments().get(0).start
.getTimeInMilliSecond()) {
throw new Bench4QRunTimeException(
"can't getSegment when timeInMilliSecond LT 0-segment's start");
}
if (timeInMilliSecond >= this.getSegments().get(
this.getSegments().size() - 1).end.getTimeInMilliSecond()) {
this.reachEnd();