From 3d958fe8c56660ffa53395ffabf7e898a7de2efa Mon Sep 17 00:00:00 2001 From: Zhen Tang Date: Wed, 26 Jun 2013 15:11:24 +0800 Subject: [PATCH] Scenario added. --- .../org/bench4q/agent/scenario/Parameter.java | 29 +++++++++++++ .../org/bench4q/agent/scenario/Scenario.java | 32 +++++++++++++++ .../org/bench4q/agent/scenario/UsePlugin.java | 41 +++++++++++++++++++ .../bench4q/agent/scenario/UserBehavior.java | 40 ++++++++++++++++++ 4 files changed, 142 insertions(+) create mode 100644 src/main/java/org/bench4q/agent/scenario/Parameter.java create mode 100644 src/main/java/org/bench4q/agent/scenario/Scenario.java create mode 100644 src/main/java/org/bench4q/agent/scenario/UsePlugin.java create mode 100644 src/main/java/org/bench4q/agent/scenario/UserBehavior.java diff --git a/src/main/java/org/bench4q/agent/scenario/Parameter.java b/src/main/java/org/bench4q/agent/scenario/Parameter.java new file mode 100644 index 00000000..0947b4d9 --- /dev/null +++ b/src/main/java/org/bench4q/agent/scenario/Parameter.java @@ -0,0 +1,29 @@ +package org.bench4q.agent.scenario; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "parameter") +public class Parameter { + private String key; + private String value; + + @XmlElement + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + @XmlElement + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + +} diff --git a/src/main/java/org/bench4q/agent/scenario/Scenario.java b/src/main/java/org/bench4q/agent/scenario/Scenario.java new file mode 100644 index 00000000..4853c8d5 --- /dev/null +++ b/src/main/java/org/bench4q/agent/scenario/Scenario.java @@ -0,0 +1,32 @@ +package org.bench4q.agent.scenario; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "scenario") +public class Scenario { + private UsePlugin[] usePlugins; + private UserBehavior[] userBehaviors; + + @XmlElementWrapper(name = "plugins") + @XmlElement(name = "plugin") + public UsePlugin[] getUsePlugins() { + return usePlugins; + } + + public void setUsePlugins(UsePlugin[] usePlugins) { + this.usePlugins = usePlugins; + } + + @XmlElementWrapper(name = "userBehaviors") + @XmlElement(name = "userBehavior") + public UserBehavior[] getUserBehaviors() { + return userBehaviors; + } + + public void setUserBehaviors(UserBehavior[] userBehaviors) { + this.userBehaviors = userBehaviors; + } + +} diff --git a/src/main/java/org/bench4q/agent/scenario/UsePlugin.java b/src/main/java/org/bench4q/agent/scenario/UsePlugin.java new file mode 100644 index 00000000..44a85143 --- /dev/null +++ b/src/main/java/org/bench4q/agent/scenario/UsePlugin.java @@ -0,0 +1,41 @@ +package org.bench4q.agent.scenario; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "usePlugin") +public class UsePlugin { + private String id; + private String name; + private Parameter[] parameters; + + @XmlElement + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @XmlElement + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @XmlElementWrapper(name = "parameters") + @XmlElement(name = "parameter") + public Parameter[] getParameters() { + return parameters; + } + + public void setParameters(Parameter[] parameters) { + this.parameters = parameters; + } + +} diff --git a/src/main/java/org/bench4q/agent/scenario/UserBehavior.java b/src/main/java/org/bench4q/agent/scenario/UserBehavior.java new file mode 100644 index 00000000..976800fd --- /dev/null +++ b/src/main/java/org/bench4q/agent/scenario/UserBehavior.java @@ -0,0 +1,40 @@ +package org.bench4q.agent.scenario; + +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlRootElement; + +@XmlRootElement(name = "userBehavior") +public class UserBehavior { + private String use; + private String name; + private Parameter[] parameters; + + @XmlElement + public String getUse() { + return use; + } + + public void setUse(String use) { + this.use = use; + } + + @XmlElement + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @XmlElementWrapper(name = "parameters") + @XmlElement(name = "parameter") + public Parameter[] getParameters() { + return parameters; + } + + public void setParameters(Parameter[] parameters) { + this.parameters = parameters; + } +}