redefine the dtd file

redefine the dtd file
This commit is contained in:
coderfengyun 2014-04-17 10:56:26 +08:00
parent 9a407a3b04
commit b24375664c
4 changed files with 36 additions and 4 deletions

View File

@ -1,4 +1,4 @@
<!ELEMENT ui (plugin,(behavior|timer)*)>
<!ELEMENT ui (plugin,(behavior|timer|control)*)>
<!ELEMENT plugin (params)>
<!ATTLIST plugin
name CDATA #REQUIRED
@ -6,11 +6,16 @@
<!ELEMENT behavior (params)>
<!ATTLIST behavior
name CDATA #REQUIRED
type CDATA #REQUIRED
>
<!ELEMENT timer (params)>
<!ATTLIST timer
name CDATA #REQUIRED
>
<!ELEMENT control (params)>
<!ATTLIST control
name CDATA #REQIRED
>
<!ELEMENT params (param|group)*>
<!ELEMENT param (radiobutton|field|checkbox|nfield|combo|table|file)>
<!ATTLIST param

View File

@ -9,6 +9,10 @@ import org.bench4q.share.models.agent.ParameterModel;
import org.bench4q.share.models.agent.scriptrecord.BehaviorModel;
public abstract class Behavior {
private static final String CONTROLBEHAVIOR = "CONTROLBEHAVIOR";
private static final String USERBEHAVIOR = "USERBEHAVIOR";
private static final String TIMERBEHAVIOR = "TIMERBEHAVIOR";
private int id;
private String use;
private String name;
@ -68,10 +72,12 @@ public abstract class Behavior {
public static Behavior buildWith(BehaviorModel behaviorModel) {
Behavior behavior = null;
if (behaviorModel.getType().equalsIgnoreCase("TIMERBEHAVIOR")) {
if (behaviorModel.getType().equalsIgnoreCase(TIMERBEHAVIOR)) {
behavior = new TimerBehavior();
} else if (behaviorModel.getType().equalsIgnoreCase("USERBEHAVIOR")) {
} else if (behaviorModel.getType().equalsIgnoreCase(USERBEHAVIOR)) {
behavior = new UserBehavior();
} else if (behaviorModel.getType().equals(CONTROLBEHAVIOR)) {
behavior = new ControlBehavior();
} else {
throw new IllegalArgumentException(
"The input BehaviorModel's type is not proper");

View File

@ -0,0 +1,21 @@
package org.bench4q.agent.scenario.behavior;
import java.util.Map;
import org.bench4q.agent.datacollector.DataCollector;
import org.bench4q.agent.datacollector.impl.BehaviorStatusCodeResult;
public class ControlBehavior extends Behavior {
@Override
public boolean shouldBeCountResponseTime() {
return false;
}
@Override
public Map<Integer, BehaviorStatusCodeResult> getBehaviorBriefResult(
DataCollector dataStatistics) {
return null;
}
}

View File

@ -1 +1 @@
masterAddress=133.133.12.1:8080/
masterAddress=133.133.12.1:7979/