refactor
This commit is contained in:
coderfengyun 2014-09-19 10:59:54 +08:00
parent 423ae1c21d
commit fa8aa5b22c
2 changed files with 6 additions and 4 deletions

View File

@ -21,8 +21,8 @@ public class RunScenarioModelHelper {
public static BehaviorModel createUserBehaviorModel(int id, String use, public static BehaviorModel createUserBehaviorModel(int id, String use,
String name, List<ParameterModel> parameterModels) { String name, List<ParameterModel> parameterModels) {
return BehaviorModel.UserBehaviorBuilder(id, name, use, return BehaviorModel
parameterModels); .UserBehaviorBuilder(id, name, use, parameterModels);
} }
public static ParameterModel createParameterModel(String key, String value) { public static ParameterModel createParameterModel(String key, String value) {

View File

@ -10,6 +10,8 @@ import org.bench4q.share.models.agent.ParameterModel;
@XmlRootElement(name = "behaviorModel") @XmlRootElement(name = "behaviorModel")
public class BehaviorModel { public class BehaviorModel {
private static final String USER_BEHAVIOR = "USERBEHAVIOR";
private static final String TIMER_BEHAVIOR = "TIMERBEHAVIOR";
private int id; private int id;
private String use; private String use;
private String name; private String name;
@ -70,7 +72,7 @@ public class BehaviorModel {
String use, List<ParameterModel> parameters) { String use, List<ParameterModel> parameters) {
BehaviorModel behaviorBaseModel = buildBehaviorModelWithoutType(id, BehaviorModel behaviorBaseModel = buildBehaviorModelWithoutType(id,
name, use, parameters); name, use, parameters);
behaviorBaseModel.setType("TIMERBEHAVIOR"); behaviorBaseModel.setType(TIMER_BEHAVIOR);
return behaviorBaseModel; return behaviorBaseModel;
} }
@ -88,7 +90,7 @@ public class BehaviorModel {
String use, List<ParameterModel> parameters) { String use, List<ParameterModel> parameters) {
BehaviorModel behaviorBaseModel = buildBehaviorModelWithoutType(id, BehaviorModel behaviorBaseModel = buildBehaviorModelWithoutType(id,
name, use, parameters); name, use, parameters);
behaviorBaseModel.setType("USERBEHAVIOR"); behaviorBaseModel.setType(USER_BEHAVIOR);
return behaviorBaseModel; return behaviorBaseModel;
} }