add new api for query fields can be limited

add new api for query fields can be limited
This commit is contained in:
coderfengyun 2014-09-19 13:47:44 +08:00
parent fa8aa5b22c
commit 6676927944
3 changed files with 33 additions and 3 deletions

View File

@ -4,6 +4,7 @@ import java.util.UUID;
import java.util.concurrent.ExecutionException;
import org.bench4q.monitor.model.LimitModel;
import org.bench4q.monitor.model.LimitableFieldsModel;
import org.bench4q.monitor.model.MonitorMain;
import org.hyperic.sigar.SigarException;
import org.springframework.stereotype.Controller;
@ -24,7 +25,13 @@ public class MainController {
return retModel;
}
@RequestMapping("/startMonitor/{testPlanId}")
@RequestMapping(value = "/limitableFields")
@ResponseBody
public LimitableFieldsModel limitableFields() {
return new LimitableFieldsModel();
}
@RequestMapping(value = "/startMonitor/{testPlanId}", method = RequestMethod.PUT)
@ResponseBody
public String start(@PathVariable UUID testPlanId,
@RequestBody LimitModel limits) {

View File

@ -0,0 +1,23 @@
package org.bench4q.monitor.model;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class LimitableFieldsModel {
private List<String> fields;
@XmlElementWrapper(name = "fieldList")
@XmlElement(name = "field")
public List<String> getFields() {
return fields;
}
public void setFields(List<String> fields) {
this.fields = fields;
}
}

View File

@ -9,6 +9,7 @@ import org.bench4q.recorder.httpcapture.Bench4qTestScriptAdapter;
import org.bench4q.share.helper.RunScenarioModelHelper;
import org.bench4q.share.models.agent.ParameterModel;
import org.bench4q.share.models.agent.RunScenarioModel;
import org.bench4q.share.models.agent.scriptrecord.BehaviorModel;
import org.junit.Test;
public class TestBench4qTestScriptAdapter {
@ -34,8 +35,7 @@ public class TestBench4qTestScriptAdapter {
params.add(RunScenarioModelHelper.createParameterModel("url",
"www.baidu.com"));
this.getBench4qTestScriptAdapter().insertUserBehaviorsToScenario(
RunScenarioModelHelper.createUserBehaviorModel(0, "http",
"get", params));
BehaviorModel.UserBehaviorBuilder(0, "http", "get", params));
assertEquals(
1,
RunScenarioModelHelper.getBatches(