add jstree and edit useBahavior
This commit is contained in:
parent
f6d63208ee
commit
859b9696b9
|
@ -1,190 +1,190 @@
|
|||
package org.bench4q.web.api;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.bench4q.share.models.master.MonitorMemoryResponseModel;
|
||||
import org.bench4q.share.models.master.MonitorNetworkReponseModel;
|
||||
import org.bench4q.share.models.master.MonitorPhysicalDiskResponseModel;
|
||||
import org.bench4q.share.models.master.MonitorProcessorResponseModel;
|
||||
import org.bench4q.web.masterMessager.MonitorMessager;
|
||||
import org.bench4q.web.model.ResultModel;
|
||||
import org.bench4q.web.service.MonitorService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.SessionAttributes;
|
||||
|
||||
@Controller
|
||||
@SessionAttributes({ "accessToken" })
|
||||
public class MonitorController extends BaseController {
|
||||
private MonitorMessager monitorMessager;
|
||||
|
||||
private final String port = "5556";
|
||||
private MonitorService monitorService;
|
||||
|
||||
public MonitorMessager getMonitorMessager() {
|
||||
return monitorMessager;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public void setMonitorMessager(MonitorMessager monitorMessager) {
|
||||
this.monitorMessager = monitorMessager;
|
||||
}
|
||||
|
||||
public MonitorService getMonitorService() {
|
||||
return monitorService;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public void setMonitorService(MonitorService monitorService) {
|
||||
this.monitorService = monitorService;
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/{ip}/cpu/{fieldName}/{startTime}")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getCpuResult(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable("testPlanId") String testplanId,
|
||||
@PathVariable String ip, @PathVariable String fieldName,
|
||||
@PathVariable String startTime) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
MonitorProcessorResponseModel monitorProcessorResponseModel = this
|
||||
.getMonitorMessager().porcessor(accessToken, testplanId, ip,
|
||||
port, startTime);
|
||||
if (monitorProcessorResponseModel == null) {
|
||||
return fail(map, SERVER_ERROR);
|
||||
}
|
||||
|
||||
List<ResultModel> resultModels = this.getMonitorService()
|
||||
.extractMonitorResult(
|
||||
monitorProcessorResponseModel.getProcessorModels(),
|
||||
fieldName);
|
||||
|
||||
if (resultModels == null) {
|
||||
return fail(map, SERVER_ERROR);
|
||||
} else {
|
||||
success(map);
|
||||
map.put("result", resultModels);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
// @RequestMapping("/{testPlanId}/SUT/{ip}/cpu/{cpuInstance}/{fieldName}/{startTime}")
|
||||
// @ResponseBody
|
||||
// public Map<String, Object> getCpuResult(
|
||||
// @ModelAttribute("accessToken") String accessToken,
|
||||
// @PathVariable("testPlanId") String testplanId,
|
||||
// @PathVariable String ip, @PathVariable String port,
|
||||
// @PathVariable String cpuInstance, @PathVariable String fieldName,
|
||||
// @PathVariable String startTime) {
|
||||
// Map<String, Object> map = new HashMap<String, Object>();
|
||||
// MonitorProcessorResponseModel monitorProcessorResponseModel = this
|
||||
// .getMonitorMessager().porcessor(accessToken, testplanId, ip,
|
||||
// port, startTime);
|
||||
// if (monitorProcessorResponseModel == null) {
|
||||
// return fail(map, SERVER_ERROR);
|
||||
// }
|
||||
//
|
||||
// List<ResultModel> resultModels = this.getMonitorService()
|
||||
// .extractCpuResultModelList(
|
||||
// monitorProcessorResponseModel.getProcessorModels(),
|
||||
// cpuInstance, fieldName);
|
||||
// if (resultModels == null) {
|
||||
// return fail(map, SERVER_ERROR);
|
||||
// } else {
|
||||
// success(map);
|
||||
// map.put("result", resultModels);
|
||||
// return map;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
@RequestMapping("/{testPlanId}/{ip}/memory/{fieldName}/{startTime}")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getMemoryStatus(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable("testPlanId") String testPlanId,
|
||||
@PathVariable String ip, @PathVariable String fieldName,
|
||||
@PathVariable String startTime) {
|
||||
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
MonitorMemoryResponseModel monitorMemoryResponseModel = this
|
||||
.getMonitorMessager().memory(accessToken, testPlanId, ip, port,
|
||||
startTime);
|
||||
if (monitorMemoryResponseModel == null) {
|
||||
return fail(map, SERVER_ERROR);
|
||||
}
|
||||
List<ResultModel> resultModels = this
|
||||
.getMonitorService()
|
||||
.extractMonitorResult(
|
||||
monitorMemoryResponseModel.getMemoryModels(), fieldName);
|
||||
if (resultModels == null) {
|
||||
return fail(map, SERVER_ERROR);
|
||||
} else {
|
||||
map = success(map);
|
||||
map.put("result", resultModels);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/{ip}/physicalDisk/{fieldName}/{startTime}")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getPhysicalDisk(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable("testPlanId") String testPlanId,
|
||||
@PathVariable String ip, @PathVariable String fieldName,
|
||||
@PathVariable String startTime) {
|
||||
Map<String, Object> map = new HashMap<String,Object>();
|
||||
MonitorPhysicalDiskResponseModel monitorPhysicalDiskResponseModel = this
|
||||
.getMonitorMessager().physicalDisk(accessToken, testPlanId, ip,
|
||||
port, startTime);
|
||||
if (monitorPhysicalDiskResponseModel == null) {
|
||||
return fail(map, SERVER_ERROR);
|
||||
}
|
||||
List<ResultModel> resultModels = this
|
||||
.getMonitorService()
|
||||
.extractMonitorResult(
|
||||
monitorPhysicalDiskResponseModel
|
||||
.getPhysicalDiskModels(),
|
||||
fieldName);
|
||||
if (resultModels == null) {
|
||||
return fail(map, "");
|
||||
} else {
|
||||
map = success(map);
|
||||
map.put("result", resultModels);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/{ip}/network/{fieldName}/{startTime}")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getNetworkStaus(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable("testPlanId") String testPlanId,
|
||||
@PathVariable String ip, @PathVariable String fieldName,
|
||||
@PathVariable String startTime) {
|
||||
Map<String, Object> map = new HashMap<String,Object>();
|
||||
MonitorNetworkReponseModel monitorNetworkReponseModel = this
|
||||
.getMonitorMessager().network(accessToken, testPlanId, ip,
|
||||
port, startTime);
|
||||
|
||||
if (monitorNetworkReponseModel == null) {
|
||||
return fail(map, SERVER_ERROR);
|
||||
}
|
||||
List<ResultModel> resultModels = this.getMonitorService()
|
||||
.extractMonitorResult(monitorNetworkReponseModel.getModels(),
|
||||
fieldName);
|
||||
if (resultModels == null) {
|
||||
return fail(map, SERVER_ERROR);
|
||||
} else {
|
||||
map = success(map);
|
||||
map.put("result", resultModels);
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
package org.bench4q.web.api;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.bench4q.share.models.master.MonitorMemoryResponseModel;
|
||||
import org.bench4q.share.models.master.MonitorNetworkReponseModel;
|
||||
import org.bench4q.share.models.master.MonitorPhysicalDiskResponseModel;
|
||||
import org.bench4q.share.models.master.MonitorProcessorResponseModel;
|
||||
import org.bench4q.web.masterMessager.MonitorMessager;
|
||||
import org.bench4q.web.model.ResultModel;
|
||||
import org.bench4q.web.service.MonitorService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.SessionAttributes;
|
||||
|
||||
@Controller
|
||||
@SessionAttributes({ "accessToken" })
|
||||
public class MonitorController extends BaseController {
|
||||
private MonitorMessager monitorMessager;
|
||||
|
||||
private final String port = "5556";
|
||||
private MonitorService monitorService;
|
||||
|
||||
public MonitorMessager getMonitorMessager() {
|
||||
return monitorMessager;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public void setMonitorMessager(MonitorMessager monitorMessager) {
|
||||
this.monitorMessager = monitorMessager;
|
||||
}
|
||||
|
||||
public MonitorService getMonitorService() {
|
||||
return monitorService;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public void setMonitorService(MonitorService monitorService) {
|
||||
this.monitorService = monitorService;
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/{ip}/cpu/{fieldName}/{startTime}")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getCpuResult(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable("testPlanId") String testplanId,
|
||||
@PathVariable String ip, @PathVariable String fieldName,
|
||||
@PathVariable String startTime) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
MonitorProcessorResponseModel monitorProcessorResponseModel = this
|
||||
.getMonitorMessager().porcessor(accessToken, testplanId, ip,
|
||||
port, startTime);
|
||||
if (monitorProcessorResponseModel == null) {
|
||||
return fail(map, SERVER_ERROR);
|
||||
}
|
||||
|
||||
List<ResultModel> resultModels = this.getMonitorService()
|
||||
.extractMonitorResult(
|
||||
monitorProcessorResponseModel.getProcessorModels(),
|
||||
fieldName);
|
||||
|
||||
if (resultModels == null) {
|
||||
return fail(map, SERVER_ERROR);
|
||||
} else {
|
||||
success(map);
|
||||
map.put("result", resultModels);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
// @RequestMapping("/{testPlanId}/SUT/{ip}/cpu/{cpuInstance}/{fieldName}/{startTime}")
|
||||
// @ResponseBody
|
||||
// public Map<String, Object> getCpuResult(
|
||||
// @ModelAttribute("accessToken") String accessToken,
|
||||
// @PathVariable("testPlanId") String testplanId,
|
||||
// @PathVariable String ip, @PathVariable String port,
|
||||
// @PathVariable String cpuInstance, @PathVariable String fieldName,
|
||||
// @PathVariable String startTime) {
|
||||
// Map<String, Object> map = new HashMap<String, Object>();
|
||||
// MonitorProcessorResponseModel monitorProcessorResponseModel = this
|
||||
// .getMonitorMessager().porcessor(accessToken, testplanId, ip,
|
||||
// port, startTime);
|
||||
// if (monitorProcessorResponseModel == null) {
|
||||
// return fail(map, SERVER_ERROR);
|
||||
// }
|
||||
//
|
||||
// List<ResultModel> resultModels = this.getMonitorService()
|
||||
// .extractCpuResultModelList(
|
||||
// monitorProcessorResponseModel.getProcessorModels(),
|
||||
// cpuInstance, fieldName);
|
||||
// if (resultModels == null) {
|
||||
// return fail(map, SERVER_ERROR);
|
||||
// } else {
|
||||
// success(map);
|
||||
// map.put("result", resultModels);
|
||||
// return map;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
@RequestMapping("/{testPlanId}/{ip}/memory/{fieldName}/{startTime}")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getMemoryStatus(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable("testPlanId") String testPlanId,
|
||||
@PathVariable String ip, @PathVariable String fieldName,
|
||||
@PathVariable String startTime) {
|
||||
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
MonitorMemoryResponseModel monitorMemoryResponseModel = this
|
||||
.getMonitorMessager().memory(accessToken, testPlanId, ip, port,
|
||||
startTime);
|
||||
if (monitorMemoryResponseModel == null) {
|
||||
return fail(map, SERVER_ERROR);
|
||||
}
|
||||
List<ResultModel> resultModels = this
|
||||
.getMonitorService()
|
||||
.extractMonitorResult(
|
||||
monitorMemoryResponseModel.getMemoryModels(), fieldName);
|
||||
if (resultModels == null) {
|
||||
return fail(map, SERVER_ERROR);
|
||||
} else {
|
||||
map = success(map);
|
||||
map.put("result", resultModels);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/{ip}/physicalDisk/{fieldName}/{startTime}")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getPhysicalDisk(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable("testPlanId") String testPlanId,
|
||||
@PathVariable String ip, @PathVariable String fieldName,
|
||||
@PathVariable String startTime) {
|
||||
Map<String, Object> map = new HashMap<String,Object>();
|
||||
MonitorPhysicalDiskResponseModel monitorPhysicalDiskResponseModel = this
|
||||
.getMonitorMessager().physicalDisk(accessToken, testPlanId, ip,
|
||||
port, startTime);
|
||||
if (monitorPhysicalDiskResponseModel == null) {
|
||||
return fail(map, SERVER_ERROR);
|
||||
}
|
||||
List<ResultModel> resultModels = this
|
||||
.getMonitorService()
|
||||
.extractMonitorResult(
|
||||
monitorPhysicalDiskResponseModel
|
||||
.getPhysicalDiskModels(),
|
||||
fieldName);
|
||||
if (resultModels == null) {
|
||||
return fail(map, "");
|
||||
} else {
|
||||
map = success(map);
|
||||
map.put("result", resultModels);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/{ip}/network/{fieldName}/{startTime}")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getNetworkStaus(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable("testPlanId") String testPlanId,
|
||||
@PathVariable String ip, @PathVariable String fieldName,
|
||||
@PathVariable String startTime) {
|
||||
Map<String, Object> map = new HashMap<String,Object>();
|
||||
MonitorNetworkReponseModel monitorNetworkReponseModel = this
|
||||
.getMonitorMessager().network(accessToken, testPlanId, ip,
|
||||
port, startTime);
|
||||
|
||||
if (monitorNetworkReponseModel == null) {
|
||||
return fail(map, SERVER_ERROR);
|
||||
}
|
||||
List<ResultModel> resultModels = this.getMonitorService()
|
||||
.extractMonitorResult(monitorNetworkReponseModel.getModels(),
|
||||
fieldName);
|
||||
if (resultModels == null) {
|
||||
return fail(map, SERVER_ERROR);
|
||||
} else {
|
||||
map = success(map);
|
||||
map.put("result", resultModels);
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,393 +1,393 @@
|
|||
package org.bench4q.web.api;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.bench4q.share.helper.ExceptionLog;
|
||||
import org.bench4q.share.helper.MarshalHelper;
|
||||
import org.bench4q.share.models.agent.BehaviorStatusCodeResultModel;
|
||||
import org.bench4q.share.models.master.MonitorModel;
|
||||
import org.bench4q.share.models.master.ScriptHandleModel;
|
||||
import org.bench4q.share.models.master.TestPlanDBModel;
|
||||
import org.bench4q.share.models.master.TestPlanModel;
|
||||
import org.bench4q.share.models.master.TestPlanResultModel;
|
||||
import org.bench4q.share.models.master.TestPlanScriptBriefResultModel;
|
||||
import org.bench4q.share.models.master.statistics.ScriptBehaviorsBriefModel;
|
||||
import org.bench4q.share.models.master.statistics.ScriptBriefResultModel;
|
||||
import org.bench4q.share.models.master.statistics.ScriptPagesBriefModel;
|
||||
import org.bench4q.web.init.TestResultHandle;
|
||||
import org.bench4q.web.masterMessager.TestPlanMessager;
|
||||
import org.bench4q.web.model.ResultInfoModel;
|
||||
import org.bench4q.web.model.TestBriefStatusModel;
|
||||
import org.bench4q.web.model.TestPlanRequestModel;
|
||||
import org.bench4q.web.model.UrlContentTypeDistributionModel;
|
||||
import org.bench4q.web.service.TestPlanService;
|
||||
import org.bench4q.web.validation.TestPlanValidate;
|
||||
import org.bench4q.web.validation.ValidateResponseModel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.SessionAttributes;
|
||||
@Controller
|
||||
@SessionAttributes({ "accessToken" })
|
||||
public class TestPlanController extends BaseController {
|
||||
private TestPlanMessager testPlanMessager;
|
||||
|
||||
private TestPlanValidate testPlanValidate;
|
||||
|
||||
private TestPlanService testPlanService;
|
||||
|
||||
private final int monitorPort = 5556;
|
||||
|
||||
private TestPlanMessager getTestPlanMessager() {
|
||||
return testPlanMessager;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private void setTestPlanMessager(TestPlanMessager testPlanMessager) {
|
||||
this.testPlanMessager = testPlanMessager;
|
||||
}
|
||||
|
||||
private TestPlanValidate getTestPlanValidate() {
|
||||
return testPlanValidate;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private void setTestPlanValidate(TestPlanValidate testPlanValidate) {
|
||||
this.testPlanValidate = testPlanValidate;
|
||||
}
|
||||
|
||||
private TestPlanService getTestPlanService() {
|
||||
return testPlanService;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private void setTestPlanService(TestPlanService testPlanService) {
|
||||
this.testPlanService = testPlanService;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "runTestPlan", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> runTestPlan(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@RequestBody TestPlanRequestModel testPlanRequestModel) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
ValidateResponseModel validateResponseModel = this
|
||||
.getTestPlanValidate().validateTestPlanSubmited(
|
||||
testPlanRequestModel);
|
||||
if (!validateResponseModel.isSuccess()) {
|
||||
return fail(map, validateResponseModel.getMessage());
|
||||
} else {
|
||||
TestPlanModel testPlanModel = this.getTestPlanService()
|
||||
.createTestPlan(testPlanRequestModel, monitorPort);
|
||||
String testPlanContent;
|
||||
try {
|
||||
testPlanContent = MarshalHelper.marshal(TestPlanModel.class,
|
||||
testPlanModel);
|
||||
|
||||
} catch (JAXBException e) {
|
||||
Logger.getLogger(TestPlanController.class).info(
|
||||
ExceptionLog.getStackTrace(e));
|
||||
return fail(map, "error testPlan");
|
||||
}
|
||||
TestPlanResultModel testPlanResultModel = this
|
||||
.getTestPlanMessager().runTestPlan(accessToken,
|
||||
testPlanContent);
|
||||
if (testPlanResultModel != null
|
||||
&& testPlanResultModel.getTestPlanId() != null) {
|
||||
map = success(map);
|
||||
map.put("testPlanResult", testPlanResultModel);
|
||||
return map;
|
||||
} else {
|
||||
return fail(map, "empty test plan id");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/runningInfo")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getRunningInfo(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
TestPlanResultModel testPlanResultModel = this.getTestPlanMessager()
|
||||
.getRunningTestInfo(accessToken, testPlanId);
|
||||
if (testPlanResultModel == null) {
|
||||
return fail(map, "");
|
||||
} else {
|
||||
success(map);
|
||||
map.put("testPlan", testPlanResultModel);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/{testPlanId}/queryTestPlan")
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryTestPlan(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
TestPlanDBModel testPlanResultModel = this.getTestPlanMessager()
|
||||
.queryTestPlanById(accessToken, testPlanId);
|
||||
if (testPlanResultModel != null) {
|
||||
success(map);
|
||||
map.put("testPlan", testPlanResultModel);
|
||||
return map;
|
||||
} else {
|
||||
return fail(map, "");
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/testResultHanadle")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getTestResultHandle(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
TestPlanResultModel testPlanResultModel = this.getTestPlanMessager()
|
||||
.getRunningTestInfo(accessToken, testPlanId);
|
||||
if (testPlanResultModel == null) {
|
||||
return fail(map, "");
|
||||
}
|
||||
try {
|
||||
List<ResultInfoModel> results = new LinkedList<ResultInfoModel>();
|
||||
List<ResultInfoModel> scriptResultInfoModels = TestResultHandle.scriptResultInfoModel;
|
||||
List<ResultInfoModel> sutResultInfoModels = TestResultHandle.sutInfoModel;
|
||||
|
||||
for (ScriptHandleModel scriptHandleModel : testPlanResultModel
|
||||
.getScripts()) {
|
||||
if (scriptHandleModel == null) {
|
||||
continue;
|
||||
}
|
||||
results.add(getScriptResultInfoModels(scriptHandleModel,
|
||||
scriptResultInfoModels));
|
||||
}
|
||||
if (testPlanResultModel.getMonitorModels() != null) {
|
||||
for (MonitorModel monitorModel : testPlanResultModel
|
||||
.getMonitorModels()) {
|
||||
results.add(getSUTResultInfoModel(monitorModel,
|
||||
sutResultInfoModels));
|
||||
}
|
||||
}
|
||||
|
||||
map.put("resultHandle", results);
|
||||
success(map);
|
||||
return map;
|
||||
} catch (Exception e) {
|
||||
Logger.getLogger(this.getClass()).info(
|
||||
ExceptionLog.getStackTrace(e));
|
||||
return fail(map, "");
|
||||
}
|
||||
}
|
||||
|
||||
private ResultInfoModel getScriptResultInfoModels(
|
||||
ScriptHandleModel scriptHandleModel,
|
||||
List<ResultInfoModel> scriptResultModels) {
|
||||
ResultInfoModel resultInfoModel = new ResultInfoModel();
|
||||
resultInfoModel.setName(scriptHandleModel.getScriptName());
|
||||
resultInfoModel.setValue(scriptHandleModel.getScriptId().toString());
|
||||
resultInfoModel.setChildren(scriptResultModels);
|
||||
return resultInfoModel;
|
||||
}
|
||||
|
||||
private ResultInfoModel getSUTResultInfoModel(MonitorModel monitorModel,
|
||||
List<ResultInfoModel> resultInfoModels) {
|
||||
ResultInfoModel resultInfoModel = new ResultInfoModel();
|
||||
resultInfoModel.setName(monitorModel.getHostName());
|
||||
resultInfoModel.setValue(monitorModel.getHostName());
|
||||
resultInfoModel.setChildren(resultInfoModels);
|
||||
return resultInfoModel;
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/{scriptId}/scriptBriefResult/{fieldName}/{startTime}")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getScriptBriefStatus(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId, @PathVariable String scriptId,
|
||||
@PathVariable String fieldName, @PathVariable String startTime) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
TestPlanScriptBriefResultModel testPlanScriptBriefResultModel = this
|
||||
.getTestPlanMessager().getScriptBriefResult(accessToken,
|
||||
testPlanId, scriptId, startTime);
|
||||
Logger.getLogger(this.getClass()).info(MarshalHelper.tryMarshal(testPlanScriptBriefResultModel));
|
||||
if (testPlanScriptBriefResultModel != null) {
|
||||
success(map);
|
||||
map.put("result",
|
||||
this.getTestPlanService().extractResultModelList(
|
||||
testPlanScriptBriefResultModel, fieldName));
|
||||
return map;
|
||||
|
||||
} else {
|
||||
return fail(map, "");
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/testBriefStatus")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getTestBriefStatus(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
TestBriefStatusModel testBriefStatusModel = new TestBriefStatusModel();
|
||||
long vus = 0;
|
||||
long requests = 0;
|
||||
TestPlanResultModel testPlanResultModel = this.getTestPlanMessager()
|
||||
.getRunningTestInfo(accessToken, testPlanId);
|
||||
|
||||
if (testPlanResultModel == null) {
|
||||
return fail(map, "");
|
||||
}
|
||||
for (ScriptHandleModel scriptHandleModel : testPlanResultModel
|
||||
.getScripts()) {
|
||||
ScriptBriefResultModel lastScriptBriefResultModel = this
|
||||
.getTestPlanMessager().getLatestScriptBriefResult(
|
||||
accessToken, testPlanId,
|
||||
scriptHandleModel.getScriptId().toString());
|
||||
if (lastScriptBriefResultModel == null) {
|
||||
continue;
|
||||
}
|
||||
requests += lastScriptBriefResultModel.getTotalFailCountFromBegin()
|
||||
+ lastScriptBriefResultModel
|
||||
.getTotalSuccessCountFromBegin();
|
||||
vus += lastScriptBriefResultModel.getvUserCount();
|
||||
}
|
||||
testBriefStatusModel.setRequests(requests);
|
||||
testBriefStatusModel.setVus(vus);
|
||||
map.put("briefInfo", testBriefStatusModel);
|
||||
return success(map);
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/{scriptId}/behaviors")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getScriptBehaviorBriefModel(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId, @PathVariable String scriptId) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
ScriptBehaviorsBriefModel scriptBehaviorsBriefModel = this
|
||||
.getTestPlanMessager().getScriptBehaviorsBriefResult(
|
||||
accessToken, testPlanId, scriptId);
|
||||
if (scriptBehaviorsBriefModel == null) {
|
||||
return fail(map, "");
|
||||
}
|
||||
map = success(map);
|
||||
map.put("behaviors", scriptBehaviorsBriefModel);
|
||||
return map;
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/{scriptId}/page")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getScriptPageBriefModel(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId, @PathVariable String scriptId) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
ScriptPagesBriefModel scriptPagesBriefModel = this
|
||||
.getTestPlanMessager().getScriptPageBriefModel(accessToken,
|
||||
testPlanId, scriptId);
|
||||
|
||||
if (scriptPagesBriefModel == null) {
|
||||
return fail(map, "");
|
||||
}
|
||||
map = success(map);
|
||||
map.put("pages", scriptPagesBriefModel);
|
||||
return map;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@RequestMapping("/{testPlanId}/urlContentTypeDistribution")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getUrlContentTypeDistribution(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId) {
|
||||
List<UrlContentTypeDistributionModel> urlContentTypeDistributionModels = new ArrayList<UrlContentTypeDistributionModel>();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Map<String, Long> urlContentTypeCountMap = (Map<String, Long>) getUrlContentTypeCount(
|
||||
accessToken, testPlanId).get("result");
|
||||
if (urlContentTypeCountMap == null) {
|
||||
return fail(map, "");
|
||||
}
|
||||
Map<String, Double> urlContentTypePercentMap = this
|
||||
.getTestPlanService().getUrlContentTypePercent(
|
||||
urlContentTypeCountMap);
|
||||
Set<String> keys = urlContentTypeCountMap.keySet();
|
||||
Iterator<String> iterator = keys.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
String key = iterator.next();
|
||||
urlContentTypeDistributionModels
|
||||
.add(new UrlContentTypeDistributionModel(key,
|
||||
urlContentTypeCountMap.get(key),
|
||||
urlContentTypePercentMap.get(key)));
|
||||
}
|
||||
map = success(map);
|
||||
map.put("result", urlContentTypePercentMap);
|
||||
return map;
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@RequestMapping("/{testPlanId}/urlContentTypePercent")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getUrlContentTypePercent(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Map<String, Long> urlContentTypeCountMap = (Map<String, Long>) getUrlContentTypeCount(
|
||||
accessToken, testPlanId).get("result");
|
||||
if (urlContentTypeCountMap == null) {
|
||||
return fail(map, "");
|
||||
}
|
||||
map = success(map);
|
||||
map.put("result",
|
||||
this.getTestPlanService().getUrlContentTypePercent(
|
||||
urlContentTypeCountMap));
|
||||
return map;
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/urlContentTypeCount")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getUrlContentTypeCount(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId) {
|
||||
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
List<BehaviorStatusCodeResultModel> behaviorStatusCodeResultModels = this
|
||||
.getTestPlanService().getAllBehaviorStatusCodeResultModels(
|
||||
accessToken, testPlanId);
|
||||
if (behaviorStatusCodeResultModels == null) {
|
||||
map.put("result", null);
|
||||
return fail(map, "");
|
||||
}
|
||||
Map<String, Long> urlContentCountMap = new HashMap<String, Long>();
|
||||
for (BehaviorStatusCodeResultModel behaviorStatusCodeResultModel : behaviorStatusCodeResultModels) {
|
||||
if (urlContentCountMap.get(behaviorStatusCodeResultModel
|
||||
.getContentType()) == null)
|
||||
urlContentCountMap.put(
|
||||
behaviorStatusCodeResultModel.getContentType(),
|
||||
behaviorStatusCodeResultModel.getCount());
|
||||
else {
|
||||
long originalValue = urlContentCountMap
|
||||
.get(behaviorStatusCodeResultModel.getContentType());
|
||||
urlContentCountMap.put(
|
||||
behaviorStatusCodeResultModel.getContentType(),
|
||||
originalValue
|
||||
+ behaviorStatusCodeResultModel.getCount());
|
||||
}
|
||||
|
||||
}
|
||||
map = success(map);
|
||||
map.put("result", urlContentCountMap);
|
||||
return map;
|
||||
|
||||
}
|
||||
}
|
||||
package org.bench4q.web.api;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.bench4q.share.helper.ExceptionLog;
|
||||
import org.bench4q.share.helper.MarshalHelper;
|
||||
import org.bench4q.share.models.agent.BehaviorStatusCodeResultModel;
|
||||
import org.bench4q.share.models.master.MonitorModel;
|
||||
import org.bench4q.share.models.master.ScriptHandleModel;
|
||||
import org.bench4q.share.models.master.TestPlanDBModel;
|
||||
import org.bench4q.share.models.master.TestPlanModel;
|
||||
import org.bench4q.share.models.master.TestPlanResultModel;
|
||||
import org.bench4q.share.models.master.TestPlanScriptBriefResultModel;
|
||||
import org.bench4q.share.models.master.statistics.ScriptBehaviorsBriefModel;
|
||||
import org.bench4q.share.models.master.statistics.ScriptBriefResultModel;
|
||||
import org.bench4q.share.models.master.statistics.ScriptPagesBriefModel;
|
||||
import org.bench4q.web.init.TestResultHandle;
|
||||
import org.bench4q.web.masterMessager.TestPlanMessager;
|
||||
import org.bench4q.web.model.ResultInfoModel;
|
||||
import org.bench4q.web.model.TestBriefStatusModel;
|
||||
import org.bench4q.web.model.TestPlanRequestModel;
|
||||
import org.bench4q.web.model.UrlContentTypeDistributionModel;
|
||||
import org.bench4q.web.service.TestPlanService;
|
||||
import org.bench4q.web.validation.TestPlanValidate;
|
||||
import org.bench4q.web.validation.ValidateResponseModel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.SessionAttributes;
|
||||
@Controller
|
||||
@SessionAttributes({ "accessToken" })
|
||||
public class TestPlanController extends BaseController {
|
||||
private TestPlanMessager testPlanMessager;
|
||||
|
||||
private TestPlanValidate testPlanValidate;
|
||||
|
||||
private TestPlanService testPlanService;
|
||||
|
||||
private final int monitorPort = 5556;
|
||||
|
||||
private TestPlanMessager getTestPlanMessager() {
|
||||
return testPlanMessager;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private void setTestPlanMessager(TestPlanMessager testPlanMessager) {
|
||||
this.testPlanMessager = testPlanMessager;
|
||||
}
|
||||
|
||||
private TestPlanValidate getTestPlanValidate() {
|
||||
return testPlanValidate;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private void setTestPlanValidate(TestPlanValidate testPlanValidate) {
|
||||
this.testPlanValidate = testPlanValidate;
|
||||
}
|
||||
|
||||
private TestPlanService getTestPlanService() {
|
||||
return testPlanService;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private void setTestPlanService(TestPlanService testPlanService) {
|
||||
this.testPlanService = testPlanService;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "runTestPlan", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<String, Object> runTestPlan(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@RequestBody TestPlanRequestModel testPlanRequestModel) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
ValidateResponseModel validateResponseModel = this
|
||||
.getTestPlanValidate().validateTestPlanSubmited(
|
||||
testPlanRequestModel);
|
||||
if (!validateResponseModel.isSuccess()) {
|
||||
return fail(map, validateResponseModel.getMessage());
|
||||
} else {
|
||||
TestPlanModel testPlanModel = this.getTestPlanService()
|
||||
.createTestPlan(testPlanRequestModel, monitorPort);
|
||||
String testPlanContent;
|
||||
try {
|
||||
testPlanContent = MarshalHelper.marshal(TestPlanModel.class,
|
||||
testPlanModel);
|
||||
|
||||
} catch (JAXBException e) {
|
||||
Logger.getLogger(TestPlanController.class).info(
|
||||
ExceptionLog.getStackTrace(e));
|
||||
return fail(map, "error testPlan");
|
||||
}
|
||||
TestPlanResultModel testPlanResultModel = this
|
||||
.getTestPlanMessager().runTestPlan(accessToken,
|
||||
testPlanContent);
|
||||
if (testPlanResultModel != null
|
||||
&& testPlanResultModel.getTestPlanId() != null) {
|
||||
map = success(map);
|
||||
map.put("testPlanResult", testPlanResultModel);
|
||||
return map;
|
||||
} else {
|
||||
return fail(map, "empty test plan id");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/runningInfo")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getRunningInfo(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
TestPlanResultModel testPlanResultModel = this.getTestPlanMessager()
|
||||
.getRunningTestInfo(accessToken, testPlanId);
|
||||
if (testPlanResultModel == null) {
|
||||
return fail(map, "");
|
||||
} else {
|
||||
success(map);
|
||||
map.put("testPlan", testPlanResultModel);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/{testPlanId}/queryTestPlan")
|
||||
@ResponseBody
|
||||
public Map<String, Object> queryTestPlan(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
TestPlanDBModel testPlanResultModel = this.getTestPlanMessager()
|
||||
.queryTestPlanById(accessToken, testPlanId);
|
||||
if (testPlanResultModel != null) {
|
||||
success(map);
|
||||
map.put("testPlan", testPlanResultModel);
|
||||
return map;
|
||||
} else {
|
||||
return fail(map, "");
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/testResultHanadle")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getTestResultHandle(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
TestPlanResultModel testPlanResultModel = this.getTestPlanMessager()
|
||||
.getRunningTestInfo(accessToken, testPlanId);
|
||||
if (testPlanResultModel == null) {
|
||||
return fail(map, "");
|
||||
}
|
||||
try {
|
||||
List<ResultInfoModel> results = new LinkedList<ResultInfoModel>();
|
||||
List<ResultInfoModel> scriptResultInfoModels = TestResultHandle.scriptResultInfoModel;
|
||||
List<ResultInfoModel> sutResultInfoModels = TestResultHandle.sutInfoModel;
|
||||
|
||||
for (ScriptHandleModel scriptHandleModel : testPlanResultModel
|
||||
.getScripts()) {
|
||||
if (scriptHandleModel == null) {
|
||||
continue;
|
||||
}
|
||||
results.add(getScriptResultInfoModels(scriptHandleModel,
|
||||
scriptResultInfoModels));
|
||||
}
|
||||
if (testPlanResultModel.getMonitorModels() != null) {
|
||||
for (MonitorModel monitorModel : testPlanResultModel
|
||||
.getMonitorModels()) {
|
||||
results.add(getSUTResultInfoModel(monitorModel,
|
||||
sutResultInfoModels));
|
||||
}
|
||||
}
|
||||
|
||||
map.put("resultHandle", results);
|
||||
success(map);
|
||||
return map;
|
||||
} catch (Exception e) {
|
||||
Logger.getLogger(this.getClass()).info(
|
||||
ExceptionLog.getStackTrace(e));
|
||||
return fail(map, "");
|
||||
}
|
||||
}
|
||||
|
||||
private ResultInfoModel getScriptResultInfoModels(
|
||||
ScriptHandleModel scriptHandleModel,
|
||||
List<ResultInfoModel> scriptResultModels) {
|
||||
ResultInfoModel resultInfoModel = new ResultInfoModel();
|
||||
resultInfoModel.setName(scriptHandleModel.getScriptName());
|
||||
resultInfoModel.setValue(scriptHandleModel.getScriptId().toString());
|
||||
resultInfoModel.setChildren(scriptResultModels);
|
||||
return resultInfoModel;
|
||||
}
|
||||
|
||||
private ResultInfoModel getSUTResultInfoModel(MonitorModel monitorModel,
|
||||
List<ResultInfoModel> resultInfoModels) {
|
||||
ResultInfoModel resultInfoModel = new ResultInfoModel();
|
||||
resultInfoModel.setName(monitorModel.getHostName());
|
||||
resultInfoModel.setValue(monitorModel.getHostName());
|
||||
resultInfoModel.setChildren(resultInfoModels);
|
||||
return resultInfoModel;
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/{scriptId}/scriptBriefResult/{fieldName}/{startTime}")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getScriptBriefStatus(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId, @PathVariable String scriptId,
|
||||
@PathVariable String fieldName, @PathVariable String startTime) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
TestPlanScriptBriefResultModel testPlanScriptBriefResultModel = this
|
||||
.getTestPlanMessager().getScriptBriefResult(accessToken,
|
||||
testPlanId, scriptId, startTime);
|
||||
Logger.getLogger(this.getClass()).info(MarshalHelper.tryMarshal(testPlanScriptBriefResultModel));
|
||||
if (testPlanScriptBriefResultModel != null) {
|
||||
success(map);
|
||||
map.put("result",
|
||||
this.getTestPlanService().extractResultModelList(
|
||||
testPlanScriptBriefResultModel, fieldName));
|
||||
return map;
|
||||
|
||||
} else {
|
||||
return fail(map, "");
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/testBriefStatus")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getTestBriefStatus(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
TestBriefStatusModel testBriefStatusModel = new TestBriefStatusModel();
|
||||
long vus = 0;
|
||||
long requests = 0;
|
||||
TestPlanResultModel testPlanResultModel = this.getTestPlanMessager()
|
||||
.getRunningTestInfo(accessToken, testPlanId);
|
||||
|
||||
if (testPlanResultModel == null) {
|
||||
return fail(map, "");
|
||||
}
|
||||
for (ScriptHandleModel scriptHandleModel : testPlanResultModel
|
||||
.getScripts()) {
|
||||
ScriptBriefResultModel lastScriptBriefResultModel = this
|
||||
.getTestPlanMessager().getLatestScriptBriefResult(
|
||||
accessToken, testPlanId,
|
||||
scriptHandleModel.getScriptId().toString());
|
||||
if (lastScriptBriefResultModel == null) {
|
||||
continue;
|
||||
}
|
||||
requests += lastScriptBriefResultModel.getTotalFailCountFromBegin()
|
||||
+ lastScriptBriefResultModel
|
||||
.getTotalSuccessCountFromBegin();
|
||||
vus += lastScriptBriefResultModel.getvUserCount();
|
||||
}
|
||||
testBriefStatusModel.setRequests(requests);
|
||||
testBriefStatusModel.setVus(vus);
|
||||
map.put("briefInfo", testBriefStatusModel);
|
||||
return success(map);
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/{scriptId}/behaviors")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getScriptBehaviorBriefModel(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId, @PathVariable String scriptId) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
ScriptBehaviorsBriefModel scriptBehaviorsBriefModel = this
|
||||
.getTestPlanMessager().getScriptBehaviorsBriefResult(
|
||||
accessToken, testPlanId, scriptId);
|
||||
if (scriptBehaviorsBriefModel == null) {
|
||||
return fail(map, "");
|
||||
}
|
||||
map = success(map);
|
||||
map.put("behaviors", scriptBehaviorsBriefModel);
|
||||
return map;
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/{scriptId}/page")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getScriptPageBriefModel(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId, @PathVariable String scriptId) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
ScriptPagesBriefModel scriptPagesBriefModel = this
|
||||
.getTestPlanMessager().getScriptPageBriefModel(accessToken,
|
||||
testPlanId, scriptId);
|
||||
|
||||
if (scriptPagesBriefModel == null) {
|
||||
return fail(map, "");
|
||||
}
|
||||
map = success(map);
|
||||
map.put("pages", scriptPagesBriefModel);
|
||||
return map;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@RequestMapping("/{testPlanId}/urlContentTypeDistribution")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getUrlContentTypeDistribution(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId) {
|
||||
List<UrlContentTypeDistributionModel> urlContentTypeDistributionModels = new ArrayList<UrlContentTypeDistributionModel>();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Map<String, Long> urlContentTypeCountMap = (Map<String, Long>) getUrlContentTypeCount(
|
||||
accessToken, testPlanId).get("result");
|
||||
if (urlContentTypeCountMap == null) {
|
||||
return fail(map, "");
|
||||
}
|
||||
Map<String, Double> urlContentTypePercentMap = this
|
||||
.getTestPlanService().getUrlContentTypePercent(
|
||||
urlContentTypeCountMap);
|
||||
Set<String> keys = urlContentTypeCountMap.keySet();
|
||||
Iterator<String> iterator = keys.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
String key = iterator.next();
|
||||
urlContentTypeDistributionModels
|
||||
.add(new UrlContentTypeDistributionModel(key,
|
||||
urlContentTypeCountMap.get(key),
|
||||
urlContentTypePercentMap.get(key)));
|
||||
}
|
||||
map = success(map);
|
||||
map.put("result", urlContentTypePercentMap);
|
||||
return map;
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@RequestMapping("/{testPlanId}/urlContentTypePercent")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getUrlContentTypePercent(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Map<String, Long> urlContentTypeCountMap = (Map<String, Long>) getUrlContentTypeCount(
|
||||
accessToken, testPlanId).get("result");
|
||||
if (urlContentTypeCountMap == null) {
|
||||
return fail(map, "");
|
||||
}
|
||||
map = success(map);
|
||||
map.put("result",
|
||||
this.getTestPlanService().getUrlContentTypePercent(
|
||||
urlContentTypeCountMap));
|
||||
return map;
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping("/{testPlanId}/urlContentTypeCount")
|
||||
@ResponseBody
|
||||
public Map<String, Object> getUrlContentTypeCount(
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@PathVariable String testPlanId) {
|
||||
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
List<BehaviorStatusCodeResultModel> behaviorStatusCodeResultModels = this
|
||||
.getTestPlanService().getAllBehaviorStatusCodeResultModels(
|
||||
accessToken, testPlanId);
|
||||
if (behaviorStatusCodeResultModels == null) {
|
||||
map.put("result", null);
|
||||
return fail(map, "");
|
||||
}
|
||||
Map<String, Long> urlContentCountMap = new HashMap<String, Long>();
|
||||
for (BehaviorStatusCodeResultModel behaviorStatusCodeResultModel : behaviorStatusCodeResultModels) {
|
||||
if (urlContentCountMap.get(behaviorStatusCodeResultModel
|
||||
.getContentType()) == null)
|
||||
urlContentCountMap.put(
|
||||
behaviorStatusCodeResultModel.getContentType(),
|
||||
behaviorStatusCodeResultModel.getCount());
|
||||
else {
|
||||
long originalValue = urlContentCountMap
|
||||
.get(behaviorStatusCodeResultModel.getContentType());
|
||||
urlContentCountMap.put(
|
||||
behaviorStatusCodeResultModel.getContentType(),
|
||||
originalValue
|
||||
+ behaviorStatusCodeResultModel.getCount());
|
||||
}
|
||||
|
||||
}
|
||||
map = success(map);
|
||||
map.put("result", urlContentCountMap);
|
||||
return map;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,102 +1,102 @@
|
|||
package org.bench4q.web.api;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.bench4q.share.communication.HttpRequester.HttpResponse;
|
||||
import org.bench4q.share.helper.ExceptionLog;
|
||||
import org.bench4q.share.models.master.TestPlanResponseModel;
|
||||
import org.bench4q.web.masterMessager.TestPlanMessager;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.SessionAttributes;
|
||||
|
||||
@Controller
|
||||
@SessionAttributes({ "accessToken" })
|
||||
public class TestPlanHistoryController extends BaseController {
|
||||
|
||||
private TestPlanMessager testPlanMessager;
|
||||
|
||||
public TestPlanMessager getTestPlanMessager() {
|
||||
return testPlanMessager;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public void setTestPlanMessager(TestPlanMessager testPlanMessager) {
|
||||
this.testPlanMessager = testPlanMessager;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "loadTestPlans", method = { RequestMethod.GET,
|
||||
RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public Map<String, Object> loadTestPlans(
|
||||
@ModelAttribute("accessToken") String accessToken) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
TestPlanResponseModel testPlanResponseModel = this
|
||||
.getTestPlanMessager().loadTestPlans(accessToken);
|
||||
|
||||
if (testPlanResponseModel == null || !testPlanResponseModel.isSuccess()) {
|
||||
return fail(map, "");
|
||||
|
||||
} else {
|
||||
success(map);
|
||||
map.put("testPlans", testPlanResponseModel.getTestPlanDBModels());
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "downloadReport", method = { RequestMethod.GET,
|
||||
RequestMethod.POST })
|
||||
public void downloadReport(HttpServletResponse response,
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@RequestParam String testPlanId) {
|
||||
HttpResponse httpResponse = this.getTestPlanMessager().loadReport(
|
||||
accessToken, testPlanId);
|
||||
if (httpResponse == null || httpResponse.getContent() == "") {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
byte[] pdfBuffer = httpResponse.getContent().getBytes();
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
response.reset();
|
||||
response.setHeader("Content-disposition", "attachment; filename=\""
|
||||
+ testPlanId.toString() + ".pdf\"");
|
||||
response.addHeader("Content-Length", "" + pdfBuffer.length);
|
||||
response.setContentType("application/pdf");
|
||||
outputStream.write(pdfBuffer);
|
||||
outputStream.flush();
|
||||
outputStream.close();
|
||||
} catch (Exception e) {
|
||||
Logger.getLogger(this.getClass()).info(
|
||||
ExceptionLog.getStackTrace(e));
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "deleteTest", method = { RequestMethod.GET,
|
||||
RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public Map<String, Object> deleteTest(HttpServletResponse response,
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@RequestParam String testPlanId) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
TestPlanResponseModel testPlanResponseModel = this
|
||||
.getTestPlanMessager().deleteTestPlan(accessToken, testPlanId);
|
||||
if (testPlanResponseModel == null || !testPlanResponseModel.isSuccess()) {
|
||||
return fail(map, "");
|
||||
} else {
|
||||
return success(map);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
package org.bench4q.web.api;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.bench4q.share.communication.HttpRequester.HttpResponse;
|
||||
import org.bench4q.share.helper.ExceptionLog;
|
||||
import org.bench4q.share.models.master.TestPlanResponseModel;
|
||||
import org.bench4q.web.masterMessager.TestPlanMessager;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.SessionAttributes;
|
||||
|
||||
@Controller
|
||||
@SessionAttributes({ "accessToken" })
|
||||
public class TestPlanHistoryController extends BaseController {
|
||||
|
||||
private TestPlanMessager testPlanMessager;
|
||||
|
||||
public TestPlanMessager getTestPlanMessager() {
|
||||
return testPlanMessager;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public void setTestPlanMessager(TestPlanMessager testPlanMessager) {
|
||||
this.testPlanMessager = testPlanMessager;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "loadTestPlans", method = { RequestMethod.GET,
|
||||
RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public Map<String, Object> loadTestPlans(
|
||||
@ModelAttribute("accessToken") String accessToken) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
TestPlanResponseModel testPlanResponseModel = this
|
||||
.getTestPlanMessager().loadTestPlans(accessToken);
|
||||
|
||||
if (testPlanResponseModel == null || !testPlanResponseModel.isSuccess()) {
|
||||
return fail(map, "");
|
||||
|
||||
} else {
|
||||
success(map);
|
||||
map.put("testPlans", testPlanResponseModel.getTestPlanDBModels());
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "downloadReport", method = { RequestMethod.GET,
|
||||
RequestMethod.POST })
|
||||
public void downloadReport(HttpServletResponse response,
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@RequestParam String testPlanId) {
|
||||
HttpResponse httpResponse = this.getTestPlanMessager().loadReport(
|
||||
accessToken, testPlanId);
|
||||
if (httpResponse == null || httpResponse.getContent() == "") {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
byte[] pdfBuffer = httpResponse.getContent().getBytes();
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
response.reset();
|
||||
response.setHeader("Content-disposition", "attachment; filename=\""
|
||||
+ testPlanId.toString() + ".pdf\"");
|
||||
response.addHeader("Content-Length", "" + pdfBuffer.length);
|
||||
response.setContentType("application/pdf");
|
||||
outputStream.write(pdfBuffer);
|
||||
outputStream.flush();
|
||||
outputStream.close();
|
||||
} catch (Exception e) {
|
||||
Logger.getLogger(this.getClass()).info(
|
||||
ExceptionLog.getStackTrace(e));
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "deleteTest", method = { RequestMethod.GET,
|
||||
RequestMethod.POST })
|
||||
@ResponseBody
|
||||
public Map<String, Object> deleteTest(HttpServletResponse response,
|
||||
@ModelAttribute("accessToken") String accessToken,
|
||||
@RequestParam String testPlanId) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
TestPlanResponseModel testPlanResponseModel = this
|
||||
.getTestPlanMessager().deleteTestPlan(accessToken, testPlanId);
|
||||
if (testPlanResponseModel == null || !testPlanResponseModel.isSuccess()) {
|
||||
return fail(map, "");
|
||||
} else {
|
||||
return success(map);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,90 +1,90 @@
|
|||
package org.bench4q.web.masterMessager;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
import org.bench4q.share.communication.HttpRequester.HttpResponse;
|
||||
import org.bench4q.share.helper.MarshalHelper;
|
||||
import org.bench4q.share.models.master.AgentModel;
|
||||
import org.bench4q.share.models.master.AgentResponseModel;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class AgentManagerMessager extends MasterMessager {
|
||||
|
||||
public AgentManagerMessager() {
|
||||
super(MasterAddressManamger.getMasterAddress() + "/agentManage");
|
||||
}
|
||||
|
||||
public AgentResponseModel addAgent(String accessToken,
|
||||
String agentModelContent) {
|
||||
System.out.println("enter and agent");
|
||||
String url = this.getBaseUrl() + "/addAgentToPool";
|
||||
HttpResponse httpResponse = null;
|
||||
try {
|
||||
httpResponse = this.getHttpRequester().sendPostXml(url,
|
||||
agentModelContent, makeAccessTockenMap(accessToken));
|
||||
System.out.println("agent:"+httpResponse.getContent());
|
||||
if (!validateHttpResponse(httpResponse)) {
|
||||
handleInvalidatedResponse(url);
|
||||
createFaliAgentResponseModel();
|
||||
}
|
||||
|
||||
return (AgentResponseModel) MarshalHelper.unmarshal(
|
||||
AgentResponseModel.class, httpResponse.getContent());
|
||||
} catch (Exception e) {
|
||||
this.handleException(httpResponse, e);
|
||||
return createFaliAgentResponseModel();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public AgentResponseModel deleteAgent(String accessToken, String agentId,
|
||||
String hostName) {
|
||||
String url = this.getBaseUrl() + "/removeAgentFromPool";
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("agentId", agentId);
|
||||
params.put("hostName", hostName);
|
||||
return this.getAgentResponseModel(url, params, accessToken);
|
||||
}
|
||||
|
||||
public AgentResponseModel loadAgents(String accessToken) {
|
||||
String url = this.getBaseUrl() + "/queryAgentList";
|
||||
AgentResponseModel agentResponseModel = this.getAgentResponseModel(url,
|
||||
null, accessToken);
|
||||
if (agentResponseModel.getAgents() == null) {
|
||||
agentResponseModel.setAgents(new LinkedList<AgentModel>());
|
||||
}
|
||||
return agentResponseModel;
|
||||
}
|
||||
|
||||
private AgentResponseModel getAgentResponseModel(String url,
|
||||
Map<String, String> params, String accessToken) {
|
||||
|
||||
HttpResponse httpResponse = null;
|
||||
try {
|
||||
httpResponse = this.getHttpRequester().sendGet(url, params,
|
||||
makeAccessTockenMap(accessToken));
|
||||
if (!validateHttpResponse(httpResponse)) {
|
||||
handleInvalidatedResponse(url);
|
||||
return createFaliAgentResponseModel();
|
||||
}
|
||||
|
||||
return (AgentResponseModel) MarshalHelper.unmarshal(
|
||||
AgentResponseModel.class, httpResponse.getContent());
|
||||
} catch (Exception e) {
|
||||
this.handleException(httpResponse, e);
|
||||
return createFaliAgentResponseModel();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private AgentResponseModel createFaliAgentResponseModel() {
|
||||
AgentResponseModel agentResponseModel = new AgentResponseModel();
|
||||
agentResponseModel.setSuccess(false);
|
||||
agentResponseModel.setFailCauseString(this.SERVER_ERROR);
|
||||
return agentResponseModel;
|
||||
}
|
||||
|
||||
}
|
||||
package org.bench4q.web.masterMessager;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
import org.bench4q.share.communication.HttpRequester.HttpResponse;
|
||||
import org.bench4q.share.helper.MarshalHelper;
|
||||
import org.bench4q.share.models.master.AgentModel;
|
||||
import org.bench4q.share.models.master.AgentResponseModel;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class AgentManagerMessager extends MasterMessager {
|
||||
|
||||
public AgentManagerMessager() {
|
||||
super(MasterAddressManamger.getMasterAddress() + "/agentManage");
|
||||
}
|
||||
|
||||
public AgentResponseModel addAgent(String accessToken,
|
||||
String agentModelContent) {
|
||||
System.out.println("enter and agent");
|
||||
String url = this.getBaseUrl() + "/addAgentToPool";
|
||||
HttpResponse httpResponse = null;
|
||||
try {
|
||||
httpResponse = this.getHttpRequester().sendPostXml(url,
|
||||
agentModelContent, makeAccessTockenMap(accessToken));
|
||||
System.out.println("agent:"+httpResponse.getContent());
|
||||
if (!validateHttpResponse(httpResponse)) {
|
||||
handleInvalidatedResponse(url);
|
||||
createFaliAgentResponseModel();
|
||||
}
|
||||
|
||||
return (AgentResponseModel) MarshalHelper.unmarshal(
|
||||
AgentResponseModel.class, httpResponse.getContent());
|
||||
} catch (Exception e) {
|
||||
this.handleException(httpResponse, e);
|
||||
return createFaliAgentResponseModel();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public AgentResponseModel deleteAgent(String accessToken, String agentId,
|
||||
String hostName) {
|
||||
String url = this.getBaseUrl() + "/removeAgentFromPool";
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("agentId", agentId);
|
||||
params.put("hostName", hostName);
|
||||
return this.getAgentResponseModel(url, params, accessToken);
|
||||
}
|
||||
|
||||
public AgentResponseModel loadAgents(String accessToken) {
|
||||
String url = this.getBaseUrl() + "/queryAgentList";
|
||||
AgentResponseModel agentResponseModel = this.getAgentResponseModel(url,
|
||||
null, accessToken);
|
||||
if (agentResponseModel.getAgents() == null) {
|
||||
agentResponseModel.setAgents(new LinkedList<AgentModel>());
|
||||
}
|
||||
return agentResponseModel;
|
||||
}
|
||||
|
||||
private AgentResponseModel getAgentResponseModel(String url,
|
||||
Map<String, String> params, String accessToken) {
|
||||
|
||||
HttpResponse httpResponse = null;
|
||||
try {
|
||||
httpResponse = this.getHttpRequester().sendGet(url, params,
|
||||
makeAccessTockenMap(accessToken));
|
||||
if (!validateHttpResponse(httpResponse)) {
|
||||
handleInvalidatedResponse(url);
|
||||
return createFaliAgentResponseModel();
|
||||
}
|
||||
|
||||
return (AgentResponseModel) MarshalHelper.unmarshal(
|
||||
AgentResponseModel.class, httpResponse.getContent());
|
||||
} catch (Exception e) {
|
||||
this.handleException(httpResponse, e);
|
||||
return createFaliAgentResponseModel();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private AgentResponseModel createFaliAgentResponseModel() {
|
||||
AgentResponseModel agentResponseModel = new AgentResponseModel();
|
||||
agentResponseModel.setSuccess(false);
|
||||
agentResponseModel.setFailCauseString(this.SERVER_ERROR);
|
||||
return agentResponseModel;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,72 +1,72 @@
|
|||
package org.bench4q.web.masterMessager;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.bench4q.share.communication.HttpRequester;
|
||||
import org.bench4q.share.communication.HttpRequester.HttpResponse;
|
||||
import org.bench4q.share.helper.ExceptionLog;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public abstract class MasterMessager {
|
||||
private final String AUTH_HEADER_PROPERTY = "Authorization";
|
||||
private final String ACCES_TOCKEN_STARTER = "Bearer ";
|
||||
protected final String SERVER_ERROR = "web server error";
|
||||
protected String baseUrl;
|
||||
protected HttpRequester httpRequester;
|
||||
protected Logger logger = Logger.getLogger(MasterMessager.class);
|
||||
|
||||
public String getBaseUrl() {
|
||||
return baseUrl;
|
||||
}
|
||||
|
||||
protected void setBaseUrl(String baseUrl) {
|
||||
this.baseUrl = baseUrl;
|
||||
}
|
||||
|
||||
protected HttpRequester getHttpRequester() {
|
||||
return httpRequester;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private void setHttpRequester(HttpRequester httpRequester) {
|
||||
this.httpRequester = httpRequester;
|
||||
}
|
||||
|
||||
public MasterMessager(String baseUrl) {
|
||||
this.setBaseUrl(baseUrl);
|
||||
}
|
||||
|
||||
protected Map<String, String> makeAccessTockenMap(String accessToken) {
|
||||
Map<String, String> properties = new HashMap<String, String>();
|
||||
properties
|
||||
.put(AUTH_HEADER_PROPERTY, ACCES_TOCKEN_STARTER + accessToken);
|
||||
return properties;
|
||||
}
|
||||
|
||||
protected void handleException(HttpResponse httpResponse, Exception e) {
|
||||
if (httpResponse != null)
|
||||
logger.error(httpResponse.getContent());
|
||||
logger.error(ExceptionLog.getStackTrace(e));
|
||||
|
||||
}
|
||||
|
||||
protected void handleInvalidatedResponse(String url) {
|
||||
logger.error(url+":invalidated http response");
|
||||
}
|
||||
|
||||
protected boolean validateHttpResponse(HttpResponse httpResponse) {
|
||||
if (httpResponse == null) {
|
||||
logger.info("http response is null");
|
||||
return false;
|
||||
}
|
||||
if (httpResponse.getCode() == 200) {
|
||||
return true;
|
||||
}
|
||||
logger.info(httpResponse.getContent());
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
package org.bench4q.web.masterMessager;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.bench4q.share.communication.HttpRequester;
|
||||
import org.bench4q.share.communication.HttpRequester.HttpResponse;
|
||||
import org.bench4q.share.helper.ExceptionLog;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public abstract class MasterMessager {
|
||||
private final String AUTH_HEADER_PROPERTY = "Authorization";
|
||||
private final String ACCES_TOCKEN_STARTER = "Bearer ";
|
||||
protected final String SERVER_ERROR = "web server error";
|
||||
protected String baseUrl;
|
||||
protected HttpRequester httpRequester;
|
||||
protected Logger logger = Logger.getLogger(MasterMessager.class);
|
||||
|
||||
public String getBaseUrl() {
|
||||
return baseUrl;
|
||||
}
|
||||
|
||||
protected void setBaseUrl(String baseUrl) {
|
||||
this.baseUrl = baseUrl;
|
||||
}
|
||||
|
||||
protected HttpRequester getHttpRequester() {
|
||||
return httpRequester;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private void setHttpRequester(HttpRequester httpRequester) {
|
||||
this.httpRequester = httpRequester;
|
||||
}
|
||||
|
||||
public MasterMessager(String baseUrl) {
|
||||
this.setBaseUrl(baseUrl);
|
||||
}
|
||||
|
||||
protected Map<String, String> makeAccessTockenMap(String accessToken) {
|
||||
Map<String, String> properties = new HashMap<String, String>();
|
||||
properties
|
||||
.put(AUTH_HEADER_PROPERTY, ACCES_TOCKEN_STARTER + accessToken);
|
||||
return properties;
|
||||
}
|
||||
|
||||
protected void handleException(HttpResponse httpResponse, Exception e) {
|
||||
if (httpResponse != null)
|
||||
logger.error(httpResponse.getContent());
|
||||
logger.error(ExceptionLog.getStackTrace(e));
|
||||
|
||||
}
|
||||
|
||||
protected void handleInvalidatedResponse(String url) {
|
||||
logger.error(url+":invalidated http response");
|
||||
}
|
||||
|
||||
protected boolean validateHttpResponse(HttpResponse httpResponse) {
|
||||
if (httpResponse == null) {
|
||||
logger.info("http response is null");
|
||||
return false;
|
||||
}
|
||||
if (httpResponse.getCode() == 200) {
|
||||
return true;
|
||||
}
|
||||
logger.info(httpResponse.getContent());
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,134 +1,134 @@
|
|||
package org.bench4q.web.masterMessager;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.bench4q.share.communication.HttpRequester.HttpResponse;
|
||||
import org.bench4q.share.helper.MarshalHelper;
|
||||
import org.bench4q.share.models.master.MonitorMemoryResponseModel;
|
||||
import org.bench4q.share.models.master.MonitorNetworkReponseModel;
|
||||
import org.bench4q.share.models.master.MonitorPhysicalDiskResponseModel;
|
||||
import org.bench4q.share.models.master.MonitorProcessorResponseModel;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
@Component
|
||||
public class MonitorMessager extends MasterMessager {
|
||||
public MonitorMessager() {
|
||||
super(MasterAddressManamger.getMasterAddress() + "/monitorController");
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/memorySUTInfo", method = { RequestMethod.GET,
|
||||
RequestMethod.POST })
|
||||
public MonitorMemoryResponseModel memory(String accessToken,
|
||||
String testPlanRunId, String hostName, String port,
|
||||
String duationBegin) {
|
||||
String url = this.getBaseUrl() + "/memorySUTInfo";
|
||||
Map<String, String> params = createParmsMap(testPlanRunId, hostName,
|
||||
port, duationBegin);
|
||||
HttpResponse httpResponse = null;
|
||||
try {
|
||||
httpResponse = this.getHttpRequester().sendPost(url, params,
|
||||
makeAccessTockenMap(accessToken));
|
||||
if (!validateHttpResponse(httpResponse)) {
|
||||
handleInvalidatedResponse(url);
|
||||
return null;
|
||||
}
|
||||
|
||||
MonitorMemoryResponseModel memoryResponseModel = (MonitorMemoryResponseModel) MarshalHelper
|
||||
.unmarshal(MonitorMemoryResponseModel.class,
|
||||
httpResponse.getContent());
|
||||
return memoryResponseModel;
|
||||
|
||||
} catch (Exception e) {
|
||||
this.handleException(httpResponse, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public MonitorProcessorResponseModel porcessor(String accessToken,
|
||||
String testPlanRunId, String hostName, String port,
|
||||
String duationBegin) {
|
||||
|
||||
String url = this.baseUrl + "/processorSUTInfo";
|
||||
Map<String, String> params = createParmsMap(testPlanRunId, hostName,
|
||||
port, duationBegin);
|
||||
HttpResponse httpResponse = null;
|
||||
try {
|
||||
httpResponse = this.getHttpRequester().sendGet(url, params,
|
||||
makeAccessTockenMap(accessToken));
|
||||
if (!validateHttpResponse(httpResponse)) {
|
||||
return null;
|
||||
|
||||
}
|
||||
MonitorProcessorResponseModel monitorProcessorResponseModel = (MonitorProcessorResponseModel) MarshalHelper
|
||||
.unmarshal(MonitorProcessorResponseModel.class,
|
||||
httpResponse.getContent());
|
||||
return monitorProcessorResponseModel;
|
||||
} catch (Exception e) {
|
||||
this.handleException(httpResponse, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public MonitorNetworkReponseModel network(String accessToken,
|
||||
String testPlanRunId, String hostName, String port,
|
||||
String duationBegin) {
|
||||
String url = this.baseUrl + "/networkInfo";
|
||||
Map<String, String> params = createParmsMap(testPlanRunId, hostName,
|
||||
port, duationBegin);
|
||||
HttpResponse httpResponse = null;
|
||||
try {
|
||||
httpResponse = this.getHttpRequester().sendGet(url, params,
|
||||
makeAccessTockenMap(accessToken));
|
||||
if (!validateHttpResponse(httpResponse)) {
|
||||
handleInvalidatedResponse(url);
|
||||
return null;
|
||||
}
|
||||
MonitorNetworkReponseModel networkInterfaceModel = (MonitorNetworkReponseModel) MarshalHelper
|
||||
.unmarshal(MonitorNetworkReponseModel.class,
|
||||
httpResponse.getContent());
|
||||
return networkInterfaceModel;
|
||||
|
||||
} catch (Exception e) {
|
||||
this.handleException(httpResponse, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public MonitorPhysicalDiskResponseModel physicalDisk(String accessToken,
|
||||
String testPlanRunId, String hostName, String port,
|
||||
String duationBegin) {
|
||||
String url = this.baseUrl + "/logicDiskMonitorSUTInfo" + "/"
|
||||
+ testPlanRunId + "/" + hostName + "/" + port + "/"
|
||||
+ duationBegin;
|
||||
HttpResponse httpResponse = null;
|
||||
try {
|
||||
httpResponse = this.getHttpRequester().sendGet(url, null,
|
||||
makeAccessTockenMap(accessToken));
|
||||
if (!validateHttpResponse(httpResponse)) {
|
||||
this.handleInvalidatedResponse(url);
|
||||
return null;
|
||||
}
|
||||
MonitorPhysicalDiskResponseModel monitorPhysicalDiskResponseModel = (MonitorPhysicalDiskResponseModel) MarshalHelper
|
||||
.unmarshal(MonitorPhysicalDiskResponseModel.class,
|
||||
httpResponse.getContent());
|
||||
return monitorPhysicalDiskResponseModel;
|
||||
} catch (Exception e) {
|
||||
this.handleException(httpResponse, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, String> createParmsMap(String testPlanRunId,
|
||||
String hostName, String port, String duationBegin) {
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("testPlanRunId", testPlanRunId);
|
||||
params.put("hostName", hostName);
|
||||
params.put("port", port);
|
||||
params.put("duationBegin", duationBegin);
|
||||
return params;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
package org.bench4q.web.masterMessager;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.bench4q.share.communication.HttpRequester.HttpResponse;
|
||||
import org.bench4q.share.helper.MarshalHelper;
|
||||
import org.bench4q.share.models.master.MonitorMemoryResponseModel;
|
||||
import org.bench4q.share.models.master.MonitorNetworkReponseModel;
|
||||
import org.bench4q.share.models.master.MonitorPhysicalDiskResponseModel;
|
||||
import org.bench4q.share.models.master.MonitorProcessorResponseModel;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
@Component
|
||||
public class MonitorMessager extends MasterMessager {
|
||||
public MonitorMessager() {
|
||||
super(MasterAddressManamger.getMasterAddress() + "/monitorController");
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/memorySUTInfo", method = { RequestMethod.GET,
|
||||
RequestMethod.POST })
|
||||
public MonitorMemoryResponseModel memory(String accessToken,
|
||||
String testPlanRunId, String hostName, String port,
|
||||
String duationBegin) {
|
||||
String url = this.getBaseUrl() + "/memorySUTInfo";
|
||||
Map<String, String> params = createParmsMap(testPlanRunId, hostName,
|
||||
port, duationBegin);
|
||||
HttpResponse httpResponse = null;
|
||||
try {
|
||||
httpResponse = this.getHttpRequester().sendPost(url, params,
|
||||
makeAccessTockenMap(accessToken));
|
||||
if (!validateHttpResponse(httpResponse)) {
|
||||
handleInvalidatedResponse(url);
|
||||
return null;
|
||||
}
|
||||
|
||||
MonitorMemoryResponseModel memoryResponseModel = (MonitorMemoryResponseModel) MarshalHelper
|
||||
.unmarshal(MonitorMemoryResponseModel.class,
|
||||
httpResponse.getContent());
|
||||
return memoryResponseModel;
|
||||
|
||||
} catch (Exception e) {
|
||||
this.handleException(httpResponse, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public MonitorProcessorResponseModel porcessor(String accessToken,
|
||||
String testPlanRunId, String hostName, String port,
|
||||
String duationBegin) {
|
||||
|
||||
String url = this.baseUrl + "/processorSUTInfo";
|
||||
Map<String, String> params = createParmsMap(testPlanRunId, hostName,
|
||||
port, duationBegin);
|
||||
HttpResponse httpResponse = null;
|
||||
try {
|
||||
httpResponse = this.getHttpRequester().sendGet(url, params,
|
||||
makeAccessTockenMap(accessToken));
|
||||
if (!validateHttpResponse(httpResponse)) {
|
||||
return null;
|
||||
|
||||
}
|
||||
MonitorProcessorResponseModel monitorProcessorResponseModel = (MonitorProcessorResponseModel) MarshalHelper
|
||||
.unmarshal(MonitorProcessorResponseModel.class,
|
||||
httpResponse.getContent());
|
||||
return monitorProcessorResponseModel;
|
||||
} catch (Exception e) {
|
||||
this.handleException(httpResponse, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public MonitorNetworkReponseModel network(String accessToken,
|
||||
String testPlanRunId, String hostName, String port,
|
||||
String duationBegin) {
|
||||
String url = this.baseUrl + "/networkInfo";
|
||||
Map<String, String> params = createParmsMap(testPlanRunId, hostName,
|
||||
port, duationBegin);
|
||||
HttpResponse httpResponse = null;
|
||||
try {
|
||||
httpResponse = this.getHttpRequester().sendGet(url, params,
|
||||
makeAccessTockenMap(accessToken));
|
||||
if (!validateHttpResponse(httpResponse)) {
|
||||
handleInvalidatedResponse(url);
|
||||
return null;
|
||||
}
|
||||
MonitorNetworkReponseModel networkInterfaceModel = (MonitorNetworkReponseModel) MarshalHelper
|
||||
.unmarshal(MonitorNetworkReponseModel.class,
|
||||
httpResponse.getContent());
|
||||
return networkInterfaceModel;
|
||||
|
||||
} catch (Exception e) {
|
||||
this.handleException(httpResponse, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public MonitorPhysicalDiskResponseModel physicalDisk(String accessToken,
|
||||
String testPlanRunId, String hostName, String port,
|
||||
String duationBegin) {
|
||||
String url = this.baseUrl + "/logicDiskMonitorSUTInfo" + "/"
|
||||
+ testPlanRunId + "/" + hostName + "/" + port + "/"
|
||||
+ duationBegin;
|
||||
HttpResponse httpResponse = null;
|
||||
try {
|
||||
httpResponse = this.getHttpRequester().sendGet(url, null,
|
||||
makeAccessTockenMap(accessToken));
|
||||
if (!validateHttpResponse(httpResponse)) {
|
||||
this.handleInvalidatedResponse(url);
|
||||
return null;
|
||||
}
|
||||
MonitorPhysicalDiskResponseModel monitorPhysicalDiskResponseModel = (MonitorPhysicalDiskResponseModel) MarshalHelper
|
||||
.unmarshal(MonitorPhysicalDiskResponseModel.class,
|
||||
httpResponse.getContent());
|
||||
return monitorPhysicalDiskResponseModel;
|
||||
} catch (Exception e) {
|
||||
this.handleException(httpResponse, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, String> createParmsMap(String testPlanRunId,
|
||||
String hostName, String port, String duationBegin) {
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("testPlanRunId", testPlanRunId);
|
||||
params.put("hostName", hostName);
|
||||
params.put("port", port);
|
||||
params.put("duationBegin", duationBegin);
|
||||
return params;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
package org.bench4q.web.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bench4q.share.models.master.AgentModel;
|
||||
|
||||
public class AgentListModel {
|
||||
private List<AgentModel> list;
|
||||
|
||||
public List<AgentModel> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<AgentModel> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
}
|
||||
package org.bench4q.web.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bench4q.share.models.master.AgentModel;
|
||||
|
||||
public class AgentListModel {
|
||||
private List<AgentModel> list;
|
||||
|
||||
public List<AgentModel> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<AgentModel> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,42 +1,42 @@
|
|||
package org.bench4q.web.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
@XmlRootElement
|
||||
public class ResultInfoModel {
|
||||
private String name;
|
||||
private String value;
|
||||
private List<ResultInfoModel> children;
|
||||
public ResultInfoModel(){
|
||||
|
||||
}
|
||||
public ResultInfoModel(String name,String value,List<ResultInfoModel> resultInfoModels){
|
||||
this.name=name;
|
||||
this.value=value;
|
||||
this.children=resultInfoModels;
|
||||
}
|
||||
public ResultInfoModel(String name,String value){
|
||||
this.name=name;
|
||||
this.value=value;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
public List<ResultInfoModel> getChildren() {
|
||||
return children;
|
||||
}
|
||||
public void setChildren(List<ResultInfoModel> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
}
|
||||
package org.bench4q.web.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
@XmlRootElement
|
||||
public class ResultInfoModel {
|
||||
private String name;
|
||||
private String value;
|
||||
private List<ResultInfoModel> children;
|
||||
public ResultInfoModel(){
|
||||
|
||||
}
|
||||
public ResultInfoModel(String name,String value,List<ResultInfoModel> resultInfoModels){
|
||||
this.name=name;
|
||||
this.value=value;
|
||||
this.children=resultInfoModels;
|
||||
}
|
||||
public ResultInfoModel(String name,String value){
|
||||
this.name=name;
|
||||
this.value=value;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
public List<ResultInfoModel> getChildren() {
|
||||
return children;
|
||||
}
|
||||
public void setChildren(List<ResultInfoModel> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
package org.bench4q.web.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class ResultModel {
|
||||
private boolean finished;
|
||||
private Object data;
|
||||
private Date time;
|
||||
public boolean isFinished() {
|
||||
return finished;
|
||||
}
|
||||
public void setFinished(boolean finished) {
|
||||
this.finished = finished;
|
||||
}
|
||||
public Date getTime() {
|
||||
return time;
|
||||
}
|
||||
public void setTime(Date time) {
|
||||
this.time = time;
|
||||
}
|
||||
public Object getData() {
|
||||
return data;
|
||||
}
|
||||
public void setData(Object data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
package org.bench4q.web.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class ResultModel {
|
||||
private boolean finished;
|
||||
private Object data;
|
||||
private Date time;
|
||||
public boolean isFinished() {
|
||||
return finished;
|
||||
}
|
||||
public void setFinished(boolean finished) {
|
||||
this.finished = finished;
|
||||
}
|
||||
public Date getTime() {
|
||||
return time;
|
||||
}
|
||||
public void setTime(Date time) {
|
||||
this.time = time;
|
||||
}
|
||||
public Object getData() {
|
||||
return data;
|
||||
}
|
||||
public void setData(Object data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
package org.bench4q.web.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
public class TestBriefStatusModel {
|
||||
private long vus;
|
||||
private long requests;
|
||||
private Date time;
|
||||
public long getVus() {
|
||||
return vus;
|
||||
}
|
||||
public void setVus(long vus) {
|
||||
this.vus = vus;
|
||||
}
|
||||
public long getRequests() {
|
||||
return requests;
|
||||
}
|
||||
public void setRequests(long requests) {
|
||||
this.requests = requests;
|
||||
}
|
||||
public Date getTime() {
|
||||
return time;
|
||||
}
|
||||
public void setTime(Date time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
}
|
||||
package org.bench4q.web.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
public class TestBriefStatusModel {
|
||||
private long vus;
|
||||
private long requests;
|
||||
private Date time;
|
||||
public long getVus() {
|
||||
return vus;
|
||||
}
|
||||
public void setVus(long vus) {
|
||||
this.vus = vus;
|
||||
}
|
||||
public long getRequests() {
|
||||
return requests;
|
||||
}
|
||||
public void setRequests(long requests) {
|
||||
this.requests = requests;
|
||||
}
|
||||
public Date getTime() {
|
||||
return time;
|
||||
}
|
||||
public void setTime(Date time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,54 +1,54 @@
|
|||
package org.bench4q.web.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TestPlanRequestModel {
|
||||
|
||||
private List<String> ipList;
|
||||
private List<WebScriptModel> scriptList;
|
||||
private String testPlanName;
|
||||
|
||||
|
||||
public TestPlanRequestModel() {
|
||||
|
||||
}
|
||||
|
||||
public TestPlanRequestModel(String testPlanName,
|
||||
List<WebScriptModel> scriptList) {
|
||||
this.testPlanName = testPlanName;
|
||||
this.scriptList = scriptList;
|
||||
}
|
||||
|
||||
public TestPlanRequestModel(String testPlanName,
|
||||
List<WebScriptModel> scriptList, List<String> ipList) {
|
||||
this.ipList = ipList;
|
||||
}
|
||||
|
||||
public String getTestPlanName() {
|
||||
return testPlanName;
|
||||
}
|
||||
|
||||
public void setTestPlanName(String testPlanName) {
|
||||
this.testPlanName = testPlanName;
|
||||
}
|
||||
|
||||
public List<String> getIpList() {
|
||||
return ipList;
|
||||
}
|
||||
|
||||
public void setIpList(List<String> ipList) {
|
||||
this.ipList = ipList;
|
||||
}
|
||||
|
||||
public List<WebScriptModel> getScriptList() {
|
||||
return scriptList;
|
||||
}
|
||||
|
||||
public void setScriptList(List<WebScriptModel> scriptList) {
|
||||
this.scriptList = scriptList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
package org.bench4q.web.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TestPlanRequestModel {
|
||||
|
||||
private List<String> ipList;
|
||||
private List<WebScriptModel> scriptList;
|
||||
private String testPlanName;
|
||||
|
||||
|
||||
public TestPlanRequestModel() {
|
||||
|
||||
}
|
||||
|
||||
public TestPlanRequestModel(String testPlanName,
|
||||
List<WebScriptModel> scriptList) {
|
||||
this.testPlanName = testPlanName;
|
||||
this.scriptList = scriptList;
|
||||
}
|
||||
|
||||
public TestPlanRequestModel(String testPlanName,
|
||||
List<WebScriptModel> scriptList, List<String> ipList) {
|
||||
this.ipList = ipList;
|
||||
}
|
||||
|
||||
public String getTestPlanName() {
|
||||
return testPlanName;
|
||||
}
|
||||
|
||||
public void setTestPlanName(String testPlanName) {
|
||||
this.testPlanName = testPlanName;
|
||||
}
|
||||
|
||||
public List<String> getIpList() {
|
||||
return ipList;
|
||||
}
|
||||
|
||||
public void setIpList(List<String> ipList) {
|
||||
this.ipList = ipList;
|
||||
}
|
||||
|
||||
public List<WebScriptModel> getScriptList() {
|
||||
return scriptList;
|
||||
}
|
||||
|
||||
public void setScriptList(List<WebScriptModel> scriptList) {
|
||||
this.scriptList = scriptList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,36 +1,36 @@
|
|||
package org.bench4q.web.model;
|
||||
|
||||
public class UrlContentTypeDistributionModel {
|
||||
|
||||
private String contentType;
|
||||
private long count;
|
||||
private double percentage;
|
||||
public UrlContentTypeDistributionModel(){
|
||||
|
||||
}
|
||||
public UrlContentTypeDistributionModel(String contentType,long count,double percentage){
|
||||
this.contentType=contentType;
|
||||
this.count=count;
|
||||
this.percentage=percentage;
|
||||
}
|
||||
|
||||
public String getContentType() {
|
||||
return contentType;
|
||||
}
|
||||
public void setContentType(String contentType) {
|
||||
this.contentType = contentType;
|
||||
}
|
||||
public long getCount() {
|
||||
return count;
|
||||
}
|
||||
public void setCount(long count) {
|
||||
this.count = count;
|
||||
}
|
||||
public double getPercentage() {
|
||||
return percentage;
|
||||
}
|
||||
public void setPercentage(double percentage) {
|
||||
this.percentage = percentage;
|
||||
}
|
||||
|
||||
}
|
||||
package org.bench4q.web.model;
|
||||
|
||||
public class UrlContentTypeDistributionModel {
|
||||
|
||||
private String contentType;
|
||||
private long count;
|
||||
private double percentage;
|
||||
public UrlContentTypeDistributionModel(){
|
||||
|
||||
}
|
||||
public UrlContentTypeDistributionModel(String contentType,long count,double percentage){
|
||||
this.contentType=contentType;
|
||||
this.count=count;
|
||||
this.percentage=percentage;
|
||||
}
|
||||
|
||||
public String getContentType() {
|
||||
return contentType;
|
||||
}
|
||||
public void setContentType(String contentType) {
|
||||
this.contentType = contentType;
|
||||
}
|
||||
public long getCount() {
|
||||
return count;
|
||||
}
|
||||
public void setCount(long count) {
|
||||
this.count = count;
|
||||
}
|
||||
public double getPercentage() {
|
||||
return percentage;
|
||||
}
|
||||
public void setPercentage(double percentage) {
|
||||
this.percentage = percentage;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,38 +1,38 @@
|
|||
package org.bench4q.web.model;
|
||||
|
||||
public class UserModel {
|
||||
private String username;
|
||||
private String password;
|
||||
private String retype_pwd;
|
||||
public UserModel(){
|
||||
|
||||
}
|
||||
public UserModel(String name,String password){
|
||||
this.username=name;
|
||||
this.password=password;
|
||||
}
|
||||
public UserModel(String name,String password,String retype_pwd){
|
||||
this.username=name;
|
||||
this.password=password;
|
||||
this.retype_pwd=retype_pwd;
|
||||
}
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
public String getRetype_pwd() {
|
||||
return retype_pwd;
|
||||
}
|
||||
public void setRetype_pwd(String retype_pwd) {
|
||||
this.retype_pwd = retype_pwd;
|
||||
}
|
||||
|
||||
}
|
||||
package org.bench4q.web.model;
|
||||
|
||||
public class UserModel {
|
||||
private String username;
|
||||
private String password;
|
||||
private String retype_pwd;
|
||||
public UserModel(){
|
||||
|
||||
}
|
||||
public UserModel(String name,String password){
|
||||
this.username=name;
|
||||
this.password=password;
|
||||
}
|
||||
public UserModel(String name,String password,String retype_pwd){
|
||||
this.username=name;
|
||||
this.password=password;
|
||||
this.retype_pwd=retype_pwd;
|
||||
}
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
public String getRetype_pwd() {
|
||||
return retype_pwd;
|
||||
}
|
||||
public void setRetype_pwd(String retype_pwd) {
|
||||
this.retype_pwd = retype_pwd;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,74 +1,74 @@
|
|||
package org.bench4q.web.model;
|
||||
|
||||
public class WebScriptModel {
|
||||
private int id;
|
||||
private int load;
|
||||
private long warmup;
|
||||
private long executeRange;
|
||||
private long cooldown;
|
||||
private boolean staticResources;
|
||||
private boolean timer;
|
||||
public WebScriptModel() {
|
||||
}
|
||||
public WebScriptModel(int id,int load,long warmup,long executeRange,long cooldown){
|
||||
this.id=id;
|
||||
this.load=load;
|
||||
this.warmup=warmup;
|
||||
this.executeRange=executeRange;
|
||||
this.cooldown=cooldown;
|
||||
|
||||
}
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getLoad() {
|
||||
return load;
|
||||
}
|
||||
|
||||
public void setLoad(int load) {
|
||||
this.load = load;
|
||||
}
|
||||
|
||||
public long getWarmup() {
|
||||
return warmup;
|
||||
}
|
||||
|
||||
public void setWarmup(long warmup) {
|
||||
this.warmup = warmup;
|
||||
}
|
||||
|
||||
public long getExecuteRange() {
|
||||
return executeRange;
|
||||
}
|
||||
|
||||
public void setExecuteRange(long executeRange) {
|
||||
this.executeRange = executeRange;
|
||||
}
|
||||
|
||||
public long getCooldown() {
|
||||
return cooldown;
|
||||
}
|
||||
|
||||
public void setCooldown(long cooldown) {
|
||||
this.cooldown = cooldown;
|
||||
}
|
||||
public boolean isStaticResources() {
|
||||
return staticResources;
|
||||
}
|
||||
public void setStaticResources(boolean staticResources) {
|
||||
this.staticResources = staticResources;
|
||||
}
|
||||
public boolean isTimer() {
|
||||
return timer;
|
||||
}
|
||||
public void setTimer(boolean timer) {
|
||||
this.timer = timer;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
package org.bench4q.web.model;
|
||||
|
||||
public class WebScriptModel {
|
||||
private int id;
|
||||
private int load;
|
||||
private long warmup;
|
||||
private long executeRange;
|
||||
private long cooldown;
|
||||
private boolean staticResources;
|
||||
private boolean timer;
|
||||
public WebScriptModel() {
|
||||
}
|
||||
public WebScriptModel(int id,int load,long warmup,long executeRange,long cooldown){
|
||||
this.id=id;
|
||||
this.load=load;
|
||||
this.warmup=warmup;
|
||||
this.executeRange=executeRange;
|
||||
this.cooldown=cooldown;
|
||||
|
||||
}
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getLoad() {
|
||||
return load;
|
||||
}
|
||||
|
||||
public void setLoad(int load) {
|
||||
this.load = load;
|
||||
}
|
||||
|
||||
public long getWarmup() {
|
||||
return warmup;
|
||||
}
|
||||
|
||||
public void setWarmup(long warmup) {
|
||||
this.warmup = warmup;
|
||||
}
|
||||
|
||||
public long getExecuteRange() {
|
||||
return executeRange;
|
||||
}
|
||||
|
||||
public void setExecuteRange(long executeRange) {
|
||||
this.executeRange = executeRange;
|
||||
}
|
||||
|
||||
public long getCooldown() {
|
||||
return cooldown;
|
||||
}
|
||||
|
||||
public void setCooldown(long cooldown) {
|
||||
this.cooldown = cooldown;
|
||||
}
|
||||
public boolean isStaticResources() {
|
||||
return staticResources;
|
||||
}
|
||||
public void setStaticResources(boolean staticResources) {
|
||||
this.staticResources = staticResources;
|
||||
}
|
||||
public boolean isTimer() {
|
||||
return timer;
|
||||
}
|
||||
public void setTimer(boolean timer) {
|
||||
this.timer = timer;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,41 +1,41 @@
|
|||
package org.bench4q.web.service;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.bench4q.share.helper.ExceptionLog;
|
||||
import org.bench4q.web.model.ResultModel;
|
||||
|
||||
public class ChangeToResultModel {
|
||||
public static ResultModel getResultModel(Object object,
|
||||
List<String> fieldNames) throws NoSuchFieldException {
|
||||
ResultModel resultModel = new ResultModel();
|
||||
|
||||
for (String fieldName : fieldNames) {
|
||||
resultModel.setData(getSpecificFieldValue(object, fieldName));
|
||||
}
|
||||
|
||||
return resultModel;
|
||||
}
|
||||
|
||||
private static Object getSpecificFieldValue(Object object, String fieldName)
|
||||
throws NoSuchFieldException {
|
||||
try {
|
||||
Field field = getFieldAndSetAccessible(object, fieldName);
|
||||
return field.get(object);
|
||||
} catch (Exception e) {
|
||||
Logger.getLogger(ChangeToResultModel.class).info(
|
||||
ExceptionLog.getStackTrace(e));
|
||||
throw new NoSuchFieldException();
|
||||
}
|
||||
}
|
||||
|
||||
private static Field getFieldAndSetAccessible(Object object,
|
||||
String fieldName) throws NoSuchFieldException, SecurityException {
|
||||
Field field = object.getClass().getDeclaredField(fieldName);
|
||||
field.setAccessible(true);
|
||||
return field;
|
||||
}
|
||||
|
||||
}
|
||||
package org.bench4q.web.service;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.bench4q.share.helper.ExceptionLog;
|
||||
import org.bench4q.web.model.ResultModel;
|
||||
|
||||
public class ChangeToResultModel {
|
||||
public static ResultModel getResultModel(Object object,
|
||||
List<String> fieldNames) throws NoSuchFieldException {
|
||||
ResultModel resultModel = new ResultModel();
|
||||
|
||||
for (String fieldName : fieldNames) {
|
||||
resultModel.setData(getSpecificFieldValue(object, fieldName));
|
||||
}
|
||||
|
||||
return resultModel;
|
||||
}
|
||||
|
||||
private static Object getSpecificFieldValue(Object object, String fieldName)
|
||||
throws NoSuchFieldException {
|
||||
try {
|
||||
Field field = getFieldAndSetAccessible(object, fieldName);
|
||||
return field.get(object);
|
||||
} catch (Exception e) {
|
||||
Logger.getLogger(ChangeToResultModel.class).info(
|
||||
ExceptionLog.getStackTrace(e));
|
||||
throw new NoSuchFieldException();
|
||||
}
|
||||
}
|
||||
|
||||
private static Field getFieldAndSetAccessible(Object object,
|
||||
String fieldName) throws NoSuchFieldException, SecurityException {
|
||||
Field field = object.getClass().getDeclaredField(fieldName);
|
||||
field.setAccessible(true);
|
||||
return field;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,42 +1,42 @@
|
|||
package org.bench4q.web.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.bench4q.share.helper.ExceptionLog;
|
||||
import org.bench4q.share.models.master.statistics.SampleModel;
|
||||
import org.bench4q.web.model.ResultModel;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class MonitorService {
|
||||
|
||||
private Logger logger = Logger.getLogger(MonitorService.class);
|
||||
|
||||
public List<ResultModel> extractMonitorResult(
|
||||
List<? extends SampleModel> list, String fieldName) {
|
||||
if (list == null)
|
||||
return null;
|
||||
List<ResultModel> resultModels = new ArrayList<ResultModel>();
|
||||
List<String> fieldNames = new ArrayList<String>();
|
||||
fieldNames.add(fieldName);
|
||||
for (SampleModel sampleModel : list) {
|
||||
if (sampleModel != null) {
|
||||
ResultModel resultModel;
|
||||
try {
|
||||
resultModel = ChangeToResultModel.getResultModel(
|
||||
sampleModel, fieldNames);
|
||||
resultModel.setTime(sampleModel.getSamplingTime());
|
||||
resultModel.setFinished(sampleModel.isFinished());
|
||||
resultModels.add(resultModel);
|
||||
} catch (NoSuchFieldException e) {
|
||||
// TODO Auto-generated catch block
|
||||
logger.info(ExceptionLog.getStackTrace(e));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return resultModels;
|
||||
}
|
||||
|
||||
}
|
||||
package org.bench4q.web.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.bench4q.share.helper.ExceptionLog;
|
||||
import org.bench4q.share.models.master.statistics.SampleModel;
|
||||
import org.bench4q.web.model.ResultModel;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class MonitorService {
|
||||
|
||||
private Logger logger = Logger.getLogger(MonitorService.class);
|
||||
|
||||
public List<ResultModel> extractMonitorResult(
|
||||
List<? extends SampleModel> list, String fieldName) {
|
||||
if (list == null)
|
||||
return null;
|
||||
List<ResultModel> resultModels = new ArrayList<ResultModel>();
|
||||
List<String> fieldNames = new ArrayList<String>();
|
||||
fieldNames.add(fieldName);
|
||||
for (SampleModel sampleModel : list) {
|
||||
if (sampleModel != null) {
|
||||
ResultModel resultModel;
|
||||
try {
|
||||
resultModel = ChangeToResultModel.getResultModel(
|
||||
sampleModel, fieldNames);
|
||||
resultModel.setTime(sampleModel.getSamplingTime());
|
||||
resultModel.setFinished(sampleModel.isFinished());
|
||||
resultModels.add(resultModel);
|
||||
} catch (NoSuchFieldException e) {
|
||||
// TODO Auto-generated catch block
|
||||
logger.info(ExceptionLog.getStackTrace(e));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return resultModels;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
package org.bench4q.web.service;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bench4q.share.models.master.plugin.PluginInfoModel;
|
||||
import org.bench4q.share.models.master.plugin.PluginResponseModel;
|
||||
import org.bench4q.share.models.master.plugin.PluginUIModel;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class PluginService {
|
||||
|
||||
public List<PluginInfoModel> extractPluginInfoModels(
|
||||
PluginResponseModel pluginResponseModel) {
|
||||
|
||||
List<PluginInfoModel> pluginInfoModels = new LinkedList<PluginInfoModel>();
|
||||
if (pluginResponseModel == null
|
||||
|| pluginResponseModel.getPluginUIModels() == null) {
|
||||
return pluginInfoModels;
|
||||
} else {
|
||||
for (PluginUIModel pluginUIModel : pluginResponseModel
|
||||
.getPluginUIModels()) {
|
||||
pluginInfoModels.add(pluginUIModel.getPluginInfoModel());
|
||||
}
|
||||
return pluginInfoModels;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
package org.bench4q.web.service;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bench4q.share.models.master.plugin.PluginInfoModel;
|
||||
import org.bench4q.share.models.master.plugin.PluginResponseModel;
|
||||
import org.bench4q.share.models.master.plugin.PluginUIModel;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class PluginService {
|
||||
|
||||
public List<PluginInfoModel> extractPluginInfoModels(
|
||||
PluginResponseModel pluginResponseModel) {
|
||||
|
||||
List<PluginInfoModel> pluginInfoModels = new LinkedList<PluginInfoModel>();
|
||||
if (pluginResponseModel == null
|
||||
|| pluginResponseModel.getPluginUIModels() == null) {
|
||||
return pluginInfoModels;
|
||||
} else {
|
||||
for (PluginUIModel pluginUIModel : pluginResponseModel
|
||||
.getPluginUIModels()) {
|
||||
pluginInfoModels.add(pluginUIModel.getPluginInfoModel());
|
||||
}
|
||||
return pluginInfoModels;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,143 +1,143 @@
|
|||
package org.bench4q.web.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.bench4q.share.models.agent.ParameterModel;
|
||||
import org.bench4q.share.models.agent.RunScenarioModel;
|
||||
import org.bench4q.share.models.agent.scriptrecord.BatchModel;
|
||||
import org.bench4q.share.models.agent.scriptrecord.BehaviorModel;
|
||||
import org.bench4q.share.models.agent.scriptrecord.PageModel;
|
||||
import org.bench4q.share.models.agent.scriptrecord.UsePluginModel;
|
||||
import org.bench4q.share.models.master.plugin.BehaviorInfoModel;
|
||||
import org.bench4q.share.models.master.plugin.ParamInfoModel;
|
||||
import org.bench4q.share.models.master.plugin.PluginInfoModel;
|
||||
import org.bench4q.web.masterMessager.PluginMessager;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ScriptService {
|
||||
|
||||
private PluginMessager pluginMessager;
|
||||
|
||||
public PluginMessager getPluginMessager() {
|
||||
return pluginMessager;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public void setPluginMessager(PluginMessager pluginMessager) {
|
||||
this.pluginMessager = pluginMessager;
|
||||
}
|
||||
|
||||
public RunScenarioModel createRunScenarioModel(
|
||||
List<UsePluginModel> usePlugins, List<BehaviorModel> behaviorModels) {
|
||||
RunScenarioModel runScenarioModel = new RunScenarioModel();
|
||||
runScenarioModel.setUsePlugins(usePlugins);
|
||||
List<PageModel> pageModels = new LinkedList<PageModel>();
|
||||
int count = 0;
|
||||
for (BehaviorModel behaviorModel : behaviorModels) {
|
||||
List<BehaviorModel> behaviorList = new LinkedList<BehaviorModel>();
|
||||
behaviorModel.setId(count);
|
||||
behaviorList.add(behaviorModel);
|
||||
BatchModel batchModel = new BatchModel();
|
||||
batchModel.setBehaviors(behaviorList);
|
||||
batchModel.setChildId(-1);
|
||||
batchModel.setId(count);
|
||||
batchModel.setParentId(-1);
|
||||
List<BatchModel> batchModels = new LinkedList<BatchModel>();
|
||||
batchModels.add(batchModel);
|
||||
PageModel pageModel = new PageModel();
|
||||
pageModel.setBatches(batchModels);
|
||||
pageModels.add(pageModel);
|
||||
count++;
|
||||
}
|
||||
runScenarioModel.setPages(pageModels);
|
||||
return runScenarioModel;
|
||||
}
|
||||
|
||||
public Map<UsePluginModel, PluginInfoModel> createUsePluginInfoModelsWithValue(
|
||||
List<UsePluginModel> usePluginModels, String accessToken) {
|
||||
Map<UsePluginModel, PluginInfoModel> map = new HashMap<UsePluginModel, PluginInfoModel>();
|
||||
for (UsePluginModel usePluginModel : usePluginModels) {
|
||||
map.put(usePluginModel,
|
||||
createPluginInfoModelWithValue(usePluginModel, accessToken));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public Map<BehaviorModel, BehaviorInfoModel> createBehaviorInfoModelsWithValue(
|
||||
RunScenarioModel runScenarioModel, String accessToken) {
|
||||
Map<String, String> behaviorPluginMap = getBehaviorUsePluginName(runScenarioModel);
|
||||
Map<BehaviorModel, BehaviorInfoModel> map = new HashMap<BehaviorModel, BehaviorInfoModel>();
|
||||
for (PageModel pageModel : runScenarioModel.getPages()) {
|
||||
BehaviorModel behaviorModel = pageModel.getBatches().get(0)
|
||||
.getBehaviors().get(0);
|
||||
System.out.println(behaviorPluginMap.get(behaviorModel.getUse()));
|
||||
map.put(behaviorModel,
|
||||
createBehaviorModelWithValue(accessToken, behaviorModel,
|
||||
behaviorPluginMap.get(behaviorModel.getUse())));
|
||||
}
|
||||
return map;
|
||||
|
||||
}
|
||||
|
||||
private PluginInfoModel createPluginInfoModelWithValue(
|
||||
UsePluginModel usePluginModel, String accessToken) {
|
||||
PluginInfoModel pluginInfoModel = this.getPluginMessager()
|
||||
.getPluginInfoModel(accessToken, usePluginModel.getName())
|
||||
.getPluginInfoModel();
|
||||
|
||||
pluginInfoModel.setParamInfoModels(createParameterModelsWithValue(
|
||||
usePluginModel.getParameters(),
|
||||
pluginInfoModel.getParamInfoModels()));
|
||||
return pluginInfoModel;
|
||||
|
||||
}
|
||||
|
||||
private BehaviorInfoModel createBehaviorModelWithValue(String accessToken,
|
||||
BehaviorModel behaviorModel, String pluginName) {
|
||||
|
||||
List<BehaviorInfoModel> behaviorInfoModels = this.getPluginMessager()
|
||||
.loadBehaviors(accessToken, pluginName)
|
||||
.getBehaviorInfoModels();
|
||||
BehaviorInfoModel behaviorInfoModel = null;
|
||||
for (BehaviorInfoModel behaviorInfoModelTemp : behaviorInfoModels) {
|
||||
if (behaviorInfoModelTemp.getName().equals(behaviorModel.getName())) {
|
||||
behaviorInfoModel = behaviorInfoModelTemp;
|
||||
}
|
||||
}
|
||||
behaviorInfoModel.setParamInfoModels(createParameterModelsWithValue(
|
||||
behaviorModel.getParameters(),
|
||||
behaviorInfoModel.getParamInfoModels()));
|
||||
return behaviorInfoModel;
|
||||
}
|
||||
|
||||
private Map<String, String> getBehaviorUsePluginName(
|
||||
RunScenarioModel runScenarioModel) {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
List<UsePluginModel> usePluginModels = runScenarioModel.getUsePlugins();
|
||||
for (UsePluginModel usePluginModel : usePluginModels) {
|
||||
map.put(usePluginModel.getId(), usePluginModel.getName());
|
||||
}
|
||||
return map;
|
||||
|
||||
}
|
||||
|
||||
private List<ParamInfoModel> createParameterModelsWithValue(
|
||||
List<ParameterModel> parameters,
|
||||
List<ParamInfoModel> paramInfoModels) {
|
||||
if (parameters == null) {
|
||||
return paramInfoModels;
|
||||
}
|
||||
for (ParameterModel parameterModel : parameters) {
|
||||
for (ParamInfoModel paramInfoModel : paramInfoModels) {
|
||||
if (parameterModel.getKey() == paramInfoModel.getName()) {
|
||||
paramInfoModel.setValue(parameterModel.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
return paramInfoModels;
|
||||
}
|
||||
}
|
||||
package org.bench4q.web.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.bench4q.share.models.agent.ParameterModel;
|
||||
import org.bench4q.share.models.agent.RunScenarioModel;
|
||||
import org.bench4q.share.models.agent.scriptrecord.BatchModel;
|
||||
import org.bench4q.share.models.agent.scriptrecord.BehaviorModel;
|
||||
import org.bench4q.share.models.agent.scriptrecord.PageModel;
|
||||
import org.bench4q.share.models.agent.scriptrecord.UsePluginModel;
|
||||
import org.bench4q.share.models.master.plugin.BehaviorInfoModel;
|
||||
import org.bench4q.share.models.master.plugin.ParamInfoModel;
|
||||
import org.bench4q.share.models.master.plugin.PluginInfoModel;
|
||||
import org.bench4q.web.masterMessager.PluginMessager;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ScriptService {
|
||||
|
||||
private PluginMessager pluginMessager;
|
||||
|
||||
public PluginMessager getPluginMessager() {
|
||||
return pluginMessager;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public void setPluginMessager(PluginMessager pluginMessager) {
|
||||
this.pluginMessager = pluginMessager;
|
||||
}
|
||||
|
||||
public RunScenarioModel createRunScenarioModel(
|
||||
List<UsePluginModel> usePlugins, List<BehaviorModel> behaviorModels) {
|
||||
RunScenarioModel runScenarioModel = new RunScenarioModel();
|
||||
runScenarioModel.setUsePlugins(usePlugins);
|
||||
List<PageModel> pageModels = new LinkedList<PageModel>();
|
||||
int count = 0;
|
||||
for (BehaviorModel behaviorModel : behaviorModels) {
|
||||
List<BehaviorModel> behaviorList = new LinkedList<BehaviorModel>();
|
||||
behaviorModel.setId(count);
|
||||
behaviorList.add(behaviorModel);
|
||||
BatchModel batchModel = new BatchModel();
|
||||
batchModel.setBehaviors(behaviorList);
|
||||
batchModel.setChildId(-1);
|
||||
batchModel.setId(count);
|
||||
batchModel.setParentId(-1);
|
||||
List<BatchModel> batchModels = new LinkedList<BatchModel>();
|
||||
batchModels.add(batchModel);
|
||||
PageModel pageModel = new PageModel();
|
||||
pageModel.setBatches(batchModels);
|
||||
pageModels.add(pageModel);
|
||||
count++;
|
||||
}
|
||||
runScenarioModel.setPages(pageModels);
|
||||
return runScenarioModel;
|
||||
}
|
||||
|
||||
public Map<UsePluginModel, PluginInfoModel> createUsePluginInfoModelsWithValue(
|
||||
List<UsePluginModel> usePluginModels, String accessToken) {
|
||||
Map<UsePluginModel, PluginInfoModel> map = new HashMap<UsePluginModel, PluginInfoModel>();
|
||||
for (UsePluginModel usePluginModel : usePluginModels) {
|
||||
map.put(usePluginModel,
|
||||
createPluginInfoModelWithValue(usePluginModel, accessToken));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public Map<BehaviorModel, BehaviorInfoModel> createBehaviorInfoModelsWithValue(
|
||||
RunScenarioModel runScenarioModel, String accessToken) {
|
||||
Map<String, String> behaviorPluginMap = getBehaviorUsePluginName(runScenarioModel);
|
||||
Map<BehaviorModel, BehaviorInfoModel> map = new HashMap<BehaviorModel, BehaviorInfoModel>();
|
||||
for (PageModel pageModel : runScenarioModel.getPages()) {
|
||||
BehaviorModel behaviorModel = pageModel.getBatches().get(0)
|
||||
.getBehaviors().get(0);
|
||||
System.out.println(behaviorPluginMap.get(behaviorModel.getUse()));
|
||||
map.put(behaviorModel,
|
||||
createBehaviorModelWithValue(accessToken, behaviorModel,
|
||||
behaviorPluginMap.get(behaviorModel.getUse())));
|
||||
}
|
||||
return map;
|
||||
|
||||
}
|
||||
|
||||
private PluginInfoModel createPluginInfoModelWithValue(
|
||||
UsePluginModel usePluginModel, String accessToken) {
|
||||
PluginInfoModel pluginInfoModel = this.getPluginMessager()
|
||||
.getPluginInfoModel(accessToken, usePluginModel.getName())
|
||||
.getPluginInfoModel();
|
||||
|
||||
pluginInfoModel.setParamInfoModels(createParameterModelsWithValue(
|
||||
usePluginModel.getParameters(),
|
||||
pluginInfoModel.getParamInfoModels()));
|
||||
return pluginInfoModel;
|
||||
|
||||
}
|
||||
|
||||
private BehaviorInfoModel createBehaviorModelWithValue(String accessToken,
|
||||
BehaviorModel behaviorModel, String pluginName) {
|
||||
|
||||
List<BehaviorInfoModel> behaviorInfoModels = this.getPluginMessager()
|
||||
.loadBehaviors(accessToken, pluginName)
|
||||
.getBehaviorInfoModels();
|
||||
BehaviorInfoModel behaviorInfoModel = null;
|
||||
for (BehaviorInfoModel behaviorInfoModelTemp : behaviorInfoModels) {
|
||||
if (behaviorInfoModelTemp.getName().equals(behaviorModel.getName())) {
|
||||
behaviorInfoModel = behaviorInfoModelTemp;
|
||||
}
|
||||
}
|
||||
behaviorInfoModel.setParamInfoModels(createParameterModelsWithValue(
|
||||
behaviorModel.getParameters(),
|
||||
behaviorInfoModel.getParamInfoModels()));
|
||||
return behaviorInfoModel;
|
||||
}
|
||||
|
||||
private Map<String, String> getBehaviorUsePluginName(
|
||||
RunScenarioModel runScenarioModel) {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
List<UsePluginModel> usePluginModels = runScenarioModel.getUsePlugins();
|
||||
for (UsePluginModel usePluginModel : usePluginModels) {
|
||||
map.put(usePluginModel.getId(), usePluginModel.getName());
|
||||
}
|
||||
return map;
|
||||
|
||||
}
|
||||
|
||||
private List<ParamInfoModel> createParameterModelsWithValue(
|
||||
List<ParameterModel> parameters,
|
||||
List<ParamInfoModel> paramInfoModels) {
|
||||
if (parameters == null) {
|
||||
return paramInfoModels;
|
||||
}
|
||||
for (ParameterModel parameterModel : parameters) {
|
||||
for (ParamInfoModel paramInfoModel : paramInfoModels) {
|
||||
if (parameterModel.getKey() == paramInfoModel.getName()) {
|
||||
paramInfoModel.setValue(parameterModel.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
return paramInfoModels;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,201 +1,201 @@
|
|||
package org.bench4q.web.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.bench4q.share.models.agent.BehaviorBriefModel;
|
||||
import org.bench4q.share.models.agent.BehaviorStatusCodeResultModel;
|
||||
import org.bench4q.share.models.master.MonitorModel;
|
||||
import org.bench4q.share.models.master.RunningScriptModel;
|
||||
import org.bench4q.share.models.master.ScriptHandleModel;
|
||||
import org.bench4q.share.models.master.TestPlanModel;
|
||||
import org.bench4q.share.models.master.TestPlanResultModel;
|
||||
import org.bench4q.share.models.master.TestPlanScriptBriefResultModel;
|
||||
import org.bench4q.share.models.master.TestScriptConfig;
|
||||
import org.bench4q.share.models.master.statistics.ScriptBehaviorsBriefModel;
|
||||
import org.bench4q.share.models.master.statistics.ScriptBriefResultModel;
|
||||
import org.bench4q.web.masterMessager.TestPlanMessager;
|
||||
import org.bench4q.web.model.ResultModel;
|
||||
import org.bench4q.web.model.TestPlanRequestModel;
|
||||
import org.bench4q.web.model.WebScriptModel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class TestPlanService {
|
||||
private TestPlanMessager testPlanMessager;
|
||||
|
||||
public TestPlanMessager getTestPlanMessager() {
|
||||
return testPlanMessager;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public void setTestPlanMessager(TestPlanMessager testPlanMessager) {
|
||||
this.testPlanMessager = testPlanMessager;
|
||||
}
|
||||
|
||||
public TestPlanModel createTestPlan(TestPlanRequestModel testPlan, int port) {
|
||||
TestPlanModel testPlanModel = new TestPlanModel();
|
||||
testPlanModel.setName(testPlan.getTestPlanName());
|
||||
if (testPlan.getScriptList() != null
|
||||
&& testPlan.getScriptList().size() > 0) {
|
||||
List<RunningScriptModel> scriptList = createRunningScriptModel(testPlan
|
||||
.getScriptList());
|
||||
testPlanModel.setRunningScriptModels(scriptList);
|
||||
}
|
||||
if (testPlan.getIpList() != null && testPlan.getIpList().size() > 0) {
|
||||
List<MonitorModel> ipList = createMonitorModel(
|
||||
testPlan.getIpList(), port);
|
||||
testPlanModel.setMonitorModels(ipList);
|
||||
} else
|
||||
testPlanModel.setMonitorModels(new ArrayList<MonitorModel>());
|
||||
|
||||
return testPlanModel;
|
||||
}
|
||||
|
||||
private List<RunningScriptModel> createRunningScriptModel(
|
||||
List<WebScriptModel> scriptParam) {
|
||||
|
||||
List<RunningScriptModel> scriptList = new ArrayList<RunningScriptModel>();
|
||||
|
||||
for (WebScriptModel scriptModel : scriptParam) {
|
||||
RunningScriptModel runnningScriptModel = new RunningScriptModel();
|
||||
runnningScriptModel.setScriptId(scriptModel.getId());
|
||||
runnningScriptModel.setRequireLoad(scriptModel.getLoad());
|
||||
// ScriptFilterOptionsModel scriptFilterOptionsModel = new ScriptFilterOptionsModel();
|
||||
// scriptFilterOptionsModel.setStaticResources(scriptModel
|
||||
// .isStaticResources());
|
||||
// scriptFilterOptionsModel.setTimer(scriptModel.isTimer());
|
||||
TestScriptConfig testScriptConfig = new TestScriptConfig();
|
||||
testScriptConfig.setCoolDown(scriptModel.getCooldown());
|
||||
testScriptConfig.setExecuteRange(scriptModel.getExecuteRange());
|
||||
testScriptConfig.setWarmUp(scriptModel.getWarmup());
|
||||
runnningScriptModel.setConfig(testScriptConfig);
|
||||
// runnningScriptModel
|
||||
// .setScriptFilterOptionsModel(scriptFilterOptionsModel);
|
||||
scriptList.add(runnningScriptModel);
|
||||
}
|
||||
return scriptList;
|
||||
}
|
||||
|
||||
private List<MonitorModel> createMonitorModel(List<String> ipParam, int port) {
|
||||
List<MonitorModel> ipList = new ArrayList<MonitorModel>();
|
||||
for (String ip : ipParam) {
|
||||
MonitorModel monitorModel = new MonitorModel();
|
||||
monitorModel.setHostName(ip);
|
||||
monitorModel.setPort(port);
|
||||
ipList.add(monitorModel);
|
||||
}
|
||||
return ipList;
|
||||
}
|
||||
|
||||
public List<ResultModel> extractResultModelList(
|
||||
TestPlanScriptBriefResultModel testPlanScriptBriefResultModel,
|
||||
String fieldName) {
|
||||
if (testPlanScriptBriefResultModel.getScriptBriefResultModels() == null) {
|
||||
return new LinkedList<ResultModel>();
|
||||
}
|
||||
List<ResultModel> resultModels = new ArrayList<ResultModel>();
|
||||
for (ScriptBriefResultModel scriptBriefResultModel : testPlanScriptBriefResultModel
|
||||
.getScriptBriefResultModels()) {
|
||||
|
||||
List<String> fieldNames = new ArrayList<String>();
|
||||
fieldNames.add(fieldName);
|
||||
ResultModel resultModel;
|
||||
try {
|
||||
resultModel = ChangeToResultModel.getResultModel(
|
||||
scriptBriefResultModel, fieldNames);
|
||||
|
||||
resultModel.setFinished(scriptBriefResultModel.isFinished());
|
||||
resultModel.setTime(scriptBriefResultModel.getSamplingTime());
|
||||
resultModels.add(resultModel);
|
||||
} catch (NoSuchFieldException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
System.out.println("resultLength:" + resultModels.size());
|
||||
return resultModels;
|
||||
|
||||
}
|
||||
|
||||
public List<BehaviorStatusCodeResultModel> getAllBehaviorStatusCodeResultModels(
|
||||
String accessToken, String testPlanId) {
|
||||
TestPlanResultModel testPlanResultModel = this.getTestPlanMessager()
|
||||
.getRunningTestInfo(accessToken, testPlanId);
|
||||
if (testPlanResultModel == null) {
|
||||
Logger.getLogger(this.getClass()).info(
|
||||
"testPlan is null:" + testPlanId);
|
||||
return null;
|
||||
}
|
||||
List<ScriptHandleModel> scriptList = testPlanResultModel.getScripts();
|
||||
if (scriptList == null) {
|
||||
return null;
|
||||
}
|
||||
List<BehaviorStatusCodeResultModel> behaviorStatusCodeResultModels = new LinkedList<BehaviorStatusCodeResultModel>();
|
||||
for (ScriptHandleModel scriptHandleModel : scriptList) {
|
||||
ScriptBehaviorsBriefModel scriptBehaviorBriefModel = this
|
||||
.getTestPlanMessager().getScriptBehaviorsBriefResult(
|
||||
accessToken, testPlanId,
|
||||
scriptHandleModel.getScriptId().toString());
|
||||
behaviorStatusCodeResultModels
|
||||
.addAll(extractBehaviorStatusCodeResultModels(scriptBehaviorBriefModel));
|
||||
}
|
||||
return behaviorStatusCodeResultModels;
|
||||
|
||||
}
|
||||
|
||||
private List<BehaviorStatusCodeResultModel> extractBehaviorStatusCodeResultModels(
|
||||
ScriptBehaviorsBriefModel scriptBehaviorsBriefModel) {
|
||||
List<BehaviorStatusCodeResultModel> behaviorStatusCodeResultModels = new ArrayList<BehaviorStatusCodeResultModel>();
|
||||
if (scriptBehaviorsBriefModel == null
|
||||
|| scriptBehaviorsBriefModel.getBehaviorBriefModels() == null) {
|
||||
return behaviorStatusCodeResultModels;
|
||||
}
|
||||
for (BehaviorBriefModel behaviorBriefModel : scriptBehaviorsBriefModel
|
||||
.getBehaviorBriefModels()) {
|
||||
|
||||
if (behaviorBriefModel.getDetailStatusCodeResultModels() != null)
|
||||
behaviorStatusCodeResultModels.addAll(behaviorBriefModel
|
||||
.getDetailStatusCodeResultModels());
|
||||
}
|
||||
return behaviorStatusCodeResultModels;
|
||||
}
|
||||
|
||||
public long getTotalCount(Map<String, Long> urlContentTypeCountMap) {
|
||||
|
||||
Set<String> keys = urlContentTypeCountMap.keySet();
|
||||
Iterator<String> iterator = keys.iterator();
|
||||
long totalCount = 0;
|
||||
while (iterator.hasNext()) {
|
||||
totalCount += urlContentTypeCountMap.get(iterator.next());
|
||||
}
|
||||
return totalCount;
|
||||
}
|
||||
|
||||
public Map<String, Double> getUrlContentTypePercent(
|
||||
Map<String, Long> urlContentTypeCountMap) {
|
||||
long totalCount = this.getTotalCount(urlContentTypeCountMap);
|
||||
if (urlContentTypeCountMap == null)
|
||||
return null;
|
||||
|
||||
if (totalCount == 0)
|
||||
return null;
|
||||
Map<String, Double> urlContentTypePercentMap = new HashMap<String, Double>();
|
||||
Set<String> keys = urlContentTypeCountMap.keySet();
|
||||
Iterator<String> iterator = keys.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
String key = iterator.next();
|
||||
double percent = (double) urlContentTypeCountMap.get(key)
|
||||
/ (double) totalCount * 100;
|
||||
urlContentTypePercentMap.put(key, new Double(percent));
|
||||
}
|
||||
return urlContentTypePercentMap;
|
||||
|
||||
}
|
||||
}
|
||||
package org.bench4q.web.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.bench4q.share.models.agent.BehaviorBriefModel;
|
||||
import org.bench4q.share.models.agent.BehaviorStatusCodeResultModel;
|
||||
import org.bench4q.share.models.master.MonitorModel;
|
||||
import org.bench4q.share.models.master.RunningScriptModel;
|
||||
import org.bench4q.share.models.master.ScriptHandleModel;
|
||||
import org.bench4q.share.models.master.TestPlanModel;
|
||||
import org.bench4q.share.models.master.TestPlanResultModel;
|
||||
import org.bench4q.share.models.master.TestPlanScriptBriefResultModel;
|
||||
import org.bench4q.share.models.master.TestScriptConfig;
|
||||
import org.bench4q.share.models.master.statistics.ScriptBehaviorsBriefModel;
|
||||
import org.bench4q.share.models.master.statistics.ScriptBriefResultModel;
|
||||
import org.bench4q.web.masterMessager.TestPlanMessager;
|
||||
import org.bench4q.web.model.ResultModel;
|
||||
import org.bench4q.web.model.TestPlanRequestModel;
|
||||
import org.bench4q.web.model.WebScriptModel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class TestPlanService {
|
||||
private TestPlanMessager testPlanMessager;
|
||||
|
||||
public TestPlanMessager getTestPlanMessager() {
|
||||
return testPlanMessager;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public void setTestPlanMessager(TestPlanMessager testPlanMessager) {
|
||||
this.testPlanMessager = testPlanMessager;
|
||||
}
|
||||
|
||||
public TestPlanModel createTestPlan(TestPlanRequestModel testPlan, int port) {
|
||||
TestPlanModel testPlanModel = new TestPlanModel();
|
||||
testPlanModel.setName(testPlan.getTestPlanName());
|
||||
if (testPlan.getScriptList() != null
|
||||
&& testPlan.getScriptList().size() > 0) {
|
||||
List<RunningScriptModel> scriptList = createRunningScriptModel(testPlan
|
||||
.getScriptList());
|
||||
testPlanModel.setRunningScriptModels(scriptList);
|
||||
}
|
||||
if (testPlan.getIpList() != null && testPlan.getIpList().size() > 0) {
|
||||
List<MonitorModel> ipList = createMonitorModel(
|
||||
testPlan.getIpList(), port);
|
||||
testPlanModel.setMonitorModels(ipList);
|
||||
} else
|
||||
testPlanModel.setMonitorModels(new ArrayList<MonitorModel>());
|
||||
|
||||
return testPlanModel;
|
||||
}
|
||||
|
||||
private List<RunningScriptModel> createRunningScriptModel(
|
||||
List<WebScriptModel> scriptParam) {
|
||||
|
||||
List<RunningScriptModel> scriptList = new ArrayList<RunningScriptModel>();
|
||||
|
||||
for (WebScriptModel scriptModel : scriptParam) {
|
||||
RunningScriptModel runnningScriptModel = new RunningScriptModel();
|
||||
runnningScriptModel.setScriptId(scriptModel.getId());
|
||||
runnningScriptModel.setRequireLoad(scriptModel.getLoad());
|
||||
// ScriptFilterOptionsModel scriptFilterOptionsModel = new ScriptFilterOptionsModel();
|
||||
// scriptFilterOptionsModel.setStaticResources(scriptModel
|
||||
// .isStaticResources());
|
||||
// scriptFilterOptionsModel.setTimer(scriptModel.isTimer());
|
||||
TestScriptConfig testScriptConfig = new TestScriptConfig();
|
||||
testScriptConfig.setCoolDown(scriptModel.getCooldown());
|
||||
testScriptConfig.setExecuteRange(scriptModel.getExecuteRange());
|
||||
testScriptConfig.setWarmUp(scriptModel.getWarmup());
|
||||
runnningScriptModel.setConfig(testScriptConfig);
|
||||
// runnningScriptModel
|
||||
// .setScriptFilterOptionsModel(scriptFilterOptionsModel);
|
||||
scriptList.add(runnningScriptModel);
|
||||
}
|
||||
return scriptList;
|
||||
}
|
||||
|
||||
private List<MonitorModel> createMonitorModel(List<String> ipParam, int port) {
|
||||
List<MonitorModel> ipList = new ArrayList<MonitorModel>();
|
||||
for (String ip : ipParam) {
|
||||
MonitorModel monitorModel = new MonitorModel();
|
||||
monitorModel.setHostName(ip);
|
||||
monitorModel.setPort(port);
|
||||
ipList.add(monitorModel);
|
||||
}
|
||||
return ipList;
|
||||
}
|
||||
|
||||
public List<ResultModel> extractResultModelList(
|
||||
TestPlanScriptBriefResultModel testPlanScriptBriefResultModel,
|
||||
String fieldName) {
|
||||
if (testPlanScriptBriefResultModel.getScriptBriefResultModels() == null) {
|
||||
return new LinkedList<ResultModel>();
|
||||
}
|
||||
List<ResultModel> resultModels = new ArrayList<ResultModel>();
|
||||
for (ScriptBriefResultModel scriptBriefResultModel : testPlanScriptBriefResultModel
|
||||
.getScriptBriefResultModels()) {
|
||||
|
||||
List<String> fieldNames = new ArrayList<String>();
|
||||
fieldNames.add(fieldName);
|
||||
ResultModel resultModel;
|
||||
try {
|
||||
resultModel = ChangeToResultModel.getResultModel(
|
||||
scriptBriefResultModel, fieldNames);
|
||||
|
||||
resultModel.setFinished(scriptBriefResultModel.isFinished());
|
||||
resultModel.setTime(scriptBriefResultModel.getSamplingTime());
|
||||
resultModels.add(resultModel);
|
||||
} catch (NoSuchFieldException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
System.out.println("resultLength:" + resultModels.size());
|
||||
return resultModels;
|
||||
|
||||
}
|
||||
|
||||
public List<BehaviorStatusCodeResultModel> getAllBehaviorStatusCodeResultModels(
|
||||
String accessToken, String testPlanId) {
|
||||
TestPlanResultModel testPlanResultModel = this.getTestPlanMessager()
|
||||
.getRunningTestInfo(accessToken, testPlanId);
|
||||
if (testPlanResultModel == null) {
|
||||
Logger.getLogger(this.getClass()).info(
|
||||
"testPlan is null:" + testPlanId);
|
||||
return null;
|
||||
}
|
||||
List<ScriptHandleModel> scriptList = testPlanResultModel.getScripts();
|
||||
if (scriptList == null) {
|
||||
return null;
|
||||
}
|
||||
List<BehaviorStatusCodeResultModel> behaviorStatusCodeResultModels = new LinkedList<BehaviorStatusCodeResultModel>();
|
||||
for (ScriptHandleModel scriptHandleModel : scriptList) {
|
||||
ScriptBehaviorsBriefModel scriptBehaviorBriefModel = this
|
||||
.getTestPlanMessager().getScriptBehaviorsBriefResult(
|
||||
accessToken, testPlanId,
|
||||
scriptHandleModel.getScriptId().toString());
|
||||
behaviorStatusCodeResultModels
|
||||
.addAll(extractBehaviorStatusCodeResultModels(scriptBehaviorBriefModel));
|
||||
}
|
||||
return behaviorStatusCodeResultModels;
|
||||
|
||||
}
|
||||
|
||||
private List<BehaviorStatusCodeResultModel> extractBehaviorStatusCodeResultModels(
|
||||
ScriptBehaviorsBriefModel scriptBehaviorsBriefModel) {
|
||||
List<BehaviorStatusCodeResultModel> behaviorStatusCodeResultModels = new ArrayList<BehaviorStatusCodeResultModel>();
|
||||
if (scriptBehaviorsBriefModel == null
|
||||
|| scriptBehaviorsBriefModel.getBehaviorBriefModels() == null) {
|
||||
return behaviorStatusCodeResultModels;
|
||||
}
|
||||
for (BehaviorBriefModel behaviorBriefModel : scriptBehaviorsBriefModel
|
||||
.getBehaviorBriefModels()) {
|
||||
|
||||
if (behaviorBriefModel.getDetailStatusCodeResultModels() != null)
|
||||
behaviorStatusCodeResultModels.addAll(behaviorBriefModel
|
||||
.getDetailStatusCodeResultModels());
|
||||
}
|
||||
return behaviorStatusCodeResultModels;
|
||||
}
|
||||
|
||||
public long getTotalCount(Map<String, Long> urlContentTypeCountMap) {
|
||||
|
||||
Set<String> keys = urlContentTypeCountMap.keySet();
|
||||
Iterator<String> iterator = keys.iterator();
|
||||
long totalCount = 0;
|
||||
while (iterator.hasNext()) {
|
||||
totalCount += urlContentTypeCountMap.get(iterator.next());
|
||||
}
|
||||
return totalCount;
|
||||
}
|
||||
|
||||
public Map<String, Double> getUrlContentTypePercent(
|
||||
Map<String, Long> urlContentTypeCountMap) {
|
||||
long totalCount = this.getTotalCount(urlContentTypeCountMap);
|
||||
if (urlContentTypeCountMap == null)
|
||||
return null;
|
||||
|
||||
if (totalCount == 0)
|
||||
return null;
|
||||
Map<String, Double> urlContentTypePercentMap = new HashMap<String, Double>();
|
||||
Set<String> keys = urlContentTypeCountMap.keySet();
|
||||
Iterator<String> iterator = keys.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
String key = iterator.next();
|
||||
double percent = (double) urlContentTypeCountMap.get(key)
|
||||
/ (double) totalCount * 100;
|
||||
urlContentTypePercentMap.put(key, new Double(percent));
|
||||
}
|
||||
return urlContentTypePercentMap;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
package org.bench4q.web.validation;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class AgentValidate {
|
||||
|
||||
public ValidateResponseModel validateAddedAgent(String hostName,
|
||||
String maxLoad, String port) {
|
||||
if (!ValidateHelper.validateIp(hostName)) {
|
||||
return new ValidateResponseModel(false, "error host name");
|
||||
}
|
||||
if (!ValidateHelper.validateInteger(maxLoad)) {
|
||||
return new ValidateResponseModel(false, "error maxLoad");
|
||||
}
|
||||
if (!ValidateHelper.validateInteger(port)) {
|
||||
return new ValidateResponseModel(false, "error port");
|
||||
|
||||
}
|
||||
return new ValidateResponseModel(true, "");
|
||||
}
|
||||
|
||||
public ValidateResponseModel validateDeleteAgent(String hostName,
|
||||
String agentId) {
|
||||
if (!ValidateHelper.validateIp(hostName)) {
|
||||
return new ValidateResponseModel(false, "error host name");
|
||||
}
|
||||
if (!ValidateHelper.validateInteger(agentId)) {
|
||||
return new ValidateResponseModel(false, "error agentId");
|
||||
}
|
||||
return new ValidateResponseModel(true, "");
|
||||
}
|
||||
|
||||
}
|
||||
package org.bench4q.web.validation;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class AgentValidate {
|
||||
|
||||
public ValidateResponseModel validateAddedAgent(String hostName,
|
||||
String maxLoad, String port) {
|
||||
if (!ValidateHelper.validateIp(hostName)) {
|
||||
return new ValidateResponseModel(false, "error host name");
|
||||
}
|
||||
if (!ValidateHelper.validateInteger(maxLoad)) {
|
||||
return new ValidateResponseModel(false, "error maxLoad");
|
||||
}
|
||||
if (!ValidateHelper.validateInteger(port)) {
|
||||
return new ValidateResponseModel(false, "error port");
|
||||
|
||||
}
|
||||
return new ValidateResponseModel(true, "");
|
||||
}
|
||||
|
||||
public ValidateResponseModel validateDeleteAgent(String hostName,
|
||||
String agentId) {
|
||||
if (!ValidateHelper.validateIp(hostName)) {
|
||||
return new ValidateResponseModel(false, "error host name");
|
||||
}
|
||||
if (!ValidateHelper.validateInteger(agentId)) {
|
||||
return new ValidateResponseModel(false, "error agentId");
|
||||
}
|
||||
return new ValidateResponseModel(true, "");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package org.bench4q.web.validation;
|
||||
|
||||
public class ScriptValidate {
|
||||
}
|
||||
package org.bench4q.web.validation;
|
||||
|
||||
public class ScriptValidate {
|
||||
}
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
package org.bench4q.web.validation;
|
||||
|
||||
import org.bench4q.web.model.TestPlanRequestModel;
|
||||
import org.bench4q.web.model.WebScriptModel;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class TestPlanValidate {
|
||||
|
||||
public ValidateResponseModel validateTestPlanSubmited(
|
||||
TestPlanRequestModel testPlanRequestModel) {
|
||||
if (testPlanRequestModel.getScriptList() == null
|
||||
|| testPlanRequestModel.getScriptList().size() == 0) {
|
||||
return new ValidateResponseModel(false, "empty script in test");
|
||||
}
|
||||
for (WebScriptModel scriptModel : testPlanRequestModel.getScriptList()) {
|
||||
if (!isValidateScriptModel(scriptModel)) {
|
||||
return new ValidateResponseModel(false, "error script config");
|
||||
}
|
||||
}
|
||||
return new ValidateResponseModel(true, "");
|
||||
|
||||
}
|
||||
|
||||
private boolean isValidateScriptModel(WebScriptModel scriptModel) {
|
||||
if (scriptModel.getId() == 0)
|
||||
return false;
|
||||
if (scriptModel.getLoad() == 0)
|
||||
return false;
|
||||
if (scriptModel.getExecuteRange() == 0)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
package org.bench4q.web.validation;
|
||||
|
||||
import org.bench4q.web.model.TestPlanRequestModel;
|
||||
import org.bench4q.web.model.WebScriptModel;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class TestPlanValidate {
|
||||
|
||||
public ValidateResponseModel validateTestPlanSubmited(
|
||||
TestPlanRequestModel testPlanRequestModel) {
|
||||
if (testPlanRequestModel.getScriptList() == null
|
||||
|| testPlanRequestModel.getScriptList().size() == 0) {
|
||||
return new ValidateResponseModel(false, "empty script in test");
|
||||
}
|
||||
for (WebScriptModel scriptModel : testPlanRequestModel.getScriptList()) {
|
||||
if (!isValidateScriptModel(scriptModel)) {
|
||||
return new ValidateResponseModel(false, "error script config");
|
||||
}
|
||||
}
|
||||
return new ValidateResponseModel(true, "");
|
||||
|
||||
}
|
||||
|
||||
private boolean isValidateScriptModel(WebScriptModel scriptModel) {
|
||||
if (scriptModel.getId() == 0)
|
||||
return false;
|
||||
if (scriptModel.getLoad() == 0)
|
||||
return false;
|
||||
if (scriptModel.getExecuteRange() == 0)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,50 +1,50 @@
|
|||
package org.bench4q.web.validation;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
||||
public class ValidateHelper {
|
||||
|
||||
public static boolean validateStringInput(String input) {
|
||||
if (input == null || input.length() == 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean validateInteger(String input) {
|
||||
Pattern pattern = Pattern.compile("[0-9]*");
|
||||
Matcher isNum = pattern.matcher(input);
|
||||
return isNum.matches();
|
||||
}
|
||||
|
||||
public static boolean validateIp(String input) {
|
||||
input.replaceAll(" ", "");
|
||||
String ip = "^(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\."
|
||||
|
||||
+ "(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\."
|
||||
|
||||
+ "(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\."
|
||||
|
||||
+ "(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$";
|
||||
|
||||
Pattern pattern = Pattern.compile(ip);
|
||||
|
||||
Matcher matcher = pattern.matcher(input);
|
||||
|
||||
return matcher.matches();
|
||||
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
String ip = " 133.133.12.1";
|
||||
System.out.println(validateIp(ip));
|
||||
String ipError = "122.122.1.r";
|
||||
System.err.println(validateInteger(ipError));
|
||||
String number = "123";
|
||||
System.out.println(validateInteger(number));
|
||||
System.err.println(validateInteger("u7"));
|
||||
}
|
||||
|
||||
}
|
||||
package org.bench4q.web.validation;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
||||
public class ValidateHelper {
|
||||
|
||||
public static boolean validateStringInput(String input) {
|
||||
if (input == null || input.length() == 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean validateInteger(String input) {
|
||||
Pattern pattern = Pattern.compile("[0-9]*");
|
||||
Matcher isNum = pattern.matcher(input);
|
||||
return isNum.matches();
|
||||
}
|
||||
|
||||
public static boolean validateIp(String input) {
|
||||
input.replaceAll(" ", "");
|
||||
String ip = "^(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\."
|
||||
|
||||
+ "(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\."
|
||||
|
||||
+ "(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\."
|
||||
|
||||
+ "(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$";
|
||||
|
||||
Pattern pattern = Pattern.compile(ip);
|
||||
|
||||
Matcher matcher = pattern.matcher(input);
|
||||
|
||||
return matcher.matches();
|
||||
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
String ip = " 133.133.12.1";
|
||||
System.out.println(validateIp(ip));
|
||||
String ipError = "122.122.1.r";
|
||||
System.err.println(validateInteger(ipError));
|
||||
String number = "123";
|
||||
System.out.println(validateInteger(number));
|
||||
System.err.println(validateInteger("u7"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
package org.bench4q.web.validation;
|
||||
|
||||
public class ValidateResponseModel {
|
||||
|
||||
private boolean success;
|
||||
private String message;
|
||||
|
||||
public ValidateResponseModel(boolean success, String message) {
|
||||
this.success = success;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
||||
package org.bench4q.web.validation;
|
||||
|
||||
public class ValidateResponseModel {
|
||||
|
||||
private boolean success;
|
||||
private String message;
|
||||
|
||||
public ValidateResponseModel(boolean success, String message) {
|
||||
this.success = success;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
|
||||
<context:component-scan base-package="org.bench4q" />
|
||||
<mvc:annotation-driven />
|
||||
<mvc:resources mapping="/images/**" location="/images/" />
|
||||
<mvc:resources mapping="/style/**" location="/style/" />
|
||||
<mvc:resources mapping="/script/**" location="/script/" />
|
||||
<mvc:resources mapping="/css/**" location="/css/" />
|
||||
<mvc:resources mapping="/static/**" location="/static/" />
|
||||
<mvc:resources mapping="/img/**" location="/img/" />
|
||||
<mvc:resources mapping="/i18n/**" location="/i18n/" />
|
||||
<mvc:default-servlet-handler />
|
||||
|
||||
<!-- ③:对模型视图名称的解析,即在模型视图名称添加前后缀 -->
|
||||
<bean
|
||||
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
||||
<property name="suffix" value=".jsp" />
|
||||
</bean>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
|
||||
<context:component-scan base-package="org.bench4q" />
|
||||
<mvc:annotation-driven />
|
||||
<mvc:resources mapping="/images/**" location="/images/" />
|
||||
<mvc:resources mapping="/style/**" location="/style/" />
|
||||
<mvc:resources mapping="/script/**" location="/script/" />
|
||||
<mvc:resources mapping="/css/**" location="/css/" />
|
||||
<mvc:resources mapping="/static/**" location="/static/" />
|
||||
<mvc:resources mapping="/img/**" location="/img/" />
|
||||
<mvc:resources mapping="/i18n/**" location="/i18n/" />
|
||||
<mvc:default-servlet-handler />
|
||||
|
||||
<!-- ③:对模型视图名称的解析,即在模型视图名称添加前后缀 -->
|
||||
<bean
|
||||
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
||||
<property name="suffix" value=".jsp" />
|
||||
</bean>
|
||||
</beans>
|
|
@ -1 +1 @@
|
|||
masterAddress=127.0.0.1:8901
|
||||
masterAddress=133.133.2.100:8901
|
|
@ -1,24 +1,24 @@
|
|||
log4j.rootLogger = INFO,WARN,ERROR,D
|
||||
|
||||
log4j.appender.WARN = org.apache.log4j.DailyRollingFileAppender
|
||||
log4j.appender.WARN.File = logs/warnlog.log
|
||||
log4j.appender.WARN.Append = true
|
||||
log4j.appender.WARN.Threshold = WARN
|
||||
log4j.appender.WARN.layout = org.apache.log4j.PatternLayout
|
||||
log4j.appender.WARN.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
|
||||
|
||||
log4j.appender.ERROR = org.apache.log4j.DailyRollingFileAppender
|
||||
log4j.appender.ERROR.File = logs/errorlog.log
|
||||
log4j.appender.ERROR.Append = true
|
||||
log4j.appender.ERROR.Threshold = ERROR
|
||||
log4j.appender.ERROR.layout = org.apache.log4j.PatternLayout
|
||||
log4j.appender.ERROR.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
|
||||
|
||||
|
||||
log4j.appender.D = org.apache.log4j.DailyRollingFileAppender
|
||||
log4j.appender.D.File = logs/info.log
|
||||
log4j.appender.D.Append = true
|
||||
log4j.appender.D.Threshold = TRACE
|
||||
log4j.appender.D.layout = org.apache.log4j.PatternLayout
|
||||
log4j.appender.D.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
|
||||
|
||||
log4j.rootLogger = INFO,WARN,ERROR,D
|
||||
|
||||
log4j.appender.WARN = org.apache.log4j.DailyRollingFileAppender
|
||||
log4j.appender.WARN.File = logs/warnlog.log
|
||||
log4j.appender.WARN.Append = true
|
||||
log4j.appender.WARN.Threshold = WARN
|
||||
log4j.appender.WARN.layout = org.apache.log4j.PatternLayout
|
||||
log4j.appender.WARN.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
|
||||
|
||||
log4j.appender.ERROR = org.apache.log4j.DailyRollingFileAppender
|
||||
log4j.appender.ERROR.File = logs/errorlog.log
|
||||
log4j.appender.ERROR.Append = true
|
||||
log4j.appender.ERROR.Threshold = ERROR
|
||||
log4j.appender.ERROR.layout = org.apache.log4j.PatternLayout
|
||||
log4j.appender.ERROR.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
|
||||
|
||||
|
||||
log4j.appender.D = org.apache.log4j.DailyRollingFileAppender
|
||||
log4j.appender.D.File = logs/info.log
|
||||
log4j.appender.D.Append = true
|
||||
log4j.appender.D.Threshold = TRACE
|
||||
log4j.appender.D.layout = org.apache.log4j.PatternLayout
|
||||
log4j.appender.D.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
|
||||
|
||||
|
|
|
@ -1,461 +1,461 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<!-- ===================================================================== -->
|
||||
<!-- This file contains the default descriptor for web applications. -->
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
- -->
|
||||
<!-- The intent of this descriptor is to include jetty specific or common -->
|
||||
<!-- configuration for all webapps. If a context has a webdefault.xml -->
|
||||
<!-- descriptor, it is applied before the contexts own web.xml file -->
|
||||
<!-- -->
|
||||
<!-- A context may be assigned a default descriptor by: -->
|
||||
<!-- + Calling WebApplicationContext.setDefaultsDescriptor -->
|
||||
<!-- + Passed an arg to addWebApplications -->
|
||||
<!-- -->
|
||||
<!-- This file is used both as the resource within the jetty.jar (which is -->
|
||||
<!-- used as the default if no explicit defaults descriptor is set) and it -->
|
||||
<!-- is copied to the etc directory of the Jetty distro and explicitly -->
|
||||
<!-- by the jetty.xml file. -->
|
||||
<!-- -->
|
||||
<!-- ===================================================================== -->
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||
metadata-complete="true" version="2.5">
|
||||
|
||||
<description>
|
||||
Default web.xml file.
|
||||
This file is applied to a Web application before it's own WEB_INF/web.xml file
|
||||
</description>
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<!-- Removes static references to beans from javax.el.BeanELResolver to -->
|
||||
<!-- ensure webapp classloader can be released on undeploy -->
|
||||
<!-- ==================================================================== -->
|
||||
<listener>
|
||||
<listener-class>org.eclipse.jetty.servlet.listener.ELContextCleaner</listener-class>
|
||||
</listener>
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<!-- Removes static cache of Methods from java.beans.Introspector to -->
|
||||
<!-- ensure webapp classloader can be released on undeploy -->
|
||||
<!-- ==================================================================== -->
|
||||
<listener>
|
||||
<listener-class>org.eclipse.jetty.servlet.listener.IntrospectorCleaner</listener-class>
|
||||
</listener>
|
||||
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<!-- Context params to control Session Cookies -->
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<!-- UNCOMMENT TO ACTIVATE <context-param> <param-name>org.eclipse.jetty.servlet.SessionDomain</param-name>
|
||||
<param-value>127.0.0.1</param-value> </context-param> <context-param> <param-name>org.eclipse.jetty.servlet.SessionPath</param-name>
|
||||
<param-value>/</param-value> </context-param> <context-param> <param-name>org.eclipse.jetty.servlet.MaxAge</param-name>
|
||||
<param-value>-1</param-value> </context-param> -->
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<!-- The default servlet. -->
|
||||
<!-- This servlet, normally mapped to /, provides the handling for static -->
|
||||
<!-- content, OPTIONS and TRACE methods for the context. -->
|
||||
<!-- The following initParameters are supported: -->
|
||||
<!-- * acceptRanges If true, range requests and responses are * supported
|
||||
* * dirAllowed If true, directory listings are returned if no * welcome file
|
||||
is found. Else 403 Forbidden. * * welcomeServlets If true, attempt to dispatch
|
||||
to welcome files * that are servlets, but only after no matching static *
|
||||
resources could be found. If false, then a welcome * file must exist on disk.
|
||||
If "exact", then exact * servlet matches are supported without an existing
|
||||
file. * Default is true. * * This must be false if you want directory listings,
|
||||
* but have index.jsp in your welcome file list. * * redirectWelcome If true,
|
||||
welcome files are redirected rather than * forwarded to. * * gzip If set
|
||||
to true, then static content will be served as * gzip content encoded if
|
||||
a matching resource is * found ending with ".gz" * * resourceBase Set to
|
||||
replace the context resource base * * resourceCache If set, this is a context
|
||||
attribute name, which the servlet * will use to look for a shared ResourceCache
|
||||
instance. * * relativeResourceBase * Set with a pathname relative to the
|
||||
base of the * servlet context root. Useful for only serving static content
|
||||
out * of only specific subdirectories. * * pathInfoOnly If true, only the
|
||||
path info will be applied to the resourceBase * * stylesheet Set with the
|
||||
location of an optional stylesheet that will be used * to decorate the directory
|
||||
listing html. * * aliases If True, aliases of resources are allowed (eg.
|
||||
symbolic * links and caps variations). May bypass security constraints. *
|
||||
* etags If True, weak etags will be generated and handled. * * maxCacheSize
|
||||
The maximum total size of the cache or 0 for no cache. * maxCachedFileSize
|
||||
The maximum size of a file to cache * maxCachedFiles The maximum number of
|
||||
files to cache * * useFileMappedBuffer * If set to true, it will use mapped
|
||||
file buffer to serve static content * when using NIO connector. Setting this
|
||||
value to false means that * a direct buffer will be used instead of a mapped
|
||||
file buffer. * By default, this is set to true. * * cacheControl If set,
|
||||
all static content will have this value set as the cache-control * header.
|
||||
* -->
|
||||
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<servlet>
|
||||
<servlet-name>default</servlet-name>
|
||||
<servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>aliases</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>acceptRanges</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>dirAllowed</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>welcomeServlets</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>redirectWelcome</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>maxCacheSize</param-name>
|
||||
<param-value>256000000</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>maxCachedFileSize</param-name>
|
||||
<param-value>200000000</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>maxCachedFiles</param-name>
|
||||
<param-value>2048</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>gzip</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>etags</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>useFileMappedBuffer</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<!-- <init-param> <param-name>resourceCache</param-name> <param-value>resourceCache</param-value>
|
||||
</init-param> -->
|
||||
<!-- <init-param> <param-name>cacheControl</param-name> <param-value>max-age=3600,public</param-value>
|
||||
</init-param> -->
|
||||
<load-on-startup>0</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>default</servlet-name>
|
||||
<url-pattern>/</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<!-- JSP Servlet -->
|
||||
<!-- This is the jasper JSP servlet from the jakarta project -->
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<!-- The JSP page compiler and execution servlet, which is the mechanism -->
|
||||
<!-- used by Glassfish to support JSP pages. Traditionally, this servlet -->
|
||||
<!-- is mapped to URL patterh "*.jsp". This servlet supports the -->
|
||||
<!-- following initialization parameters (default values are in square -->
|
||||
<!-- brackets): -->
|
||||
<!-- -->
|
||||
<!-- checkInterval If development is false and reloading is true, -->
|
||||
<!-- background compiles are enabled. checkInterval -->
|
||||
<!-- is the time in seconds between checks to see -->
|
||||
<!-- if a JSP page needs to be recompiled. [300] -->
|
||||
<!-- -->
|
||||
<!-- compiler Which compiler Ant should use to compile JSP -->
|
||||
<!-- pages. See the Ant documenation for more -->
|
||||
<!-- information. [javac] -->
|
||||
<!-- -->
|
||||
<!-- classdebuginfo Should the class file be compiled with -->
|
||||
<!-- debugging information? [true] -->
|
||||
<!-- -->
|
||||
<!-- classpath What class path should I use while compiling -->
|
||||
<!-- generated servlets? [Created dynamically -->
|
||||
<!-- based on the current web application] -->
|
||||
<!-- Set to ? to make the container explicitly set -->
|
||||
<!-- this parameter. -->
|
||||
<!-- -->
|
||||
<!-- development Is Jasper used in development mode (will check -->
|
||||
<!-- for JSP modification on every access)? [true] -->
|
||||
<!-- -->
|
||||
<!-- enablePooling Determines whether tag handler pooling is -->
|
||||
<!-- enabled [true] -->
|
||||
<!-- -->
|
||||
<!-- fork Tell Ant to fork compiles of JSP pages so that -->
|
||||
<!-- a separate JVM is used for JSP page compiles -->
|
||||
<!-- from the one Tomcat is running in. [true] -->
|
||||
<!-- -->
|
||||
<!-- ieClassId The class-id value to be sent to Internet -->
|
||||
<!-- Explorer when using <jsp:plugin> tags. -->
|
||||
<!-- [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93] -->
|
||||
<!-- -->
|
||||
<!-- javaEncoding Java file encoding to use for generating java -->
|
||||
<!-- source files. [UTF-8] -->
|
||||
<!-- -->
|
||||
<!-- keepgenerated Should we keep the generated Java source code -->
|
||||
<!-- for each page instead of deleting it? [true] -->
|
||||
<!-- -->
|
||||
<!-- logVerbosityLevel The level of detailed messages to be produced -->
|
||||
<!-- by this servlet. Increasing levels cause the -->
|
||||
<!-- generation of more messages. Valid values are -->
|
||||
<!-- FATAL, ERROR, WARNING, INFORMATION, and DEBUG. -->
|
||||
<!-- [WARNING] -->
|
||||
<!-- -->
|
||||
<!-- mappedfile Should we generate static content with one -->
|
||||
<!-- print statement per input line, to ease -->
|
||||
<!-- debugging? [false] -->
|
||||
<!-- -->
|
||||
<!-- -->
|
||||
<!-- reloading Should Jasper check for modified JSPs? [true] -->
|
||||
<!-- -->
|
||||
<!-- suppressSmap Should the generation of SMAP info for JSR45 -->
|
||||
<!-- debugging be suppressed? [false] -->
|
||||
<!-- -->
|
||||
<!-- dumpSmap Should the SMAP info for JSR45 debugging be -->
|
||||
<!-- dumped to a file? [false] -->
|
||||
<!-- False if suppressSmap is true -->
|
||||
<!-- -->
|
||||
<!-- scratchdir What scratch directory should we use when -->
|
||||
<!-- compiling JSP pages? [default work directory -->
|
||||
<!-- for the current web application] -->
|
||||
<!-- -->
|
||||
<!-- tagpoolMaxSize The maximum tag handler pool size [5] -->
|
||||
<!-- -->
|
||||
<!-- xpoweredBy Determines whether X-Powered-By response -->
|
||||
<!-- header is added by generated servlet [false] -->
|
||||
<!-- -->
|
||||
<!-- If you wish to use Jikes to compile JSP pages: -->
|
||||
<!-- Set the init parameter "compiler" to "jikes". Define -->
|
||||
<!-- the property "-Dbuild.compiler.emacs=true" when starting Jetty -->
|
||||
<!-- to cause Jikes to emit error messages in a format compatible with -->
|
||||
<!-- Jasper. -->
|
||||
<!-- If you get an error reporting that jikes can't use UTF-8 encoding, -->
|
||||
<!-- try setting the init parameter "javaEncoding" to "ISO-8859-1". -->
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<servlet id="jsp">
|
||||
<servlet-name>jsp</servlet-name>
|
||||
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>logVerbosityLevel</param-name>
|
||||
<param-value>DEBUG</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>fork</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>xpoweredBy</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<!-- <init-param> <param-name>classpath</param-name> <param-value>?</param-value>
|
||||
</init-param> -->
|
||||
<load-on-startup>0</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>jsp</servlet-name>
|
||||
<url-pattern>*.jsp</url-pattern>
|
||||
<url-pattern>*.jspf</url-pattern>
|
||||
<url-pattern>*.jspx</url-pattern>
|
||||
<url-pattern>*.xsp</url-pattern>
|
||||
<url-pattern>*.JSP</url-pattern>
|
||||
<url-pattern>*.JSPF</url-pattern>
|
||||
<url-pattern>*.JSPX</url-pattern>
|
||||
<url-pattern>*.XSP</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<session-config>
|
||||
<session-timeout>30</session-timeout>
|
||||
</session-config>
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<!-- Default MIME mappings -->
|
||||
<!-- The default MIME mappings are provided by the mime.properties -->
|
||||
<!-- resource in the org.eclipse.jetty.server.jar file. Additional or modified -->
|
||||
<!-- mappings may be specified here -->
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<!-- UNCOMMENT TO ACTIVATE <mime-mapping> <extension>mysuffix</extension>
|
||||
<mime-type>mymime/type</mime-type> </mime-mapping> -->
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
<welcome-file>index.htm</welcome-file>
|
||||
<welcome-file>index.jsp</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<locale-encoding-mapping-list>
|
||||
<locale-encoding-mapping>
|
||||
<locale>ar</locale>
|
||||
<encoding>ISO-8859-6</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>be</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>bg</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>ca</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>cs</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>da</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>de</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>el</locale>
|
||||
<encoding>ISO-8859-7</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>en</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>es</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>et</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>fi</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>fr</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>hr</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>hu</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>is</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>it</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>iw</locale>
|
||||
<encoding>ISO-8859-8</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>ja</locale>
|
||||
<encoding>Shift_JIS</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>ko</locale>
|
||||
<encoding>EUC-KR</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>lt</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>lv</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>mk</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>nl</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>no</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>pl</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>pt</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>ro</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>ru</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>sh</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>sk</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>sl</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>sq</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>sr</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>sv</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>tr</locale>
|
||||
<encoding>ISO-8859-9</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>uk</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>zh</locale>
|
||||
<encoding>GB2312</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>zh_TW</locale>
|
||||
<encoding>Big5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
</locale-encoding-mapping-list>
|
||||
|
||||
<security-constraint>
|
||||
<web-resource-collection>
|
||||
<web-resource-name>Disable TRACE</web-resource-name>
|
||||
<url-pattern>/</url-pattern>
|
||||
<http-method>TRACE</http-method>
|
||||
</web-resource-collection>
|
||||
<auth-constraint />
|
||||
</security-constraint>
|
||||
|
||||
</web-app>
|
||||
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<!-- ===================================================================== -->
|
||||
<!-- This file contains the default descriptor for web applications. -->
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
- -->
|
||||
<!-- The intent of this descriptor is to include jetty specific or common -->
|
||||
<!-- configuration for all webapps. If a context has a webdefault.xml -->
|
||||
<!-- descriptor, it is applied before the contexts own web.xml file -->
|
||||
<!-- -->
|
||||
<!-- A context may be assigned a default descriptor by: -->
|
||||
<!-- + Calling WebApplicationContext.setDefaultsDescriptor -->
|
||||
<!-- + Passed an arg to addWebApplications -->
|
||||
<!-- -->
|
||||
<!-- This file is used both as the resource within the jetty.jar (which is -->
|
||||
<!-- used as the default if no explicit defaults descriptor is set) and it -->
|
||||
<!-- is copied to the etc directory of the Jetty distro and explicitly -->
|
||||
<!-- by the jetty.xml file. -->
|
||||
<!-- -->
|
||||
<!-- ===================================================================== -->
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||
metadata-complete="true" version="2.5">
|
||||
|
||||
<description>
|
||||
Default web.xml file.
|
||||
This file is applied to a Web application before it's own WEB_INF/web.xml file
|
||||
</description>
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<!-- Removes static references to beans from javax.el.BeanELResolver to -->
|
||||
<!-- ensure webapp classloader can be released on undeploy -->
|
||||
<!-- ==================================================================== -->
|
||||
<listener>
|
||||
<listener-class>org.eclipse.jetty.servlet.listener.ELContextCleaner</listener-class>
|
||||
</listener>
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<!-- Removes static cache of Methods from java.beans.Introspector to -->
|
||||
<!-- ensure webapp classloader can be released on undeploy -->
|
||||
<!-- ==================================================================== -->
|
||||
<listener>
|
||||
<listener-class>org.eclipse.jetty.servlet.listener.IntrospectorCleaner</listener-class>
|
||||
</listener>
|
||||
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<!-- Context params to control Session Cookies -->
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<!-- UNCOMMENT TO ACTIVATE <context-param> <param-name>org.eclipse.jetty.servlet.SessionDomain</param-name>
|
||||
<param-value>127.0.0.1</param-value> </context-param> <context-param> <param-name>org.eclipse.jetty.servlet.SessionPath</param-name>
|
||||
<param-value>/</param-value> </context-param> <context-param> <param-name>org.eclipse.jetty.servlet.MaxAge</param-name>
|
||||
<param-value>-1</param-value> </context-param> -->
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<!-- The default servlet. -->
|
||||
<!-- This servlet, normally mapped to /, provides the handling for static -->
|
||||
<!-- content, OPTIONS and TRACE methods for the context. -->
|
||||
<!-- The following initParameters are supported: -->
|
||||
<!-- * acceptRanges If true, range requests and responses are * supported
|
||||
* * dirAllowed If true, directory listings are returned if no * welcome file
|
||||
is found. Else 403 Forbidden. * * welcomeServlets If true, attempt to dispatch
|
||||
to welcome files * that are servlets, but only after no matching static *
|
||||
resources could be found. If false, then a welcome * file must exist on disk.
|
||||
If "exact", then exact * servlet matches are supported without an existing
|
||||
file. * Default is true. * * This must be false if you want directory listings,
|
||||
* but have index.jsp in your welcome file list. * * redirectWelcome If true,
|
||||
welcome files are redirected rather than * forwarded to. * * gzip If set
|
||||
to true, then static content will be served as * gzip content encoded if
|
||||
a matching resource is * found ending with ".gz" * * resourceBase Set to
|
||||
replace the context resource base * * resourceCache If set, this is a context
|
||||
attribute name, which the servlet * will use to look for a shared ResourceCache
|
||||
instance. * * relativeResourceBase * Set with a pathname relative to the
|
||||
base of the * servlet context root. Useful for only serving static content
|
||||
out * of only specific subdirectories. * * pathInfoOnly If true, only the
|
||||
path info will be applied to the resourceBase * * stylesheet Set with the
|
||||
location of an optional stylesheet that will be used * to decorate the directory
|
||||
listing html. * * aliases If True, aliases of resources are allowed (eg.
|
||||
symbolic * links and caps variations). May bypass security constraints. *
|
||||
* etags If True, weak etags will be generated and handled. * * maxCacheSize
|
||||
The maximum total size of the cache or 0 for no cache. * maxCachedFileSize
|
||||
The maximum size of a file to cache * maxCachedFiles The maximum number of
|
||||
files to cache * * useFileMappedBuffer * If set to true, it will use mapped
|
||||
file buffer to serve static content * when using NIO connector. Setting this
|
||||
value to false means that * a direct buffer will be used instead of a mapped
|
||||
file buffer. * By default, this is set to true. * * cacheControl If set,
|
||||
all static content will have this value set as the cache-control * header.
|
||||
* -->
|
||||
|
||||
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<servlet>
|
||||
<servlet-name>default</servlet-name>
|
||||
<servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>aliases</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>acceptRanges</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>dirAllowed</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>welcomeServlets</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>redirectWelcome</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>maxCacheSize</param-name>
|
||||
<param-value>256000000</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>maxCachedFileSize</param-name>
|
||||
<param-value>200000000</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>maxCachedFiles</param-name>
|
||||
<param-value>2048</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>gzip</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>etags</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>useFileMappedBuffer</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<!-- <init-param> <param-name>resourceCache</param-name> <param-value>resourceCache</param-value>
|
||||
</init-param> -->
|
||||
<!-- <init-param> <param-name>cacheControl</param-name> <param-value>max-age=3600,public</param-value>
|
||||
</init-param> -->
|
||||
<load-on-startup>0</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>default</servlet-name>
|
||||
<url-pattern>/</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<!-- JSP Servlet -->
|
||||
<!-- This is the jasper JSP servlet from the jakarta project -->
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<!-- The JSP page compiler and execution servlet, which is the mechanism -->
|
||||
<!-- used by Glassfish to support JSP pages. Traditionally, this servlet -->
|
||||
<!-- is mapped to URL patterh "*.jsp". This servlet supports the -->
|
||||
<!-- following initialization parameters (default values are in square -->
|
||||
<!-- brackets): -->
|
||||
<!-- -->
|
||||
<!-- checkInterval If development is false and reloading is true, -->
|
||||
<!-- background compiles are enabled. checkInterval -->
|
||||
<!-- is the time in seconds between checks to see -->
|
||||
<!-- if a JSP page needs to be recompiled. [300] -->
|
||||
<!-- -->
|
||||
<!-- compiler Which compiler Ant should use to compile JSP -->
|
||||
<!-- pages. See the Ant documenation for more -->
|
||||
<!-- information. [javac] -->
|
||||
<!-- -->
|
||||
<!-- classdebuginfo Should the class file be compiled with -->
|
||||
<!-- debugging information? [true] -->
|
||||
<!-- -->
|
||||
<!-- classpath What class path should I use while compiling -->
|
||||
<!-- generated servlets? [Created dynamically -->
|
||||
<!-- based on the current web application] -->
|
||||
<!-- Set to ? to make the container explicitly set -->
|
||||
<!-- this parameter. -->
|
||||
<!-- -->
|
||||
<!-- development Is Jasper used in development mode (will check -->
|
||||
<!-- for JSP modification on every access)? [true] -->
|
||||
<!-- -->
|
||||
<!-- enablePooling Determines whether tag handler pooling is -->
|
||||
<!-- enabled [true] -->
|
||||
<!-- -->
|
||||
<!-- fork Tell Ant to fork compiles of JSP pages so that -->
|
||||
<!-- a separate JVM is used for JSP page compiles -->
|
||||
<!-- from the one Tomcat is running in. [true] -->
|
||||
<!-- -->
|
||||
<!-- ieClassId The class-id value to be sent to Internet -->
|
||||
<!-- Explorer when using <jsp:plugin> tags. -->
|
||||
<!-- [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93] -->
|
||||
<!-- -->
|
||||
<!-- javaEncoding Java file encoding to use for generating java -->
|
||||
<!-- source files. [UTF-8] -->
|
||||
<!-- -->
|
||||
<!-- keepgenerated Should we keep the generated Java source code -->
|
||||
<!-- for each page instead of deleting it? [true] -->
|
||||
<!-- -->
|
||||
<!-- logVerbosityLevel The level of detailed messages to be produced -->
|
||||
<!-- by this servlet. Increasing levels cause the -->
|
||||
<!-- generation of more messages. Valid values are -->
|
||||
<!-- FATAL, ERROR, WARNING, INFORMATION, and DEBUG. -->
|
||||
<!-- [WARNING] -->
|
||||
<!-- -->
|
||||
<!-- mappedfile Should we generate static content with one -->
|
||||
<!-- print statement per input line, to ease -->
|
||||
<!-- debugging? [false] -->
|
||||
<!-- -->
|
||||
<!-- -->
|
||||
<!-- reloading Should Jasper check for modified JSPs? [true] -->
|
||||
<!-- -->
|
||||
<!-- suppressSmap Should the generation of SMAP info for JSR45 -->
|
||||
<!-- debugging be suppressed? [false] -->
|
||||
<!-- -->
|
||||
<!-- dumpSmap Should the SMAP info for JSR45 debugging be -->
|
||||
<!-- dumped to a file? [false] -->
|
||||
<!-- False if suppressSmap is true -->
|
||||
<!-- -->
|
||||
<!-- scratchdir What scratch directory should we use when -->
|
||||
<!-- compiling JSP pages? [default work directory -->
|
||||
<!-- for the current web application] -->
|
||||
<!-- -->
|
||||
<!-- tagpoolMaxSize The maximum tag handler pool size [5] -->
|
||||
<!-- -->
|
||||
<!-- xpoweredBy Determines whether X-Powered-By response -->
|
||||
<!-- header is added by generated servlet [false] -->
|
||||
<!-- -->
|
||||
<!-- If you wish to use Jikes to compile JSP pages: -->
|
||||
<!-- Set the init parameter "compiler" to "jikes". Define -->
|
||||
<!-- the property "-Dbuild.compiler.emacs=true" when starting Jetty -->
|
||||
<!-- to cause Jikes to emit error messages in a format compatible with -->
|
||||
<!-- Jasper. -->
|
||||
<!-- If you get an error reporting that jikes can't use UTF-8 encoding, -->
|
||||
<!-- try setting the init parameter "javaEncoding" to "ISO-8859-1". -->
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<servlet id="jsp">
|
||||
<servlet-name>jsp</servlet-name>
|
||||
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>logVerbosityLevel</param-name>
|
||||
<param-value>DEBUG</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>fork</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>xpoweredBy</param-name>
|
||||
<param-value>false</param-value>
|
||||
</init-param>
|
||||
<!-- <init-param> <param-name>classpath</param-name> <param-value>?</param-value>
|
||||
</init-param> -->
|
||||
<load-on-startup>0</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>jsp</servlet-name>
|
||||
<url-pattern>*.jsp</url-pattern>
|
||||
<url-pattern>*.jspf</url-pattern>
|
||||
<url-pattern>*.jspx</url-pattern>
|
||||
<url-pattern>*.xsp</url-pattern>
|
||||
<url-pattern>*.JSP</url-pattern>
|
||||
<url-pattern>*.JSPF</url-pattern>
|
||||
<url-pattern>*.JSPX</url-pattern>
|
||||
<url-pattern>*.XSP</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<session-config>
|
||||
<session-timeout>30</session-timeout>
|
||||
</session-config>
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<!-- Default MIME mappings -->
|
||||
<!-- The default MIME mappings are provided by the mime.properties -->
|
||||
<!-- resource in the org.eclipse.jetty.server.jar file. Additional or modified -->
|
||||
<!-- mappings may be specified here -->
|
||||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
||||
<!-- UNCOMMENT TO ACTIVATE <mime-mapping> <extension>mysuffix</extension>
|
||||
<mime-type>mymime/type</mime-type> </mime-mapping> -->
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
<welcome-file>index.htm</welcome-file>
|
||||
<welcome-file>index.jsp</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<locale-encoding-mapping-list>
|
||||
<locale-encoding-mapping>
|
||||
<locale>ar</locale>
|
||||
<encoding>ISO-8859-6</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>be</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>bg</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>ca</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>cs</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>da</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>de</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>el</locale>
|
||||
<encoding>ISO-8859-7</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>en</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>es</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>et</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>fi</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>fr</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>hr</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>hu</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>is</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>it</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>iw</locale>
|
||||
<encoding>ISO-8859-8</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>ja</locale>
|
||||
<encoding>Shift_JIS</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>ko</locale>
|
||||
<encoding>EUC-KR</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>lt</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>lv</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>mk</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>nl</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>no</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>pl</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>pt</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>ro</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>ru</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>sh</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>sk</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>sl</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>sq</locale>
|
||||
<encoding>ISO-8859-2</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>sr</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>sv</locale>
|
||||
<encoding>ISO-8859-1</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>tr</locale>
|
||||
<encoding>ISO-8859-9</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>uk</locale>
|
||||
<encoding>ISO-8859-5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>zh</locale>
|
||||
<encoding>GB2312</encoding>
|
||||
</locale-encoding-mapping>
|
||||
<locale-encoding-mapping>
|
||||
<locale>zh_TW</locale>
|
||||
<encoding>Big5</encoding>
|
||||
</locale-encoding-mapping>
|
||||
</locale-encoding-mapping-list>
|
||||
|
||||
<security-constraint>
|
||||
<web-resource-collection>
|
||||
<web-resource-name>Disable TRACE</web-resource-name>
|
||||
<url-pattern>/</url-pattern>
|
||||
<http-method>TRACE</http-method>
|
||||
</web-resource-collection>
|
||||
<auth-constraint />
|
||||
</security-constraint>
|
||||
|
||||
</web-app>
|
||||
|
||||
|
|
|
@ -1,134 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<html>
|
||||
<head>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<meta charset="utf-8">
|
||||
<title>Bench4Q</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description"
|
||||
content="Bench4Q, a new method for QOS benchmarking.">
|
||||
<link id="bs-css" href="lib/chrisma/css/bootstrap-cerulean.css"
|
||||
rel="stylesheet">
|
||||
<link href="lib/chrisma/css/opa-icons.css" rel="stylesheet">
|
||||
<link
|
||||
href="http://ajax.aspnetcdn.com/ajax/bootstrap/2.3.2/css/bootstrap-responsive.css"
|
||||
rel="stylesheet">
|
||||
<link href="lib/chrisma/css/charisma-app.css" rel="stylesheet">
|
||||
<link rel="shortcut icon" href="images/bench4q.png">
|
||||
<link href="css/bench4q.css" rel="stylesheet">
|
||||
<style type="text/css">
|
||||
body {
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.sidebar-nav {
|
||||
padding: 9px 0;
|
||||
}
|
||||
.btn{
|
||||
margin-right:5px;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<fmt:bundle basename="i18n">
|
||||
<jsp:include page="publiccontrol/navigatebar.jsp"></jsp:include>
|
||||
<!-- topbar ends -->
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row-fluid">
|
||||
<div id="content" class="span10 center ">
|
||||
<!-- content starts -->
|
||||
<div class="sortable row-fluid ui-sortable">
|
||||
<a data-rel="tooltip" class="well span3 top-block" href="test.jsp"
|
||||
data-original-title=<fmt:message key="creattestplan" />> <span
|
||||
class="icon32 icon-red icon-plus"></span><br> <fmt:message
|
||||
key="creattestplan" />
|
||||
|
||||
</a> <a data-rel="tooltip" class="well span3 top-block"
|
||||
href="device.jsp"
|
||||
data-original-title=<fmt:message key="home-devManage" />>
|
||||
<span class="icon32 icon-color icon-edit"></span><br> <fmt:message
|
||||
key="home-devManage" />
|
||||
|
||||
</a> <a data-rel="tooltip" class="well span3 top-block"
|
||||
href="topologyManage.jsp"
|
||||
data-original-title=<fmt:message key="home-devTop" />> <span
|
||||
class="icon32 icon-green icon-envelope-closed"></span> <br>
|
||||
<fmt:message key="home-devTop" />
|
||||
</a> <a data-rel="tooltip" class="well span3 top-block"
|
||||
href="testplans.jsp"
|
||||
data-original-title=<fmt:message key="testhistory" />> <span
|
||||
class="icon32 icon-blue icon-star-on"></span><br> <fmt:message
|
||||
key="testhistory" />
|
||||
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row-fluid sortable">
|
||||
<div class="box span12"></div>
|
||||
<!-- content ends -->
|
||||
</div>
|
||||
<div class="row-fluid sortable">
|
||||
<div class="box span12">
|
||||
<div class="box-header well" data-original-title>
|
||||
<h2>
|
||||
<fmt:message key="latestTest" />
|
||||
</h2>
|
||||
<div class="box-icon">
|
||||
<a href="#" class="btn btn-setting btn-round"><i
|
||||
class="icon-cog"></i></a> <a href="#"
|
||||
class="btn btn-minimize btn-round"><i
|
||||
class="icon-chevron-up"></i></a> <a href="#"
|
||||
class="btn btn-close btn-round"><i class="icon-remove"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-content">
|
||||
<table class="table table-condensed " id="testPlanTab">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th><fmt:message key="name" /></th>
|
||||
<th><fmt:message key="status" /></th>
|
||||
<th><fmt:message key="createdatetime" /></th>
|
||||
<th><fmt:message key="testPlan-view" /></th>
|
||||
<th><fmt:message key="actions" /></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- content ends -->
|
||||
</div>
|
||||
<!--/#content.span10-->
|
||||
</div>
|
||||
<!--/fluid-row-->
|
||||
</div>
|
||||
<hr>
|
||||
<jsp:include page="publiccontrol/footer.jsp"></jsp:include>
|
||||
</div>
|
||||
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.0.js"></script>
|
||||
<script
|
||||
src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.4/jquery-ui.min.js"></script>
|
||||
<script
|
||||
src='http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.js'></script>
|
||||
<script src="lib/jqueryi18n/jquery.i18n.properties-1.0.9.js"></script>
|
||||
<script
|
||||
src="http://ajax.aspnetcdn.com/ajax/bootstrap/2.3.1/bootstrap.min.js"></script>
|
||||
<script src="lib/chrisma/js/jquery.cookie.js"></script>
|
||||
<script src="lib/chrisma/js/theme.js"></script>
|
||||
<script src="script/base.js"></script>
|
||||
<script src="script/share/TestStatusMap.js"></script>
|
||||
<script src="script/scriptTable.js"></script>
|
||||
<script src="script/bench4q.table.js"></script>
|
||||
<script src="script/home.js"></script>
|
||||
<script src="script/testPlans.js"></script>
|
||||
|
||||
</fmt:bundle>
|
||||
</body>
|
||||
</html>
|
|
@ -1,159 +1,159 @@
|
|||
<!DOCTYPE html>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<html>
|
||||
<head>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<title>Bench4Q</title>
|
||||
<link id="bs-css" href="lib/chrisma/css/bootstrap-cerulean.css"
|
||||
rel="stylesheet">
|
||||
<link href="lib/chrisma/css/opa-icons.css" rel="stylesheet">
|
||||
<link
|
||||
href="http://ajax.aspnetcdn.com/ajax/bootstrap/2.3.2/css/bootstrap-responsive.css"
|
||||
rel="stylesheet">
|
||||
<link href="lib/chrisma/css/charisma-app.css" rel="stylesheet">
|
||||
<link rel="shortcut icon" href="images/bench4q.png">
|
||||
<link href="lib/dataTable/css/jquery.dataTables.css" rel="stylesheet">
|
||||
</head>
|
||||
<style>
|
||||
body {
|
||||
min-height: 600px;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.sidebar-nav {
|
||||
padding: 9px 0;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<fmt:bundle basename="i18n">
|
||||
<jsp:include page="publiccontrol/navigatebar.jsp"></jsp:include>
|
||||
<div class="container-fluid">
|
||||
<div class="row-fluid">
|
||||
<jsp:include page="publiccontrol/adminleftmenubar.jsp"></jsp:include>
|
||||
<div id="content" class="span10">
|
||||
<div>
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="homepage.jsp"><fmt:message key="home" /></a> <span
|
||||
class="divider">/</span></li>
|
||||
<li><a href="#"><fmt:message key="agentmanagement" /></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="row-fluid sortable">
|
||||
<div class="box span12 ">
|
||||
<div class="box-header well" data-original-title>
|
||||
<h2>
|
||||
<i><fmt:message key="agents" /></i>
|
||||
</h2>
|
||||
<div class="box-icon">
|
||||
<a class="btn btn-setting btn-round"><i class="icon-plus"></i></a>
|
||||
<a class="btn btn-round" id="agentList"><i
|
||||
class="icon-list"></i></a> <a class="btn btn-minimize btn-round"><i
|
||||
class="icon-chevron-up"></i></a> <a
|
||||
class="btn btn-close btn-round"><i class="icon-remove"></i></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-content">
|
||||
<table id="agents"
|
||||
class="table table-striped table-bordered bootstrap-datatable datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><fmt:message key="hostname" /></th>
|
||||
<th><fmt:message key="port" /></th>
|
||||
<th><fmt:message key="status" /></th>
|
||||
<th><fmt:message key="maxload" /></th>
|
||||
<th><fmt:message key="remainload" /></th>
|
||||
<th><fmt:message key="actions" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="modal hide fade" id="agentParam">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">x</button>
|
||||
<h3>
|
||||
<fmt:message key="agentManage_jsp_addAgent" />
|
||||
</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="focusedInput"><fmt:message
|
||||
key="hostname" /></label>
|
||||
<div class="controls">
|
||||
<input class="input-xlarge focused" id="hostName" type="text"
|
||||
value="">
|
||||
<div id='hostName_error' style='display: none; color: red'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="focusedInput"><fmt:message
|
||||
key="port" /></label>
|
||||
<div class="controls">
|
||||
<input class="input-xlarge focused" id="port" type="text"
|
||||
value="">
|
||||
<div id='port_error' style='display: none; color: red'></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="focusedInput"><fmt:message
|
||||
key="maxload" /></label>
|
||||
<div class="controls">
|
||||
<input class="input-xlarge focused" id="maxLoad" type="text"
|
||||
value="">
|
||||
<div id='maxLoad_error' style='display: none; color: red'></div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal"
|
||||
onClick="addAgentToDB()">
|
||||
<fmt:message key="submit" />
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">
|
||||
<fmt:message key="cancel" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dialog" title="Message"></div>
|
||||
<jsp:include page="publiccontrol/footer.jsp"></jsp:include>
|
||||
|
||||
</div>
|
||||
<script
|
||||
src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.0.min.js"></script>
|
||||
<script
|
||||
src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.4/jquery-ui.min.js"></script>
|
||||
<script src="lib/dataTable/js/jquery.dataTables.js"></script>>
|
||||
<script src="lib/bootstrap/js/bootstrap-modal.js"></script>
|
||||
<script
|
||||
src="http://ajax.aspnetcdn.com/ajax/bootstrap/2.3.1/bootstrap.min.js"></script>
|
||||
<script src="lib/bootstrap/js/bootstrap-modal.js"></script>
|
||||
<script src="lib/chrisma/js/jquery.cookie.js"></script>
|
||||
<script src="lib/chrisma/js/theme.js"></script>
|
||||
<script src="lib/jqueryi18n/jquery.i18n.properties-1.0.9.js"></script>
|
||||
<script src="http://malsup.github.com/jquery.form.js"></script>
|
||||
<script src="script/base.js"></script>
|
||||
<script src="script/bench4q.table.js"></script>
|
||||
<script src="script/admin/agentManage.js"></script>
|
||||
</fmt:bundle>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<html>
|
||||
<head>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<title>Bench4Q</title>
|
||||
<link id="bs-css" href="lib/chrisma/css/bootstrap-cerulean.css"
|
||||
rel="stylesheet">
|
||||
<link href="lib/chrisma/css/opa-icons.css" rel="stylesheet">
|
||||
<link
|
||||
href="http://ajax.aspnetcdn.com/ajax/bootstrap/2.3.2/css/bootstrap-responsive.css"
|
||||
rel="stylesheet">
|
||||
<link href="lib/chrisma/css/charisma-app.css" rel="stylesheet">
|
||||
<link rel="shortcut icon" href="images/bench4q.png">
|
||||
<link href="lib/dataTable/css/jquery.dataTables.css" rel="stylesheet">
|
||||
</head>
|
||||
<style>
|
||||
body {
|
||||
min-height: 600px;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.sidebar-nav {
|
||||
padding: 9px 0;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<fmt:bundle basename="i18n">
|
||||
<jsp:include page="publiccontrol/navigatebar.jsp"></jsp:include>
|
||||
<div class="container-fluid">
|
||||
<div class="row-fluid">
|
||||
<jsp:include page="publiccontrol/adminleftmenubar.jsp"></jsp:include>
|
||||
<div id="content" class="span10">
|
||||
<div>
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="homepage.jsp"><fmt:message key="home" /></a> <span
|
||||
class="divider">/</span></li>
|
||||
<li><a href="#"><fmt:message key="agentmanagement" /></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="row-fluid sortable">
|
||||
<div class="box span12 ">
|
||||
<div class="box-header well" data-original-title>
|
||||
<h2>
|
||||
<i><fmt:message key="agents" /></i>
|
||||
</h2>
|
||||
<div class="box-icon">
|
||||
<a class="btn btn-setting btn-round"><i class="icon-plus"></i></a>
|
||||
<a class="btn btn-round" id="agentList"><i
|
||||
class="icon-list"></i></a> <a class="btn btn-minimize btn-round"><i
|
||||
class="icon-chevron-up"></i></a> <a
|
||||
class="btn btn-close btn-round"><i class="icon-remove"></i></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-content">
|
||||
<table id="agents"
|
||||
class="table table-striped table-bordered bootstrap-datatable datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><fmt:message key="hostname" /></th>
|
||||
<th><fmt:message key="port" /></th>
|
||||
<th><fmt:message key="status" /></th>
|
||||
<th><fmt:message key="maxload" /></th>
|
||||
<th><fmt:message key="remainload" /></th>
|
||||
<th><fmt:message key="actions" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="modal hide fade" id="agentParam">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">x</button>
|
||||
<h3>
|
||||
<fmt:message key="agentManage_jsp_addAgent" />
|
||||
</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="focusedInput"><fmt:message
|
||||
key="hostname" /></label>
|
||||
<div class="controls">
|
||||
<input class="input-xlarge focused" id="hostName" type="text"
|
||||
value="">
|
||||
<div id='hostName_error' style='display: none; color: red'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="focusedInput"><fmt:message
|
||||
key="port" /></label>
|
||||
<div class="controls">
|
||||
<input class="input-xlarge focused" id="port" type="text"
|
||||
value="">
|
||||
<div id='port_error' style='display: none; color: red'></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="focusedInput"><fmt:message
|
||||
key="maxload" /></label>
|
||||
<div class="controls">
|
||||
<input class="input-xlarge focused" id="maxLoad" type="text"
|
||||
value="">
|
||||
<div id='maxLoad_error' style='display: none; color: red'></div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal"
|
||||
onClick="addAgentToDB()">
|
||||
<fmt:message key="submit" />
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">
|
||||
<fmt:message key="cancel" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dialog" title="Message"></div>
|
||||
<jsp:include page="publiccontrol/footer.jsp"></jsp:include>
|
||||
|
||||
</div>
|
||||
<script
|
||||
src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.0.min.js"></script>
|
||||
<script
|
||||
src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.4/jquery-ui.min.js"></script>
|
||||
<script src="lib/dataTable/js/jquery.dataTables.js"></script>>
|
||||
<script src="lib/bootstrap/js/bootstrap-modal.js"></script>
|
||||
<script
|
||||
src="http://ajax.aspnetcdn.com/ajax/bootstrap/2.3.1/bootstrap.min.js"></script>
|
||||
<script src="lib/bootstrap/js/bootstrap-modal.js"></script>
|
||||
<script src="lib/chrisma/js/jquery.cookie.js"></script>
|
||||
<script src="lib/chrisma/js/theme.js"></script>
|
||||
<script src="lib/jqueryi18n/jquery.i18n.properties-1.0.9.js"></script>
|
||||
<script src="http://malsup.github.com/jquery.form.js"></script>
|
||||
<script src="script/base.js"></script>
|
||||
<script src="script/bench4q.table.js"></script>
|
||||
<script src="script/admin/agentManage.js"></script>
|
||||
</fmt:bundle>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,275 +1,275 @@
|
|||
/* ===========================================================
|
||||
* bootstrap-tooltip.js v2.0.4
|
||||
* http://twitter.github.com/bootstrap/javascript.html#tooltips
|
||||
* Inspired by the original jQuery.tipsy by Jason Frame
|
||||
* ===========================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* TOOLTIP PUBLIC CLASS DEFINITION
|
||||
* =============================== */
|
||||
|
||||
var Tooltip = function (element, options) {
|
||||
this.init('tooltip', element, options)
|
||||
}
|
||||
|
||||
Tooltip.prototype = {
|
||||
|
||||
constructor: Tooltip
|
||||
|
||||
, init: function (type, element, options) {
|
||||
var eventIn
|
||||
, eventOut
|
||||
|
||||
this.type = type
|
||||
this.$element = $(element)
|
||||
this.options = this.getOptions(options)
|
||||
this.enabled = true
|
||||
|
||||
if (this.options.trigger != 'manual') {
|
||||
eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
|
||||
eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
|
||||
this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this))
|
||||
this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this))
|
||||
}
|
||||
|
||||
this.options.selector ?
|
||||
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
||||
this.fixTitle()
|
||||
}
|
||||
|
||||
, getOptions: function (options) {
|
||||
options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
|
||||
|
||||
if (options.delay && typeof options.delay == 'number') {
|
||||
options.delay = {
|
||||
show: options.delay
|
||||
, hide: options.delay
|
||||
}
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
, enter: function (e) {
|
||||
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
||||
|
||||
if (!self.options.delay || !self.options.delay.show) return self.show()
|
||||
|
||||
clearTimeout(this.timeout)
|
||||
self.hoverState = 'in'
|
||||
this.timeout = setTimeout(function() {
|
||||
if (self.hoverState == 'in') self.show()
|
||||
}, self.options.delay.show)
|
||||
}
|
||||
|
||||
, leave: function (e) {
|
||||
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
||||
|
||||
if (this.timeout) clearTimeout(this.timeout)
|
||||
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
||||
|
||||
self.hoverState = 'out'
|
||||
this.timeout = setTimeout(function() {
|
||||
if (self.hoverState == 'out') self.hide()
|
||||
}, self.options.delay.hide)
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
var $tip
|
||||
, inside
|
||||
, pos
|
||||
, actualWidth
|
||||
, actualHeight
|
||||
, placement
|
||||
, tp
|
||||
|
||||
if (this.hasContent() && this.enabled) {
|
||||
$tip = this.tip()
|
||||
this.setContent()
|
||||
|
||||
if (this.options.animation) {
|
||||
$tip.addClass('fade')
|
||||
}
|
||||
|
||||
placement = typeof this.options.placement == 'function' ?
|
||||
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
||||
this.options.placement
|
||||
|
||||
inside = /in/.test(placement)
|
||||
|
||||
$tip
|
||||
.remove()
|
||||
.css({ top: 0, left: 0, display: 'block' })
|
||||
.appendTo(inside ? this.$element : document.body)
|
||||
|
||||
pos = this.getPosition(inside)
|
||||
|
||||
actualWidth = $tip[0].offsetWidth
|
||||
actualHeight = $tip[0].offsetHeight
|
||||
|
||||
switch (inside ? placement.split(' ')[1] : placement) {
|
||||
case 'bottom':
|
||||
tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
|
||||
break
|
||||
case 'top':
|
||||
tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
|
||||
break
|
||||
case 'left':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
|
||||
break
|
||||
case 'right':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
|
||||
break
|
||||
}
|
||||
|
||||
$tip
|
||||
.css(tp)
|
||||
.addClass(placement)
|
||||
.addClass('in')
|
||||
}
|
||||
}
|
||||
|
||||
, isHTML: function(text) {
|
||||
// html string detection logic adapted from jQuery
|
||||
return typeof text != 'string'
|
||||
|| ( text.charAt(0) === "<"
|
||||
&& text.charAt( text.length - 1 ) === ">"
|
||||
&& text.length >= 3
|
||||
) || /^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(text)
|
||||
}
|
||||
|
||||
, setContent: function () {
|
||||
var $tip = this.tip()
|
||||
, title = this.getTitle()
|
||||
|
||||
$tip.find('.tooltip-inner')[this.isHTML(title) ? 'html' : 'text'](title)
|
||||
$tip.removeClass('fade in top bottom left right')
|
||||
}
|
||||
|
||||
, hide: function () {
|
||||
var that = this
|
||||
, $tip = this.tip()
|
||||
|
||||
$tip.removeClass('in')
|
||||
|
||||
function removeWithAnimation() {
|
||||
var timeout = setTimeout(function () {
|
||||
$tip.off($.support.transition.end).remove()
|
||||
}, 500)
|
||||
|
||||
$tip.one($.support.transition.end, function () {
|
||||
clearTimeout(timeout)
|
||||
$tip.remove()
|
||||
})
|
||||
}
|
||||
|
||||
$.support.transition && this.$tip.hasClass('fade') ?
|
||||
removeWithAnimation() :
|
||||
$tip.remove()
|
||||
}
|
||||
|
||||
, fixTitle: function () {
|
||||
var $e = this.$element
|
||||
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
|
||||
$e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
|
||||
}
|
||||
}
|
||||
|
||||
, hasContent: function () {
|
||||
return this.getTitle()
|
||||
}
|
||||
|
||||
, getPosition: function (inside) {
|
||||
return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
|
||||
width: this.$element[0].offsetWidth
|
||||
, height: this.$element[0].offsetHeight
|
||||
})
|
||||
}
|
||||
|
||||
, getTitle: function () {
|
||||
var title
|
||||
, $e = this.$element
|
||||
, o = this.options
|
||||
|
||||
title = $e.attr('data-original-title')
|
||||
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
||||
|
||||
return title
|
||||
}
|
||||
|
||||
, tip: function () {
|
||||
return this.$tip = this.$tip || $(this.options.template)
|
||||
}
|
||||
|
||||
, validate: function () {
|
||||
if (!this.$element[0].parentNode) {
|
||||
this.hide()
|
||||
this.$element = null
|
||||
this.options = null
|
||||
}
|
||||
}
|
||||
|
||||
, enable: function () {
|
||||
this.enabled = true
|
||||
}
|
||||
|
||||
, disable: function () {
|
||||
this.enabled = false
|
||||
}
|
||||
|
||||
, toggleEnabled: function () {
|
||||
this.enabled = !this.enabled
|
||||
}
|
||||
|
||||
, toggle: function () {
|
||||
this[this.tip().hasClass('in') ? 'hide' : 'show']()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* TOOLTIP PLUGIN DEFINITION
|
||||
* ========================= */
|
||||
|
||||
$.fn.tooltip = function ( option ) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('tooltip')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.tooltip.Constructor = Tooltip
|
||||
|
||||
$.fn.tooltip.defaults = {
|
||||
animation: true
|
||||
, placement: 'top'
|
||||
, selector: false
|
||||
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
|
||||
, trigger: 'hover'
|
||||
, title: ''
|
||||
, delay: 0
|
||||
}
|
||||
|
||||
}(window.jQuery);
|
||||
/* ===========================================================
|
||||
* bootstrap-tooltip.js v2.0.4
|
||||
* http://twitter.github.com/bootstrap/javascript.html#tooltips
|
||||
* Inspired by the original jQuery.tipsy by Jason Frame
|
||||
* ===========================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* TOOLTIP PUBLIC CLASS DEFINITION
|
||||
* =============================== */
|
||||
|
||||
var Tooltip = function (element, options) {
|
||||
this.init('tooltip', element, options)
|
||||
}
|
||||
|
||||
Tooltip.prototype = {
|
||||
|
||||
constructor: Tooltip
|
||||
|
||||
, init: function (type, element, options) {
|
||||
var eventIn
|
||||
, eventOut
|
||||
|
||||
this.type = type
|
||||
this.$element = $(element)
|
||||
this.options = this.getOptions(options)
|
||||
this.enabled = true
|
||||
|
||||
if (this.options.trigger != 'manual') {
|
||||
eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
|
||||
eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
|
||||
this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this))
|
||||
this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this))
|
||||
}
|
||||
|
||||
this.options.selector ?
|
||||
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
||||
this.fixTitle()
|
||||
}
|
||||
|
||||
, getOptions: function (options) {
|
||||
options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
|
||||
|
||||
if (options.delay && typeof options.delay == 'number') {
|
||||
options.delay = {
|
||||
show: options.delay
|
||||
, hide: options.delay
|
||||
}
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
, enter: function (e) {
|
||||
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
||||
|
||||
if (!self.options.delay || !self.options.delay.show) return self.show()
|
||||
|
||||
clearTimeout(this.timeout)
|
||||
self.hoverState = 'in'
|
||||
this.timeout = setTimeout(function() {
|
||||
if (self.hoverState == 'in') self.show()
|
||||
}, self.options.delay.show)
|
||||
}
|
||||
|
||||
, leave: function (e) {
|
||||
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
||||
|
||||
if (this.timeout) clearTimeout(this.timeout)
|
||||
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
||||
|
||||
self.hoverState = 'out'
|
||||
this.timeout = setTimeout(function() {
|
||||
if (self.hoverState == 'out') self.hide()
|
||||
}, self.options.delay.hide)
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
var $tip
|
||||
, inside
|
||||
, pos
|
||||
, actualWidth
|
||||
, actualHeight
|
||||
, placement
|
||||
, tp
|
||||
|
||||
if (this.hasContent() && this.enabled) {
|
||||
$tip = this.tip()
|
||||
this.setContent()
|
||||
|
||||
if (this.options.animation) {
|
||||
$tip.addClass('fade')
|
||||
}
|
||||
|
||||
placement = typeof this.options.placement == 'function' ?
|
||||
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
||||
this.options.placement
|
||||
|
||||
inside = /in/.test(placement)
|
||||
|
||||
$tip
|
||||
.remove()
|
||||
.css({ top: 0, left: 0, display: 'block' })
|
||||
.appendTo(inside ? this.$element : document.body)
|
||||
|
||||
pos = this.getPosition(inside)
|
||||
|
||||
actualWidth = $tip[0].offsetWidth
|
||||
actualHeight = $tip[0].offsetHeight
|
||||
|
||||
switch (inside ? placement.split(' ')[1] : placement) {
|
||||
case 'bottom':
|
||||
tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
|
||||
break
|
||||
case 'top':
|
||||
tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
|
||||
break
|
||||
case 'left':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
|
||||
break
|
||||
case 'right':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
|
||||
break
|
||||
}
|
||||
|
||||
$tip
|
||||
.css(tp)
|
||||
.addClass(placement)
|
||||
.addClass('in')
|
||||
}
|
||||
}
|
||||
|
||||
, isHTML: function(text) {
|
||||
// html string detection logic adapted from jQuery
|
||||
return typeof text != 'string'
|
||||
|| ( text.charAt(0) === "<"
|
||||
&& text.charAt( text.length - 1 ) === ">"
|
||||
&& text.length >= 3
|
||||
) || /^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(text)
|
||||
}
|
||||
|
||||
, setContent: function () {
|
||||
var $tip = this.tip()
|
||||
, title = this.getTitle()
|
||||
|
||||
$tip.find('.tooltip-inner')[this.isHTML(title) ? 'html' : 'text'](title)
|
||||
$tip.removeClass('fade in top bottom left right')
|
||||
}
|
||||
|
||||
, hide: function () {
|
||||
var that = this
|
||||
, $tip = this.tip()
|
||||
|
||||
$tip.removeClass('in')
|
||||
|
||||
function removeWithAnimation() {
|
||||
var timeout = setTimeout(function () {
|
||||
$tip.off($.support.transition.end).remove()
|
||||
}, 500)
|
||||
|
||||
$tip.one($.support.transition.end, function () {
|
||||
clearTimeout(timeout)
|
||||
$tip.remove()
|
||||
})
|
||||
}
|
||||
|
||||
$.support.transition && this.$tip.hasClass('fade') ?
|
||||
removeWithAnimation() :
|
||||
$tip.remove()
|
||||
}
|
||||
|
||||
, fixTitle: function () {
|
||||
var $e = this.$element
|
||||
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
|
||||
$e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
|
||||
}
|
||||
}
|
||||
|
||||
, hasContent: function () {
|
||||
return this.getTitle()
|
||||
}
|
||||
|
||||
, getPosition: function (inside) {
|
||||
return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
|
||||
width: this.$element[0].offsetWidth
|
||||
, height: this.$element[0].offsetHeight
|
||||
})
|
||||
}
|
||||
|
||||
, getTitle: function () {
|
||||
var title
|
||||
, $e = this.$element
|
||||
, o = this.options
|
||||
|
||||
title = $e.attr('data-original-title')
|
||||
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
||||
|
||||
return title
|
||||
}
|
||||
|
||||
, tip: function () {
|
||||
return this.$tip = this.$tip || $(this.options.template)
|
||||
}
|
||||
|
||||
, validate: function () {
|
||||
if (!this.$element[0].parentNode) {
|
||||
this.hide()
|
||||
this.$element = null
|
||||
this.options = null
|
||||
}
|
||||
}
|
||||
|
||||
, enable: function () {
|
||||
this.enabled = true
|
||||
}
|
||||
|
||||
, disable: function () {
|
||||
this.enabled = false
|
||||
}
|
||||
|
||||
, toggleEnabled: function () {
|
||||
this.enabled = !this.enabled
|
||||
}
|
||||
|
||||
, toggle: function () {
|
||||
this[this.tip().hasClass('in') ? 'hide' : 'show']()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* TOOLTIP PLUGIN DEFINITION
|
||||
* ========================= */
|
||||
|
||||
$.fn.tooltip = function ( option ) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('tooltip')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.tooltip.Constructor = Tooltip
|
||||
|
||||
$.fn.tooltip.defaults = {
|
||||
animation: true
|
||||
, placement: 'top'
|
||||
, selector: false
|
||||
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
|
||||
, trigger: 'hover'
|
||||
, title: ''
|
||||
, delay: 0
|
||||
}
|
||||
|
||||
}(window.jQuery);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,213 +1,213 @@
|
|||
<!DOCTYPE html>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.sidebar-nav {
|
||||
padding: 9px 0;
|
||||
}
|
||||
</style>
|
||||
<title>Bench4Q</title>
|
||||
<link id="bs-css" href="lib/chrisma/css/bootstrap-cerulean.css"
|
||||
rel="stylesheet">
|
||||
<link href="lib/chrisma/css/charisma-app.css" rel="stylesheet">
|
||||
<link
|
||||
href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/themes/redmond/jquery-ui.css"
|
||||
rel="stylesheet">
|
||||
<link href='css/result.css' rel='stylesheet'>
|
||||
<link rel="shortcut icon" href="images/bench4q.png">
|
||||
</head>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<body>
|
||||
<fmt:bundle basename="i18n">
|
||||
<jsp:include page="publiccontrol/navigatebar.jsp"></jsp:include>
|
||||
<div class="container-fluid">
|
||||
<div class="row-fluid">
|
||||
<jsp:include page="publiccontrol/leftmenubar.jsp"></jsp:include>
|
||||
|
||||
<div id="content" class="span10 ">
|
||||
<!-- content starts -->
|
||||
<div>
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="homepage.jsp"><fmt:message key="home" /></a> <span
|
||||
class="divider">/</span></li>
|
||||
<li><a href="test.jsp"><fmt:message key="creatatest" /></a><span
|
||||
class="divider">/</span></li>
|
||||
<li><a href="#"><fmt:message key="result" /></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="row-fluid" id="test">
|
||||
<div class="span4 span-brief">
|
||||
<fmt:message key="result-testStatus" />
|
||||
<br> <br>
|
||||
<div id="status"></div>
|
||||
</div>
|
||||
<div class="span4 span-brief">
|
||||
<fmt:message key="result-vuser" />
|
||||
<br> <br>
|
||||
<div>
|
||||
<span id="vu"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span4 span-brief-last">
|
||||
<fmt:message key="result-request" />
|
||||
<br> <br>
|
||||
<div id="request"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<h4 class="pull-left"><fmt:message key="result-charts" /></h4>
|
||||
<div class="field-inline">
|
||||
<button type="button" class="btn btn-primary " id="del-graph">
|
||||
<fmt:message key="result-deleteGraph" />
|
||||
</button>
|
||||
|
||||
</div>
|
||||
<div class="field-inline">
|
||||
|
||||
<button type="button" class="btn btn-primary " id="add-graph">
|
||||
<fmt:message key="result-addGraph" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="app-container " id="chart"></div>
|
||||
<div class="row-fluid">
|
||||
<h4 class="pull-left"><fmt:message key="result-pages" /></h4>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<table id="page"
|
||||
class="table table-striped table-bordered bootstrap-datatable datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><fmt:message key="result-pages-page" /></th>
|
||||
<th><fmt:message key="result-pages-script" /></th>
|
||||
<th><fmt:message key="result-pages-count" /></th>
|
||||
<th><fmt:message key="result-pages-testMin" /> </th>
|
||||
<th><fmt:message key="result-pages-testMax" /></th>
|
||||
<th><fmt:message key="result-pages-average" /></th>
|
||||
<th><fmt:message key="result-pages-last" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<h4 class="pull-left"><fmt:message key="result-urls" /></h4>
|
||||
</div>
|
||||
<div class="app-container dataTables_wrapper">
|
||||
<table id="url"
|
||||
class="table table-striped table-bordered bootstrap-datatable datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><fmt:message key="result-url-url" /></th>
|
||||
<th><fmt:message key="result-url-script" /></th>
|
||||
<th><fmt:message key="result-url-successful" /></th>
|
||||
<th><fmt:message key="result-url-total" /></th>
|
||||
<th>details</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<!-- <div class="app-container" id="url-distribution"></div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal hide fade" id="add-graph-modal">
|
||||
<div class="modal-header">
|
||||
<button type="button" id="myModal-close" class="close"
|
||||
data-dismiss="modal">x</button>
|
||||
<h3>
|
||||
<fmt:message key="result-addGraph" />
|
||||
</h3>
|
||||
</div>
|
||||
<div class="modal-body" id="add-graph-list"></div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" id="add-graph-add"
|
||||
data-dismiss="modal">
|
||||
<fmt:message key="add" />
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">
|
||||
<fmt:message key="cancel" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal hide fade" id="del-graph-modal">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">x</button>
|
||||
<h3>
|
||||
<fmt:message key="result-deleteGraph" />
|
||||
</h3>
|
||||
</div>
|
||||
<div class="modal-body" id="del-graph-list"></div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" id="del-graph-del"
|
||||
data-dismiss="modal">
|
||||
<fmt:message key="delete" />
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">
|
||||
<fmt:message key="cancel" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal hide fade" id="load">
|
||||
<div class="modal-header">
|
||||
|
||||
<h3>Please wait,loading result data...</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="loading">
|
||||
<div></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" id="cancelLoading" class="btn btn-primary ">cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<jsp:include page="publiccontrol/footer.jsp"></jsp:include>
|
||||
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
|
||||
<script src="lib/jqueryi18n/jquery.i18n.properties-1.0.9.js"></script>
|
||||
<script src="lib/bootstrap/js/bootstrap-modal.js"></script>
|
||||
<script
|
||||
src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.4/jquery-ui.min.js"></script>
|
||||
<script
|
||||
src="http://ajax.aspnetcdn.com/ajax/bootstrap/2.3.1/bootstrap.min.js"></script>
|
||||
<script src="lib/chrisma/js/jquery.cookie.js"></script>
|
||||
<script
|
||||
src='http://cdn.datatables.net/1.10.0/js/jquery.dataTables.min.js'></script>
|
||||
<script src="lib/chrisma/js/theme.js"></script>
|
||||
<script src="lib/chrisma/js/jquery.cookie.js"></script>
|
||||
<script src="script/base.js"></script>
|
||||
<script src="http://code.highcharts.com/highcharts.js"></script>
|
||||
<script src="script/testResult/charts.js"></script>
|
||||
<script src="script/Share/TestStatusMap.js"></script>
|
||||
<script src="script/testResult/testBriefResult.js"></script>
|
||||
<script src="script/bench4q.table.js"></script>
|
||||
<script src="script/testResult/highChartTheme.js"></script>
|
||||
<script src="script/testResult/tree.js"></script>
|
||||
<script src="lib/HashMap/HashMap.js"></script>
|
||||
<script src="script/testResult/graphSelectorTree.js"></script>
|
||||
<script src="script/testResult/graphSelector.js"></script>
|
||||
<script src="script/testResult/pieChart.js"></script>
|
||||
<script src="script/testResult/loadProgress.js"></script>
|
||||
<script src="script/testResult/pageResult.js"></script>
|
||||
<script src="script/testResult/behaviorResult.js"></script>
|
||||
<script src="script/testResult/resultNew.js"></script>
|
||||
</fmt:bundle>
|
||||
</body>
|
||||
<!DOCTYPE html>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.sidebar-nav {
|
||||
padding: 9px 0;
|
||||
}
|
||||
</style>
|
||||
<title>Bench4Q</title>
|
||||
<link id="bs-css" href="lib/chrisma/css/bootstrap-cerulean.css"
|
||||
rel="stylesheet">
|
||||
<link href="lib/chrisma/css/charisma-app.css" rel="stylesheet">
|
||||
<link
|
||||
href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/themes/redmond/jquery-ui.css"
|
||||
rel="stylesheet">
|
||||
<link href='css/result.css' rel='stylesheet'>
|
||||
<link rel="shortcut icon" href="images/bench4q.png">
|
||||
</head>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<body>
|
||||
<fmt:bundle basename="i18n">
|
||||
<jsp:include page="publiccontrol/navigatebar.jsp"></jsp:include>
|
||||
<div class="container-fluid">
|
||||
<div class="row-fluid">
|
||||
<jsp:include page="publiccontrol/leftmenubar.jsp"></jsp:include>
|
||||
|
||||
<div id="content" class="span10 ">
|
||||
<!-- content starts -->
|
||||
<div>
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="homepage.jsp"><fmt:message key="home" /></a> <span
|
||||
class="divider">/</span></li>
|
||||
<li><a href="test.jsp"><fmt:message key="creatatest" /></a><span
|
||||
class="divider">/</span></li>
|
||||
<li><a href="#"><fmt:message key="result" /></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="row-fluid" id="test">
|
||||
<div class="span4 span-brief">
|
||||
<fmt:message key="result-testStatus" />
|
||||
<br> <br>
|
||||
<div id="status"></div>
|
||||
</div>
|
||||
<div class="span4 span-brief">
|
||||
<fmt:message key="result-vuser" />
|
||||
<br> <br>
|
||||
<div>
|
||||
<span id="vu"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span4 span-brief-last">
|
||||
<fmt:message key="result-request" />
|
||||
<br> <br>
|
||||
<div id="request"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<h4 class="pull-left"><fmt:message key="result-charts" /></h4>
|
||||
<div class="field-inline">
|
||||
<button type="button" class="btn btn-primary " id="del-graph">
|
||||
<fmt:message key="result-deleteGraph" />
|
||||
</button>
|
||||
|
||||
</div>
|
||||
<div class="field-inline">
|
||||
|
||||
<button type="button" class="btn btn-primary " id="add-graph">
|
||||
<fmt:message key="result-addGraph" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="app-container " id="chart"></div>
|
||||
<div class="row-fluid">
|
||||
<h4 class="pull-left"><fmt:message key="result-pages" /></h4>
|
||||
</div>
|
||||
<div class="app-container">
|
||||
<table id="page"
|
||||
class="table table-striped table-bordered bootstrap-datatable datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><fmt:message key="result-pages-page" /></th>
|
||||
<th><fmt:message key="result-pages-script" /></th>
|
||||
<th><fmt:message key="result-pages-count" /></th>
|
||||
<th><fmt:message key="result-pages-testMin" /> </th>
|
||||
<th><fmt:message key="result-pages-testMax" /></th>
|
||||
<th><fmt:message key="result-pages-average" /></th>
|
||||
<th><fmt:message key="result-pages-last" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<h4 class="pull-left"><fmt:message key="result-urls" /></h4>
|
||||
</div>
|
||||
<div class="app-container dataTables_wrapper">
|
||||
<table id="url"
|
||||
class="table table-striped table-bordered bootstrap-datatable datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><fmt:message key="result-url-url" /></th>
|
||||
<th><fmt:message key="result-url-script" /></th>
|
||||
<th><fmt:message key="result-url-successful" /></th>
|
||||
<th><fmt:message key="result-url-total" /></th>
|
||||
<th>details</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<!-- <div class="app-container" id="url-distribution"></div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal hide fade" id="add-graph-modal">
|
||||
<div class="modal-header">
|
||||
<button type="button" id="myModal-close" class="close"
|
||||
data-dismiss="modal">x</button>
|
||||
<h3>
|
||||
<fmt:message key="result-addGraph" />
|
||||
</h3>
|
||||
</div>
|
||||
<div class="modal-body" id="add-graph-list"></div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" id="add-graph-add"
|
||||
data-dismiss="modal">
|
||||
<fmt:message key="add" />
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">
|
||||
<fmt:message key="cancel" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal hide fade" id="del-graph-modal">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">x</button>
|
||||
<h3>
|
||||
<fmt:message key="result-deleteGraph" />
|
||||
</h3>
|
||||
</div>
|
||||
<div class="modal-body" id="del-graph-list"></div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" id="del-graph-del"
|
||||
data-dismiss="modal">
|
||||
<fmt:message key="delete" />
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">
|
||||
<fmt:message key="cancel" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal hide fade" id="load">
|
||||
<div class="modal-header">
|
||||
|
||||
<h3>Please wait,loading result data...</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="loading">
|
||||
<div></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" id="cancelLoading" class="btn btn-primary ">cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<jsp:include page="publiccontrol/footer.jsp"></jsp:include>
|
||||
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
|
||||
<script src="lib/jqueryi18n/jquery.i18n.properties-1.0.9.js"></script>
|
||||
<script src="lib/bootstrap/js/bootstrap-modal.js"></script>
|
||||
<script
|
||||
src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.4/jquery-ui.min.js"></script>
|
||||
<script
|
||||
src="http://ajax.aspnetcdn.com/ajax/bootstrap/2.3.1/bootstrap.min.js"></script>
|
||||
<script src="lib/chrisma/js/jquery.cookie.js"></script>
|
||||
<script
|
||||
src='http://cdn.datatables.net/1.10.0/js/jquery.dataTables.min.js'></script>
|
||||
<script src="lib/chrisma/js/theme.js"></script>
|
||||
<script src="lib/chrisma/js/jquery.cookie.js"></script>
|
||||
<script src="script/base.js"></script>
|
||||
<script src="http://code.highcharts.com/highcharts.js"></script>
|
||||
<script src="script/testResult/charts.js"></script>
|
||||
<script src="script/Share/TestStatusMap.js"></script>
|
||||
<script src="script/testResult/testBriefResult.js"></script>
|
||||
<script src="script/bench4q.table.js"></script>
|
||||
<script src="script/testResult/highChartTheme.js"></script>
|
||||
<script src="script/testResult/tree.js"></script>
|
||||
<script src="lib/HashMap/HashMap.js"></script>
|
||||
<script src="script/testResult/graphSelectorTree.js"></script>
|
||||
<script src="script/testResult/graphSelector.js"></script>
|
||||
<script src="script/testResult/pieChart.js"></script>
|
||||
<script src="script/testResult/loadProgress.js"></script>
|
||||
<script src="script/testResult/pageResult.js"></script>
|
||||
<script src="script/testResult/behaviorResult.js"></script>
|
||||
<script src="script/testResult/resultNew.js"></script>
|
||||
</fmt:bundle>
|
||||
</body>
|
||||
</html>
|
|
@ -1,76 +1,76 @@
|
|||
var ContainerFactory = function() {
|
||||
};
|
||||
ContainerFactory.prototype.createEditorContainer = function(header, id,
|
||||
containerInfo) {
|
||||
|
||||
var container = document.createElement("div");
|
||||
$(container).addClass("containerBox");
|
||||
if (id != null) {
|
||||
$(container).attr("id", id);
|
||||
}
|
||||
var containerHeader = document.createElement("p");
|
||||
$(containerHeader).addClass("containerHeader");
|
||||
$(containerHeader).append(document.createTextNode(header));
|
||||
$(container).append(containerHeader);
|
||||
|
||||
for ( var i = 0; i < containerInfo.length; i++) {
|
||||
|
||||
if (containerInfo[i].label == null) {
|
||||
containerInfo[i].label = "";
|
||||
}
|
||||
if (containerInfo[i].name == null) {
|
||||
containerInfo[i].name == "";
|
||||
}
|
||||
if (containerInfo[i].children == null) {
|
||||
|
||||
this.appendEdtiors(container, containerInfo[i].label,
|
||||
containerInfo[i].nameCN, containerInfo[i].name,
|
||||
containerInfo[i].paramTypeModel);
|
||||
} else {
|
||||
$(container).append(
|
||||
|
||||
this.createEditorContainer(containerInfo[i].nameCN, null,
|
||||
containerInfo[i].children));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return container;
|
||||
|
||||
};
|
||||
|
||||
ContainerFactory.prototype.appendEdtiors = function(container, label, name, id,
|
||||
editorInfo, value) {
|
||||
|
||||
var editorFactory = new EditorFactory();
|
||||
|
||||
if (editorInfo.type.toLowerCase() == "field") {
|
||||
$(container).append(
|
||||
editorFactory.createField(label, name, editorInfo.size, id,value));
|
||||
|
||||
} else if (editorInfo.type.toLowerCase() == "nfield") {
|
||||
$(container).append(
|
||||
editorFactory
|
||||
.createMultiField(label, name, editorInfo.size, id,value));
|
||||
} else if (editorInfo.type.toLowerCase() == "table") {
|
||||
$(container).append(
|
||||
editorFactory.createTable(label, name, editorInfo.cols, id,value));
|
||||
|
||||
} else if (editorInfo.type.toLowerCase() == "file") {
|
||||
$(container).append(
|
||||
editorFactory.createFile(lable, name, editorInfo.size, id,value));
|
||||
} else if (editorInfo.type.toLowerCase() == "date") {
|
||||
$(container).append(
|
||||
editorFactory.createDate(label, name, editorInfo.size, id,value));
|
||||
} else if (editorInfo.type.toLowerCase() == "select") {
|
||||
$(container).append(
|
||||
editorFactory.createSelect(label, name, editorInfo.size,
|
||||
editorInfo.options, id,value));
|
||||
} else if (editorInfo.type.toLowerCase() == "checkbox") {
|
||||
$(container).append(
|
||||
editorFactory.createCheckBox(label, name,
|
||||
editorInfo.choiceModels, id,value));
|
||||
} else {
|
||||
alert("no such editor type:" + editorInfo.type);
|
||||
}
|
||||
};
|
||||
var ContainerFactory = function() {
|
||||
};
|
||||
ContainerFactory.prototype.createEditorContainer = function(header, id,
|
||||
containerInfo) {
|
||||
|
||||
var container = document.createElement("div");
|
||||
$(container).addClass("containerBox");
|
||||
if (id != null) {
|
||||
$(container).attr("id", id);
|
||||
}
|
||||
var containerHeader = document.createElement("p");
|
||||
$(containerHeader).addClass("containerHeader");
|
||||
$(containerHeader).append(document.createTextNode(header));
|
||||
$(container).append(containerHeader);
|
||||
|
||||
for ( var i = 0; i < containerInfo.length; i++) {
|
||||
|
||||
if (containerInfo[i].label == null) {
|
||||
containerInfo[i].label = "";
|
||||
}
|
||||
if (containerInfo[i].name == null) {
|
||||
containerInfo[i].name == "";
|
||||
}
|
||||
if (containerInfo[i].children == null) {
|
||||
|
||||
this.appendEdtiors(container, containerInfo[i].label,
|
||||
containerInfo[i].nameCN, containerInfo[i].name,
|
||||
containerInfo[i].paramTypeModel);
|
||||
} else {
|
||||
$(container).append(
|
||||
|
||||
this.createEditorContainer(containerInfo[i].nameCN, null,
|
||||
containerInfo[i].children));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return container;
|
||||
|
||||
};
|
||||
|
||||
ContainerFactory.prototype.appendEdtiors = function(container, label, name, id,
|
||||
editorInfo, value) {
|
||||
|
||||
var editorFactory = new EditorFactory();
|
||||
|
||||
if (editorInfo.type.toLowerCase() == "field") {
|
||||
$(container).append(
|
||||
editorFactory.createField(label, name, editorInfo.size, id,value));
|
||||
|
||||
} else if (editorInfo.type.toLowerCase() == "nfield") {
|
||||
$(container).append(
|
||||
editorFactory
|
||||
.createMultiField(label, name, editorInfo.size, id,value));
|
||||
} else if (editorInfo.type.toLowerCase() == "table") {
|
||||
$(container).append(
|
||||
editorFactory.createTable(label, name, editorInfo.cols, id,value));
|
||||
|
||||
} else if (editorInfo.type.toLowerCase() == "file") {
|
||||
$(container).append(
|
||||
editorFactory.createFile(lable, name, editorInfo.size, id,value));
|
||||
} else if (editorInfo.type.toLowerCase() == "date") {
|
||||
$(container).append(
|
||||
editorFactory.createDate(label, name, editorInfo.size, id,value));
|
||||
} else if (editorInfo.type.toLowerCase() == "select") {
|
||||
$(container).append(
|
||||
editorFactory.createSelect(label, name, editorInfo.size,
|
||||
editorInfo.options, id,value));
|
||||
} else if (editorInfo.type.toLowerCase() == "checkbox") {
|
||||
$(container).append(
|
||||
editorFactory.createCheckBox(label, name,
|
||||
editorInfo.choiceModels, id,value));
|
||||
} else {
|
||||
alert("no such editor type:" + editorInfo.type);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,161 +1,161 @@
|
|||
var Parameter = function(key, value) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
}
|
||||
var DataCollector = function() {
|
||||
};
|
||||
DataCollector.prototype.validate = function(value) {
|
||||
if (value == null || value == "") {
|
||||
alert($.i18n.prop('dataCollect-input'));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
DataCollector.prototype.checkBoxData = function(editor) {
|
||||
var name = editor.attr("id");
|
||||
var choice = editor.find("input[type='checkbox']");
|
||||
var value = choice.is(':checked');
|
||||
|
||||
return new Parameter(name, value);
|
||||
}
|
||||
|
||||
DataCollector.prototype.fieldData = function(editor) {
|
||||
var name = $(editor).attr("id");
|
||||
editor = $(editor.children('.field'));
|
||||
var value = editor.children("input").val();
|
||||
// if (!this.validate(value)) {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
return new Parameter(name, value);
|
||||
};
|
||||
DataCollector.prototype.dateData = function(editor) {
|
||||
var name = editor.attr("id");
|
||||
var value = editor.children("input").val();
|
||||
// if (!this.validate(value)) {
|
||||
// return false;
|
||||
// }
|
||||
return new Parameter(name, value);
|
||||
};
|
||||
DataCollector.prototype.multiFieldData = function(editor) {
|
||||
var editorArray = editor.children(".field");
|
||||
if (editorArray.size == 0) {
|
||||
alert($.i18n.prop('dataCollect-input'));
|
||||
return;
|
||||
|
||||
}
|
||||
var name = editor.attr("id")
|
||||
var value = "";
|
||||
|
||||
for ( var i = 0; i < editorArray.length; i++) {
|
||||
var fieldValue = $(editorArray[i]).children("input").val();
|
||||
if (fieldValue == "") {
|
||||
continue;
|
||||
}
|
||||
|
||||
value += fieldValue + ";";
|
||||
}
|
||||
value = value.substring(0, value.length - 1);
|
||||
// if (!this.validate(value)) {
|
||||
// return false;
|
||||
// }
|
||||
return new Parameter(name, value);
|
||||
|
||||
};
|
||||
|
||||
DataCollector.prototype.tableData = function(editor) {
|
||||
var thArray = editor.find("thead").children("th");
|
||||
var editorArray = editor.find("tbody").children("tr");
|
||||
var name = editor.attr("id");
|
||||
var value = "";
|
||||
for ( var i = 0; i < editorArray.length; i++) {
|
||||
var tdArray = $(editorArray[i]).children("td");
|
||||
var trValue = "";
|
||||
for ( var j = 1; j < tdArray.length; j++) {
|
||||
if ($(tdArray[j]).children("input").val() == undefined
|
||||
|| $(tdArray[j]).children("input").val() == "") {
|
||||
continue;
|
||||
}
|
||||
trValue += thArray[j] + "=" + $(tdArray[j]).children("input").val()
|
||||
+ "|";
|
||||
|
||||
}
|
||||
trValue = trValue.substring(0, trValue.length - 1);
|
||||
value += trValue + ";";
|
||||
}
|
||||
value = value.substring(0, value.length - 1);
|
||||
// if (!this.validate(value)) {
|
||||
// return false;
|
||||
// }
|
||||
return new Parameter(name, value);
|
||||
|
||||
};
|
||||
DataCollector.prototype.selectData = function(editor) {
|
||||
var name = editor.attr("id");
|
||||
var value = editor.children("select").val();
|
||||
// if (!this.validate(value)) {
|
||||
// return false;
|
||||
// }
|
||||
return new Parameter(name, value);
|
||||
};
|
||||
|
||||
DataCollector.prototype.getUnitParams = function(paramEditors) {
|
||||
var params = new Array();
|
||||
for ( var i = 0; i < paramEditors.length; i++) {
|
||||
var editor = $(paramEditors[i]);
|
||||
var editorType = editor.attr("editorType");
|
||||
var data;
|
||||
if (editorType == "field") {
|
||||
data = this.fieldData(editor);
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
||||
params.push(data);
|
||||
} else if (editorType == "date") {
|
||||
data = this.dateData(editor);
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
||||
params.push(data);
|
||||
} else if (editorType == "multiField") {
|
||||
data = this.multiFieldData(editor)
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
||||
params.push(data);
|
||||
} else if (editorType == "table") {
|
||||
data = this.tableData(editor);
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
params.push(data);
|
||||
} else if (editorType == "select") {
|
||||
data = this.selectData(editor);
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
params.push(data);
|
||||
} else if (editorType == "checkBox") {
|
||||
data = this.checkBoxData(editor);
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
params.push(data);
|
||||
} else {
|
||||
alert($.i18n.prop('dataCollect-errorType'));
|
||||
}
|
||||
|
||||
}
|
||||
return params;
|
||||
};
|
||||
|
||||
var UsePluginModel = function(id, name, parameters) {
|
||||
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.parameters = parameters;
|
||||
}
|
||||
var Parameter = function(key, value) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
}
|
||||
var DataCollector = function() {
|
||||
};
|
||||
DataCollector.prototype.validate = function(value) {
|
||||
if (value == null || value == "") {
|
||||
alert($.i18n.prop('dataCollect-input'));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
DataCollector.prototype.checkBoxData = function(editor) {
|
||||
var name = editor.attr("id");
|
||||
var choice = editor.find("input[type='checkbox']");
|
||||
var value = choice.is(':checked');
|
||||
|
||||
return new Parameter(name, value);
|
||||
}
|
||||
|
||||
DataCollector.prototype.fieldData = function(editor) {
|
||||
var name = $(editor).attr("id");
|
||||
editor = $(editor.children('.field'));
|
||||
var value = editor.children("input").val();
|
||||
// if (!this.validate(value)) {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
return new Parameter(name, value);
|
||||
};
|
||||
DataCollector.prototype.dateData = function(editor) {
|
||||
var name = editor.attr("id");
|
||||
var value = editor.children("input").val();
|
||||
// if (!this.validate(value)) {
|
||||
// return false;
|
||||
// }
|
||||
return new Parameter(name, value);
|
||||
};
|
||||
DataCollector.prototype.multiFieldData = function(editor) {
|
||||
var editorArray = editor.children(".field");
|
||||
if (editorArray.size == 0) {
|
||||
alert($.i18n.prop('dataCollect-input'));
|
||||
return;
|
||||
|
||||
}
|
||||
var name = editor.attr("id")
|
||||
var value = "";
|
||||
|
||||
for ( var i = 0; i < editorArray.length; i++) {
|
||||
var fieldValue = $(editorArray[i]).children("input").val();
|
||||
if (fieldValue == "") {
|
||||
continue;
|
||||
}
|
||||
|
||||
value += fieldValue + ";";
|
||||
}
|
||||
value = value.substring(0, value.length - 1);
|
||||
// if (!this.validate(value)) {
|
||||
// return false;
|
||||
// }
|
||||
return new Parameter(name, value);
|
||||
|
||||
};
|
||||
|
||||
DataCollector.prototype.tableData = function(editor) {
|
||||
var thArray = editor.find("thead").children("th");
|
||||
var editorArray = editor.find("tbody").children("tr");
|
||||
var name = editor.attr("id");
|
||||
var value = "";
|
||||
for ( var i = 0; i < editorArray.length; i++) {
|
||||
var tdArray = $(editorArray[i]).children("td");
|
||||
var trValue = "";
|
||||
for ( var j = 1; j < tdArray.length; j++) {
|
||||
if ($(tdArray[j]).children("input").val() == undefined
|
||||
|| $(tdArray[j]).children("input").val() == "") {
|
||||
continue;
|
||||
}
|
||||
trValue += thArray[j] + "=" + $(tdArray[j]).children("input").val()
|
||||
+ "|";
|
||||
|
||||
}
|
||||
trValue = trValue.substring(0, trValue.length - 1);
|
||||
value += trValue + ";";
|
||||
}
|
||||
value = value.substring(0, value.length - 1);
|
||||
// if (!this.validate(value)) {
|
||||
// return false;
|
||||
// }
|
||||
return new Parameter(name, value);
|
||||
|
||||
};
|
||||
DataCollector.prototype.selectData = function(editor) {
|
||||
var name = editor.attr("id");
|
||||
var value = editor.children("select").val();
|
||||
// if (!this.validate(value)) {
|
||||
// return false;
|
||||
// }
|
||||
return new Parameter(name, value);
|
||||
};
|
||||
|
||||
DataCollector.prototype.getUnitParams = function(paramEditors) {
|
||||
var params = new Array();
|
||||
for ( var i = 0; i < paramEditors.length; i++) {
|
||||
var editor = $(paramEditors[i]);
|
||||
var editorType = editor.attr("editorType");
|
||||
var data;
|
||||
if (editorType == "field") {
|
||||
data = this.fieldData(editor);
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
||||
params.push(data);
|
||||
} else if (editorType == "date") {
|
||||
data = this.dateData(editor);
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
||||
params.push(data);
|
||||
} else if (editorType == "multiField") {
|
||||
data = this.multiFieldData(editor)
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
||||
params.push(data);
|
||||
} else if (editorType == "table") {
|
||||
data = this.tableData(editor);
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
params.push(data);
|
||||
} else if (editorType == "select") {
|
||||
data = this.selectData(editor);
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
params.push(data);
|
||||
} else if (editorType == "checkBox") {
|
||||
data = this.checkBoxData(editor);
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
params.push(data);
|
||||
} else {
|
||||
alert($.i18n.prop('dataCollect-errorType'));
|
||||
}
|
||||
|
||||
}
|
||||
return params;
|
||||
};
|
||||
|
||||
var UsePluginModel = function(id, name, parameters) {
|
||||
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.parameters = parameters;
|
||||
}
|
||||
|
|
|
@ -1,274 +1,274 @@
|
|||
var EditorFactory = function() {
|
||||
};
|
||||
|
||||
EditorFactory.prototype.createBaseEditor = function(label, id) {
|
||||
if (label == null) {
|
||||
label = "";
|
||||
}
|
||||
var containerBox = document.createElement("div");
|
||||
$(containerBox).addClass("containerBox");
|
||||
var boxHeader = document.createElement("div");
|
||||
var p = document.createElement("p")
|
||||
$(p).html(label)
|
||||
$(boxHeader).append(p);
|
||||
$(boxHeader).addClass("containerHeader")
|
||||
$(containerBox).append(boxHeader);
|
||||
var boxBody = document.createElement("div");
|
||||
$(boxBody).addClass("editor");
|
||||
$(boxBody).attr("id", id);
|
||||
$(containerBox).append(boxBody);
|
||||
return containerBox;
|
||||
}
|
||||
EditorFactory.prototype.createCheckBox = function(label, name, choices, id,value) {
|
||||
var div = this.createBaseEditor(label, id);
|
||||
$(div).children(".editor").attr("editorType", "checkBox");
|
||||
for ( var i = 0; i < choices.length; i++) {
|
||||
var choice = this.createChoice(choices[i].value,
|
||||
choices[i].defaultValue, name);
|
||||
$(div).children(".editor").append(choice);
|
||||
}
|
||||
return div;
|
||||
|
||||
}
|
||||
EditorFactory.prototype.createChoice = function(value, defaultValue, name,value) {
|
||||
|
||||
var div = document.createElement("div");
|
||||
|
||||
var input = document.createElement("input");
|
||||
$(input).attr("type", "checkbox");
|
||||
$(input).attr("name", name);
|
||||
if (defaultValue) {
|
||||
$(input).attr("checked", "checked");
|
||||
}
|
||||
|
||||
$(div).append(input);
|
||||
var label = document.createElement("label");
|
||||
$(label).html(value);
|
||||
$(div).append(label);
|
||||
return div;
|
||||
}
|
||||
|
||||
EditorFactory.prototype.createField = function(label, name, size, id, value) {
|
||||
var div = this.createBaseEditor(label, id);
|
||||
$(div).children(".editor").attr("editorType", "field");
|
||||
$(div).children(".editor").append(this.createFieldLine(size, name, value));
|
||||
return div;
|
||||
}
|
||||
|
||||
EditorFactory.prototype.createMultiField = function(label, name, size, id,
|
||||
value) {
|
||||
var div = this.createBaseEditor(label, id);
|
||||
$(div).children(".editor").attr("editorType", "multiField");
|
||||
var values = value.split(";");
|
||||
for ( var i = 0; i < values / length; i++) {
|
||||
$(div).children(".editor").append(
|
||||
this.createFieldLine(size, name, values[i]));
|
||||
}
|
||||
|
||||
var editorFactory = this;
|
||||
var addFieldButton = document.createElement("button");
|
||||
$(addFieldButton).html("add")
|
||||
$(addFieldButton).attr("type", "submit");
|
||||
$(addFieldButton).click(
|
||||
{
|
||||
editorFactory : editorFactory
|
||||
},
|
||||
function(event) {
|
||||
event.preventDefault()
|
||||
$(event.data.editorFactory.createFieldLine(size, name))
|
||||
.insertBefore($(this));
|
||||
});
|
||||
var removeFieldButton = document.createElement("button");
|
||||
$(removeFieldButton).html("remove")
|
||||
$(removeFieldButton).attr("type", "submit");
|
||||
$(removeFieldButton).click(function(event) {
|
||||
event.preventDefault();
|
||||
$(this).parent().children(".field").last().remove();
|
||||
|
||||
});
|
||||
$(div).children(".editor").append(addFieldButton).append(removeFieldButton);
|
||||
return div;
|
||||
}
|
||||
|
||||
EditorFactory.prototype.createFieldLine = function(size, name, value) {
|
||||
size = 150;
|
||||
var fieldDiv = document.createElement("div");
|
||||
$(fieldDiv).addClass("field");
|
||||
var fieldName = document.createElement("label");
|
||||
$(fieldName).html(name);
|
||||
var field = document.createElement("input");
|
||||
$(field).attr("type", "text");
|
||||
$(field).val(value);
|
||||
$(fieldDiv).append(fieldName.outerHTML + field.outerHTML);
|
||||
return fieldDiv;
|
||||
}
|
||||
EditorFactory.prototype.createFile = function(label, name, size, id,value) {
|
||||
if (size == null || size <= 0) {
|
||||
size = 150;
|
||||
}
|
||||
|
||||
var div = this.createBaseEditor(label, id);
|
||||
$(div).children(".editor").attr("editorType", "file");
|
||||
var fileEditor = document.createElement("div");
|
||||
|
||||
var fieldName = document.createElement("label");
|
||||
$(fieldName).html(name);
|
||||
var file = document.createElement("input");
|
||||
$(file).attr("type", "file");
|
||||
$(fileEditor).append(fieldName.outerHTML + file.outerHTML);
|
||||
$(div).children(".editor").append(fileEditor);
|
||||
return div;
|
||||
|
||||
}
|
||||
|
||||
EditorFactory.prototype.createTable = function(label, name, cols, id, value) {
|
||||
var values = value.split(";");
|
||||
var div = this.createBaseEditor(label, id);
|
||||
$(div).children(".editor").attr("editorType", "table");
|
||||
var headers = getHeaders(cols);
|
||||
|
||||
$(div).children(".editor").append(
|
||||
createTable(cols, name, headers, values));
|
||||
|
||||
|
||||
var addButton = document.createElement("button");
|
||||
$(addButton).html("add");
|
||||
$(addButton).click(
|
||||
{
|
||||
headers : headers,
|
||||
fieldName : name
|
||||
},
|
||||
function(event) {
|
||||
event.preventDefault();
|
||||
$(this).parent().children("table").children("tbody").append(
|
||||
createTr(event.data.headers, event.data.fieldName));
|
||||
});
|
||||
var deleteButton = document.createElement("button");
|
||||
$(deleteButton).html("remove");
|
||||
$(deleteButton).click(
|
||||
function(event) {
|
||||
event.preventDefault();
|
||||
$(this).parent().children("table").children("tbody").children(
|
||||
"tr").last().remove();
|
||||
});
|
||||
$(div).children(".editor").append(addButton);
|
||||
$(div).children(".editor").append(deleteButton);
|
||||
return div;
|
||||
|
||||
function getHeaders(col) {
|
||||
var headers = new Array();
|
||||
headers.push("name:");
|
||||
var cols = col.split(";");
|
||||
for ( var i = 0; i < cols.length; i++) {
|
||||
headers.push(cols[i]);
|
||||
}
|
||||
|
||||
return headers;
|
||||
}
|
||||
|
||||
function createTable(cols, name, headers, values) {
|
||||
var values = value.split(";");
|
||||
var table = document.createElement("table");
|
||||
var thead = document.createElement("thead");
|
||||
var tbody = document.createElement("tbody");
|
||||
$(thead).append(createHeader(headers));
|
||||
for(var i=0;i<values.length;i++){
|
||||
$(tbody).append(createTr(headers, name,values[i]));
|
||||
}
|
||||
|
||||
|
||||
$(table).append(thead);
|
||||
$(table).append(tbody);
|
||||
return table;
|
||||
}
|
||||
|
||||
function createHeader(headers) {
|
||||
|
||||
var tr = document.createElement("tr");
|
||||
for ( var i = 0; i < headers.length; i++) {
|
||||
var th = document.createElement("th");
|
||||
$(th).append(document.createTextNode(headers[i]));
|
||||
$(th).attr("style", "width:" + 100 / headers.length + "%")
|
||||
$(tr).append(th);
|
||||
|
||||
}
|
||||
return tr;
|
||||
}
|
||||
function createTr(headers, name,value) {
|
||||
var values=value.split("|");
|
||||
var tr = document.createElement("tr");
|
||||
var td = document.createElement("td");
|
||||
$(td).attr("style", "width:" + 100 / headers.length + "%")
|
||||
$(td).html(name);
|
||||
$(tr).append(td);
|
||||
for ( var i = 1; i < headers.length; i++) {
|
||||
var input = document.createElement("input");
|
||||
$(input).attr("type", "text");
|
||||
$(input).val(values[i]);
|
||||
var td = document.createElement("td");
|
||||
$(td).attr("style", "width:" + 100 / headers.length + "%")
|
||||
$(td).append(input);
|
||||
$(tr).append(td);
|
||||
}
|
||||
return tr;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
EditorFactory.prototype.createSelect = function(label, name, size, options, id,value) {
|
||||
|
||||
if (size == null || size <= 0) {
|
||||
size = 150;
|
||||
}
|
||||
if (options == null || options.length <= 0) {
|
||||
alert("no options in:" + name);
|
||||
}
|
||||
|
||||
var div = this.createBaseEditor(label, id);
|
||||
$(div).children(".editor").attr("editorType", "select");
|
||||
var nameLabel = document.createElement("label");
|
||||
$(nameLabel).html(name);
|
||||
$(div).children(".editor").append(nameLabel);
|
||||
var select = document.createElement("select");
|
||||
$(select).attr("style", "width:" + size + "px");
|
||||
for ( var i = 0; i < options.length; i++) {
|
||||
var option = document.createElement("option");
|
||||
$(option).attr("value", options[i]);
|
||||
$(option).html(options[i]);
|
||||
$(select).append(option);
|
||||
}
|
||||
$(div).children(".editor").append(select);
|
||||
return div;
|
||||
}
|
||||
EditorFactory.prototype.createDate = function(label, name, size, id,value) {
|
||||
|
||||
if (size == null || size < 0) {
|
||||
size = 150
|
||||
}
|
||||
var div = this.createBaseEditor(label, id);
|
||||
$(div).children(".editor").attr("editorType", "date");
|
||||
var dateLabel = document.createElement("label");
|
||||
$(dateLabel).html(name);
|
||||
var date = document.createElement("input");
|
||||
$(date).attr("type", "date");
|
||||
$(div).children(".editor").append(dateLabel);
|
||||
$(div).children(".editor").append(date);
|
||||
return div;
|
||||
}
|
||||
function createContainer(id, name) {
|
||||
|
||||
var edtiorFactory = new EditorFactory();
|
||||
var div = document.createElement("div");
|
||||
$(div).attr("id", id);
|
||||
$(div).append(edtiorFactory.createMultiField("test", "name", 150, "test"));
|
||||
$(div).append(edtiorFactory.createFile("file", "file name", 150, "file"));
|
||||
$(div).append(
|
||||
edtiorFactory.createField("field", "field name", 150, "field"));
|
||||
$(div).append(
|
||||
edtiorFactory.createTable("table", "input", "td1;td1;td3", "id"));
|
||||
$(div).append(
|
||||
edtiorFactory.createSelect("select", "select", 150, [ 1, 2, 3 ],
|
||||
"oo"));
|
||||
$(div).append(edtiorFactory.createDate("date", "date", 150, "dateid"));
|
||||
return div;
|
||||
}
|
||||
var EditorFactory = function() {
|
||||
};
|
||||
|
||||
EditorFactory.prototype.createBaseEditor = function(label, id) {
|
||||
if (label == null) {
|
||||
label = "";
|
||||
}
|
||||
var containerBox = document.createElement("div");
|
||||
$(containerBox).addClass("containerBox");
|
||||
var boxHeader = document.createElement("div");
|
||||
var p = document.createElement("p")
|
||||
$(p).html(label)
|
||||
$(boxHeader).append(p);
|
||||
$(boxHeader).addClass("containerHeader")
|
||||
$(containerBox).append(boxHeader);
|
||||
var boxBody = document.createElement("div");
|
||||
$(boxBody).addClass("editor");
|
||||
$(boxBody).attr("id", id);
|
||||
$(containerBox).append(boxBody);
|
||||
return containerBox;
|
||||
}
|
||||
EditorFactory.prototype.createCheckBox = function(label, name, choices, id,value) {
|
||||
var div = this.createBaseEditor(label, id);
|
||||
$(div).children(".editor").attr("editorType", "checkBox");
|
||||
for ( var i = 0; i < choices.length; i++) {
|
||||
var choice = this.createChoice(choices[i].value,
|
||||
choices[i].defaultValue, name);
|
||||
$(div).children(".editor").append(choice);
|
||||
}
|
||||
return div;
|
||||
|
||||
}
|
||||
EditorFactory.prototype.createChoice = function(value, defaultValue, name,value) {
|
||||
|
||||
var div = document.createElement("div");
|
||||
|
||||
var input = document.createElement("input");
|
||||
$(input).attr("type", "checkbox");
|
||||
$(input).attr("name", name);
|
||||
if (defaultValue) {
|
||||
$(input).attr("checked", "checked");
|
||||
}
|
||||
|
||||
$(div).append(input);
|
||||
var label = document.createElement("label");
|
||||
$(label).html(value);
|
||||
$(div).append(label);
|
||||
return div;
|
||||
}
|
||||
|
||||
EditorFactory.prototype.createField = function(label, name, size, id, value) {
|
||||
var div = this.createBaseEditor(label, id);
|
||||
$(div).children(".editor").attr("editorType", "field");
|
||||
$(div).children(".editor").append(this.createFieldLine(size, name, value));
|
||||
return div;
|
||||
}
|
||||
|
||||
EditorFactory.prototype.createMultiField = function(label, name, size, id,
|
||||
value) {
|
||||
var div = this.createBaseEditor(label, id);
|
||||
$(div).children(".editor").attr("editorType", "multiField");
|
||||
var values = value.split(";");
|
||||
for ( var i = 0; i < values / length; i++) {
|
||||
$(div).children(".editor").append(
|
||||
this.createFieldLine(size, name, values[i]));
|
||||
}
|
||||
|
||||
var editorFactory = this;
|
||||
var addFieldButton = document.createElement("button");
|
||||
$(addFieldButton).html("add")
|
||||
$(addFieldButton).attr("type", "submit");
|
||||
$(addFieldButton).click(
|
||||
{
|
||||
editorFactory : editorFactory
|
||||
},
|
||||
function(event) {
|
||||
event.preventDefault()
|
||||
$(event.data.editorFactory.createFieldLine(size, name))
|
||||
.insertBefore($(this));
|
||||
});
|
||||
var removeFieldButton = document.createElement("button");
|
||||
$(removeFieldButton).html("remove")
|
||||
$(removeFieldButton).attr("type", "submit");
|
||||
$(removeFieldButton).click(function(event) {
|
||||
event.preventDefault();
|
||||
$(this).parent().children(".field").last().remove();
|
||||
|
||||
});
|
||||
$(div).children(".editor").append(addFieldButton).append(removeFieldButton);
|
||||
return div;
|
||||
}
|
||||
|
||||
EditorFactory.prototype.createFieldLine = function(size, name, value) {
|
||||
size = 150;
|
||||
var fieldDiv = document.createElement("div");
|
||||
$(fieldDiv).addClass("field");
|
||||
var fieldName = document.createElement("label");
|
||||
$(fieldName).html(name);
|
||||
var field = document.createElement("input");
|
||||
$(field).attr("type", "text");
|
||||
$(field).val(value);
|
||||
$(fieldDiv).append(fieldName.outerHTML + field.outerHTML);
|
||||
return fieldDiv;
|
||||
}
|
||||
EditorFactory.prototype.createFile = function(label, name, size, id,value) {
|
||||
if (size == null || size <= 0) {
|
||||
size = 150;
|
||||
}
|
||||
|
||||
var div = this.createBaseEditor(label, id);
|
||||
$(div).children(".editor").attr("editorType", "file");
|
||||
var fileEditor = document.createElement("div");
|
||||
|
||||
var fieldName = document.createElement("label");
|
||||
$(fieldName).html(name);
|
||||
var file = document.createElement("input");
|
||||
$(file).attr("type", "file");
|
||||
$(fileEditor).append(fieldName.outerHTML + file.outerHTML);
|
||||
$(div).children(".editor").append(fileEditor);
|
||||
return div;
|
||||
|
||||
}
|
||||
|
||||
EditorFactory.prototype.createTable = function(label, name, cols, id, value) {
|
||||
var values = value.split(";");
|
||||
var div = this.createBaseEditor(label, id);
|
||||
$(div).children(".editor").attr("editorType", "table");
|
||||
var headers = getHeaders(cols);
|
||||
|
||||
$(div).children(".editor").append(
|
||||
createTable(cols, name, headers, values));
|
||||
|
||||
|
||||
var addButton = document.createElement("button");
|
||||
$(addButton).html("add");
|
||||
$(addButton).click(
|
||||
{
|
||||
headers : headers,
|
||||
fieldName : name
|
||||
},
|
||||
function(event) {
|
||||
event.preventDefault();
|
||||
$(this).parent().children("table").children("tbody").append(
|
||||
createTr(event.data.headers, event.data.fieldName));
|
||||
});
|
||||
var deleteButton = document.createElement("button");
|
||||
$(deleteButton).html("remove");
|
||||
$(deleteButton).click(
|
||||
function(event) {
|
||||
event.preventDefault();
|
||||
$(this).parent().children("table").children("tbody").children(
|
||||
"tr").last().remove();
|
||||
});
|
||||
$(div).children(".editor").append(addButton);
|
||||
$(div).children(".editor").append(deleteButton);
|
||||
return div;
|
||||
|
||||
function getHeaders(col) {
|
||||
var headers = new Array();
|
||||
headers.push("name:");
|
||||
var cols = col.split(";");
|
||||
for ( var i = 0; i < cols.length; i++) {
|
||||
headers.push(cols[i]);
|
||||
}
|
||||
|
||||
return headers;
|
||||
}
|
||||
|
||||
function createTable(cols, name, headers, values) {
|
||||
var values = value.split(";");
|
||||
var table = document.createElement("table");
|
||||
var thead = document.createElement("thead");
|
||||
var tbody = document.createElement("tbody");
|
||||
$(thead).append(createHeader(headers));
|
||||
for(var i=0;i<values.length;i++){
|
||||
$(tbody).append(createTr(headers, name,values[i]));
|
||||
}
|
||||
|
||||
|
||||
$(table).append(thead);
|
||||
$(table).append(tbody);
|
||||
return table;
|
||||
}
|
||||
|
||||
function createHeader(headers) {
|
||||
|
||||
var tr = document.createElement("tr");
|
||||
for ( var i = 0; i < headers.length; i++) {
|
||||
var th = document.createElement("th");
|
||||
$(th).append(document.createTextNode(headers[i]));
|
||||
$(th).attr("style", "width:" + 100 / headers.length + "%")
|
||||
$(tr).append(th);
|
||||
|
||||
}
|
||||
return tr;
|
||||
}
|
||||
function createTr(headers, name,value) {
|
||||
var values=value.split("|");
|
||||
var tr = document.createElement("tr");
|
||||
var td = document.createElement("td");
|
||||
$(td).attr("style", "width:" + 100 / headers.length + "%")
|
||||
$(td).html(name);
|
||||
$(tr).append(td);
|
||||
for ( var i = 1; i < headers.length; i++) {
|
||||
var input = document.createElement("input");
|
||||
$(input).attr("type", "text");
|
||||
$(input).val(values[i]);
|
||||
var td = document.createElement("td");
|
||||
$(td).attr("style", "width:" + 100 / headers.length + "%")
|
||||
$(td).append(input);
|
||||
$(tr).append(td);
|
||||
}
|
||||
return tr;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
EditorFactory.prototype.createSelect = function(label, name, size, options, id,value) {
|
||||
|
||||
if (size == null || size <= 0) {
|
||||
size = 150;
|
||||
}
|
||||
if (options == null || options.length <= 0) {
|
||||
alert("no options in:" + name);
|
||||
}
|
||||
|
||||
var div = this.createBaseEditor(label, id);
|
||||
$(div).children(".editor").attr("editorType", "select");
|
||||
var nameLabel = document.createElement("label");
|
||||
$(nameLabel).html(name);
|
||||
$(div).children(".editor").append(nameLabel);
|
||||
var select = document.createElement("select");
|
||||
$(select).attr("style", "width:" + size + "px");
|
||||
for ( var i = 0; i < options.length; i++) {
|
||||
var option = document.createElement("option");
|
||||
$(option).attr("value", options[i]);
|
||||
$(option).html(options[i]);
|
||||
$(select).append(option);
|
||||
}
|
||||
$(div).children(".editor").append(select);
|
||||
return div;
|
||||
}
|
||||
EditorFactory.prototype.createDate = function(label, name, size, id,value) {
|
||||
|
||||
if (size == null || size < 0) {
|
||||
size = 150
|
||||
}
|
||||
var div = this.createBaseEditor(label, id);
|
||||
$(div).children(".editor").attr("editorType", "date");
|
||||
var dateLabel = document.createElement("label");
|
||||
$(dateLabel).html(name);
|
||||
var date = document.createElement("input");
|
||||
$(date).attr("type", "date");
|
||||
$(div).children(".editor").append(dateLabel);
|
||||
$(div).children(".editor").append(date);
|
||||
return div;
|
||||
}
|
||||
function createContainer(id, name) {
|
||||
|
||||
var edtiorFactory = new EditorFactory();
|
||||
var div = document.createElement("div");
|
||||
$(div).attr("id", id);
|
||||
$(div).append(edtiorFactory.createMultiField("test", "name", 150, "test"));
|
||||
$(div).append(edtiorFactory.createFile("file", "file name", 150, "file"));
|
||||
$(div).append(
|
||||
edtiorFactory.createField("field", "field name", 150, "field"));
|
||||
$(div).append(
|
||||
edtiorFactory.createTable("table", "input", "td1;td1;td3", "id"));
|
||||
$(div).append(
|
||||
edtiorFactory.createSelect("select", "select", 150, [ 1, 2, 3 ],
|
||||
"oo"));
|
||||
$(div).append(edtiorFactory.createDate("date", "date", 150, "dateid"));
|
||||
return div;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
$(document).ready(function() {
|
||||
var table = $("#table").DataTable();
|
||||
addEvent(table);
|
||||
loadTestPlans(table);
|
||||
});
|
||||
$(document).ready(function() {
|
||||
var table = $("#table").DataTable();
|
||||
addEvent(table);
|
||||
loadTestPlans(table);
|
||||
});
|
||||
|
|
|
@ -1,158 +1,158 @@
|
|||
var intervalTime = 5000;
|
||||
var Chart = function() {
|
||||
};
|
||||
Chart.prototype.createChart = function(container) {
|
||||
container.highcharts({
|
||||
chart : {
|
||||
type : 'spline'
|
||||
},
|
||||
tooltip : {
|
||||
formatter : function() {
|
||||
return Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x)
|
||||
+ '<br/>' + '<b>' + this.series.name + ':'
|
||||
+ '</b><br/>' + Highcharts.numberFormat(this.y, 2);
|
||||
}
|
||||
},
|
||||
});
|
||||
var chart = container.highcharts();
|
||||
chart.setTitle({
|
||||
text : ""
|
||||
});
|
||||
chart.xAxis[0].update({
|
||||
type : 'datetime',
|
||||
tickInterval : 1000 * 60,
|
||||
tickWidth : 0,
|
||||
gridLineWidth : 1,
|
||||
tickPixelInterval : 50
|
||||
});
|
||||
this.highChart = chart;
|
||||
this.modelArray = new Array();
|
||||
};
|
||||
|
||||
Chart.prototype.addAxis = function(axis, seriesId,name, data) {
|
||||
this.highChart.addAxis({ // Secondary yAxis
|
||||
id : axis,
|
||||
title : {
|
||||
text : name,
|
||||
},
|
||||
lineWidth : 2,
|
||||
opposite : true
|
||||
});
|
||||
this.addSeries(axis, seriesId, data,name);
|
||||
};
|
||||
|
||||
Chart.prototype.addSeries = function(axis, seriesId, data,name) {
|
||||
this.highChart.addSeries({
|
||||
id : seriesId,
|
||||
name : name,
|
||||
yAxis : axis,
|
||||
data : data,
|
||||
marker : {
|
||||
enabled : true,
|
||||
radius : 3
|
||||
},
|
||||
showInLegend : true
|
||||
}, true);
|
||||
};
|
||||
Chart.prototype.removeAxis = function(axisId) {
|
||||
this.highChart.get(axisId).remove();
|
||||
};
|
||||
|
||||
Chart.prototype.addPoint = function(seriesId, point) {
|
||||
if (point.y == "NaN")
|
||||
point.y = 0;
|
||||
this.highChart.get(seriesId).addPoint([ point.x, point.y ]);
|
||||
};
|
||||
Chart.prototype.addPoints = function(seriesId, data) {
|
||||
var chart = this;
|
||||
for ( var i = 0; i < data.length; i++) {
|
||||
chart.addPoint(seriesId, data[i]);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var Point = function(x, y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
};
|
||||
var PointData=function(data,time){
|
||||
this.data=data;
|
||||
this.time=time;
|
||||
}
|
||||
|
||||
Chart.prototype.getGraphDataFirstly=function(model){
|
||||
var chart=this;
|
||||
chart.addAxis(model.axis, model.series, model.name,[]);
|
||||
$.post(model.url + "/" + model.time, {}, function(data) {
|
||||
loadItems.scriptBriefStatusAve = true;
|
||||
if (data==null||!data.success) {
|
||||
return;
|
||||
}
|
||||
data = data.result;
|
||||
if (data instanceof Array) {
|
||||
for ( var i = 0; i < data.length; i++) {
|
||||
chart.addDataToGraph(chart, model, data[i]);
|
||||
}
|
||||
|
||||
} else{
|
||||
chart.addDataToGraph(chart, model, data);
|
||||
}
|
||||
|
||||
}, "json");
|
||||
|
||||
}
|
||||
|
||||
Chart.prototype.addGraph = function(model) {
|
||||
var chart = this;
|
||||
this.getGraphDataFirstly(model,chart);
|
||||
var intervalId = setInterval(function() {
|
||||
$.post(model.url + "/" + model.time, {}, function(data) {
|
||||
loadItems.scriptBriefStatusAve = true;// this need to change
|
||||
if (data==null||!data.success) {
|
||||
clearInterval(intervalId);
|
||||
return;
|
||||
}
|
||||
data = data.result;
|
||||
loadItems.scriptBriefStatusAve=true;
|
||||
if (data instanceof Array) {
|
||||
var points = new Array();
|
||||
for ( var i = 0; i < data.length; i++) {
|
||||
chart.addDataToGraph(chart, model, data[i]);
|
||||
}
|
||||
|
||||
} else{
|
||||
chart.addDataToGraph(chart, model, data);
|
||||
}
|
||||
|
||||
}, "json");
|
||||
if($("#status").attr("status")=="Complete"){
|
||||
clearInterval(intervalId);
|
||||
}
|
||||
|
||||
}, intervalTime);
|
||||
model.setIntervalId(intervalId);
|
||||
this.modelArray.push(model);
|
||||
|
||||
};
|
||||
Chart.prototype.addDataToGraph = function(chart, model, data) {
|
||||
|
||||
|
||||
var point = new Point(data.time, data.data);
|
||||
if (data.time > model.time){
|
||||
model.time = data.time;
|
||||
}
|
||||
model.time++;
|
||||
chart.addPoint(model.series, point);
|
||||
};
|
||||
Chart.prototype.deleteGraph = function(model) {
|
||||
for ( var i = 0; i < this.modelArray.length; i++) {
|
||||
if (model.series == this.modelArray[i].series) {
|
||||
clearInterval(this.modelArray[i].intervalId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.removeAxis(model.axis);
|
||||
};
|
||||
Chart.prototype.addModel = function(model) {
|
||||
this.modelArray.push(model);
|
||||
var intervalTime = 5000;
|
||||
var Chart = function() {
|
||||
};
|
||||
Chart.prototype.createChart = function(container) {
|
||||
container.highcharts({
|
||||
chart : {
|
||||
type : 'spline'
|
||||
},
|
||||
tooltip : {
|
||||
formatter : function() {
|
||||
return Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x)
|
||||
+ '<br/>' + '<b>' + this.series.name + ':'
|
||||
+ '</b><br/>' + Highcharts.numberFormat(this.y, 2);
|
||||
}
|
||||
},
|
||||
});
|
||||
var chart = container.highcharts();
|
||||
chart.setTitle({
|
||||
text : ""
|
||||
});
|
||||
chart.xAxis[0].update({
|
||||
type : 'datetime',
|
||||
tickInterval : 1000 * 60,
|
||||
tickWidth : 0,
|
||||
gridLineWidth : 1,
|
||||
tickPixelInterval : 50
|
||||
});
|
||||
this.highChart = chart;
|
||||
this.modelArray = new Array();
|
||||
};
|
||||
|
||||
Chart.prototype.addAxis = function(axis, seriesId,name, data) {
|
||||
this.highChart.addAxis({ // Secondary yAxis
|
||||
id : axis,
|
||||
title : {
|
||||
text : name,
|
||||
},
|
||||
lineWidth : 2,
|
||||
opposite : true
|
||||
});
|
||||
this.addSeries(axis, seriesId, data,name);
|
||||
};
|
||||
|
||||
Chart.prototype.addSeries = function(axis, seriesId, data,name) {
|
||||
this.highChart.addSeries({
|
||||
id : seriesId,
|
||||
name : name,
|
||||
yAxis : axis,
|
||||
data : data,
|
||||
marker : {
|
||||
enabled : true,
|
||||
radius : 3
|
||||
},
|
||||
showInLegend : true
|
||||
}, true);
|
||||
};
|
||||
Chart.prototype.removeAxis = function(axisId) {
|
||||
this.highChart.get(axisId).remove();
|
||||
};
|
||||
|
||||
Chart.prototype.addPoint = function(seriesId, point) {
|
||||
if (point.y == "NaN")
|
||||
point.y = 0;
|
||||
this.highChart.get(seriesId).addPoint([ point.x, point.y ]);
|
||||
};
|
||||
Chart.prototype.addPoints = function(seriesId, data) {
|
||||
var chart = this;
|
||||
for ( var i = 0; i < data.length; i++) {
|
||||
chart.addPoint(seriesId, data[i]);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var Point = function(x, y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
};
|
||||
var PointData=function(data,time){
|
||||
this.data=data;
|
||||
this.time=time;
|
||||
}
|
||||
|
||||
Chart.prototype.getGraphDataFirstly=function(model){
|
||||
var chart=this;
|
||||
chart.addAxis(model.axis, model.series, model.name,[]);
|
||||
$.post(model.url + "/" + model.time, {}, function(data) {
|
||||
loadItems.scriptBriefStatusAve = true;
|
||||
if (data==null||!data.success) {
|
||||
return;
|
||||
}
|
||||
data = data.result;
|
||||
if (data instanceof Array) {
|
||||
for ( var i = 0; i < data.length; i++) {
|
||||
chart.addDataToGraph(chart, model, data[i]);
|
||||
}
|
||||
|
||||
} else{
|
||||
chart.addDataToGraph(chart, model, data);
|
||||
}
|
||||
|
||||
}, "json");
|
||||
|
||||
}
|
||||
|
||||
Chart.prototype.addGraph = function(model) {
|
||||
var chart = this;
|
||||
this.getGraphDataFirstly(model,chart);
|
||||
var intervalId = setInterval(function() {
|
||||
$.post(model.url + "/" + model.time, {}, function(data) {
|
||||
loadItems.scriptBriefStatusAve = true;// this need to change
|
||||
if (data==null||!data.success) {
|
||||
clearInterval(intervalId);
|
||||
return;
|
||||
}
|
||||
data = data.result;
|
||||
loadItems.scriptBriefStatusAve=true;
|
||||
if (data instanceof Array) {
|
||||
var points = new Array();
|
||||
for ( var i = 0; i < data.length; i++) {
|
||||
chart.addDataToGraph(chart, model, data[i]);
|
||||
}
|
||||
|
||||
} else{
|
||||
chart.addDataToGraph(chart, model, data);
|
||||
}
|
||||
|
||||
}, "json");
|
||||
if($("#status").attr("status")=="Complete"){
|
||||
clearInterval(intervalId);
|
||||
}
|
||||
|
||||
}, intervalTime);
|
||||
model.setIntervalId(intervalId);
|
||||
this.modelArray.push(model);
|
||||
|
||||
};
|
||||
Chart.prototype.addDataToGraph = function(chart, model, data) {
|
||||
|
||||
|
||||
var point = new Point(data.time, data.data);
|
||||
if (data.time > model.time){
|
||||
model.time = data.time;
|
||||
}
|
||||
model.time++;
|
||||
chart.addPoint(model.series, point);
|
||||
};
|
||||
Chart.prototype.deleteGraph = function(model) {
|
||||
for ( var i = 0; i < this.modelArray.length; i++) {
|
||||
if (model.series == this.modelArray[i].series) {
|
||||
clearInterval(this.modelArray[i].intervalId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.removeAxis(model.axis);
|
||||
};
|
||||
Chart.prototype.addModel = function(model) {
|
||||
this.modelArray.push(model);
|
||||
};
|
|
@ -1,131 +1,131 @@
|
|||
//function getResultInfoTree(testPlanId) {
|
||||
//
|
||||
// var tree = new Tree();
|
||||
// tree.createRoot("Test Result","testPlan" ,testPlanId);
|
||||
// createScriptResultInfoTree(testPlanId, tree);
|
||||
// var sutResultInfo = new SutResult(testPlanId);
|
||||
// if (sutResultInfo.root != null)
|
||||
// tree.root.insertSingleNode(sutResultInfo.root);
|
||||
// return tree;
|
||||
//}
|
||||
|
||||
function getResultTree(testPlanId) {
|
||||
var tree = new Tree();
|
||||
tree.createRoot("Test Result", "testPlan",testPlanId);
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : testPlanId + "/testResultHanadle",
|
||||
dataType : "json",
|
||||
async : false,
|
||||
success : function(data) {
|
||||
if (!data.success) {
|
||||
tree=null;
|
||||
} else {
|
||||
data = data.resultHandle;
|
||||
for ( var i = 0; i < data.length; i++) {
|
||||
tree.root.insertSingleNode(data[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
return tree;
|
||||
}
|
||||
|
||||
//function createScriptResultInfoTree(testPlanId, tree) {
|
||||
// var scriptResultTree = new Tree();
|
||||
// scriptResultTree.createRoot("Script", "script");
|
||||
//
|
||||
// $.ajax({
|
||||
// type : "POST",
|
||||
// url : testPlanId + "/runningScriptInfo",
|
||||
// dataType : "json",
|
||||
// async : false,
|
||||
// success : function(data) {
|
||||
// if (!data.success) {
|
||||
// return;
|
||||
// } else
|
||||
// data = data.scriptInfo;
|
||||
// createScriptTree(data, scriptResultTree);
|
||||
// tree.root.insertSingleNode(scriptResultTree.root);
|
||||
// }
|
||||
// });
|
||||
//}
|
||||
|
||||
//function createScriptTree(scriptResultInfoList, tree) {
|
||||
//
|
||||
// if (scriptResultInfoList == null)
|
||||
// return;
|
||||
// for ( var i = 0; i < scriptResultInfoList.length; i++) {
|
||||
//
|
||||
// var node = new TreeNode("Script Result",
|
||||
// scriptResultInfoList[i].scriptName, null);
|
||||
// tree.root.insertSingleNode(node);
|
||||
// var nodeArray = insertResultList(scriptResultInfoList[i].childResults);
|
||||
// for ( var j = 0; j < nodeArray.length; j++) {
|
||||
// node.insertSingleNode(nodeArray[j]);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
//};
|
||||
//
|
||||
//var SutResult = function(testPlanId) {
|
||||
// var sutResultInfo = this;
|
||||
// var scriptResultTree = new Tree();
|
||||
//
|
||||
// $.ajax({
|
||||
// type : "POST",
|
||||
// url : testPlanId + "/sutInfo",
|
||||
// dataType : "json",
|
||||
// async : false,
|
||||
// success : function(data) {
|
||||
// if (!data.success) {
|
||||
// sutResultInfo.root = null;
|
||||
// return;
|
||||
// } else
|
||||
// data = data.sutInfo;
|
||||
// scriptResultTree.createRoot("SUT", "SUT");
|
||||
// sutResultInfo.root = scriptResultTree.root;
|
||||
// sutResultInfo.data = data;
|
||||
// sutResultInfo.createTree(data);
|
||||
// }
|
||||
// });
|
||||
//
|
||||
//};
|
||||
//SutResult.prototype.createTree = function(sutResultInfoList) {
|
||||
// for ( var i = 0; i < sutResultInfoList.length; i++) {
|
||||
// var ipNode = new TreeNode("port", sutResultInfoList[i].ip, null);
|
||||
// this.root.insertSingleNode(ipNode);
|
||||
// var portNode = new TreeNode("sut result", sutResultInfoList[i].port,
|
||||
// null);
|
||||
// ipNode.insertSingleNode(portNode);
|
||||
// var nodeArray = insertResultList(sutResultInfoList[i].childResults);
|
||||
// for ( var j = 0; j < nodeArray.length; j++) {
|
||||
// portNode.insertSingleNode(nodeArray[j]);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
//function insertResultList(childResults) {
|
||||
//
|
||||
// if (childResults == null)
|
||||
// return null;
|
||||
// else {
|
||||
// var nodeArray = new Array();
|
||||
// for ( var i = 0; i < childResults.length; i++) {
|
||||
// var node = new TreeNode(childResults[i].result,
|
||||
// childResults[i].result, null);
|
||||
// var childNode = insertResultList(childResults[i].childResults);
|
||||
// if (childNode !== null) {
|
||||
// for ( var j = 0; j < childNode.length; j++) {
|
||||
// node.insertSingleNode(childNode[j]);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// nodeArray.push(node);
|
||||
// }
|
||||
// }
|
||||
// return nodeArray;
|
||||
//function getResultInfoTree(testPlanId) {
|
||||
//
|
||||
// var tree = new Tree();
|
||||
// tree.createRoot("Test Result","testPlan" ,testPlanId);
|
||||
// createScriptResultInfoTree(testPlanId, tree);
|
||||
// var sutResultInfo = new SutResult(testPlanId);
|
||||
// if (sutResultInfo.root != null)
|
||||
// tree.root.insertSingleNode(sutResultInfo.root);
|
||||
// return tree;
|
||||
//}
|
||||
|
||||
function getResultTree(testPlanId) {
|
||||
var tree = new Tree();
|
||||
tree.createRoot("Test Result", "testPlan",testPlanId);
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : testPlanId + "/testResultHanadle",
|
||||
dataType : "json",
|
||||
async : false,
|
||||
success : function(data) {
|
||||
if (!data.success) {
|
||||
tree=null;
|
||||
} else {
|
||||
data = data.resultHandle;
|
||||
for ( var i = 0; i < data.length; i++) {
|
||||
tree.root.insertSingleNode(data[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
return tree;
|
||||
}
|
||||
|
||||
//function createScriptResultInfoTree(testPlanId, tree) {
|
||||
// var scriptResultTree = new Tree();
|
||||
// scriptResultTree.createRoot("Script", "script");
|
||||
//
|
||||
// $.ajax({
|
||||
// type : "POST",
|
||||
// url : testPlanId + "/runningScriptInfo",
|
||||
// dataType : "json",
|
||||
// async : false,
|
||||
// success : function(data) {
|
||||
// if (!data.success) {
|
||||
// return;
|
||||
// } else
|
||||
// data = data.scriptInfo;
|
||||
// createScriptTree(data, scriptResultTree);
|
||||
// tree.root.insertSingleNode(scriptResultTree.root);
|
||||
// }
|
||||
// });
|
||||
//}
|
||||
|
||||
//function createScriptTree(scriptResultInfoList, tree) {
|
||||
//
|
||||
// if (scriptResultInfoList == null)
|
||||
// return;
|
||||
// for ( var i = 0; i < scriptResultInfoList.length; i++) {
|
||||
//
|
||||
// var node = new TreeNode("Script Result",
|
||||
// scriptResultInfoList[i].scriptName, null);
|
||||
// tree.root.insertSingleNode(node);
|
||||
// var nodeArray = insertResultList(scriptResultInfoList[i].childResults);
|
||||
// for ( var j = 0; j < nodeArray.length; j++) {
|
||||
// node.insertSingleNode(nodeArray[j]);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
//};
|
||||
//
|
||||
//var SutResult = function(testPlanId) {
|
||||
// var sutResultInfo = this;
|
||||
// var scriptResultTree = new Tree();
|
||||
//
|
||||
// $.ajax({
|
||||
// type : "POST",
|
||||
// url : testPlanId + "/sutInfo",
|
||||
// dataType : "json",
|
||||
// async : false,
|
||||
// success : function(data) {
|
||||
// if (!data.success) {
|
||||
// sutResultInfo.root = null;
|
||||
// return;
|
||||
// } else
|
||||
// data = data.sutInfo;
|
||||
// scriptResultTree.createRoot("SUT", "SUT");
|
||||
// sutResultInfo.root = scriptResultTree.root;
|
||||
// sutResultInfo.data = data;
|
||||
// sutResultInfo.createTree(data);
|
||||
// }
|
||||
// });
|
||||
//
|
||||
//};
|
||||
//SutResult.prototype.createTree = function(sutResultInfoList) {
|
||||
// for ( var i = 0; i < sutResultInfoList.length; i++) {
|
||||
// var ipNode = new TreeNode("port", sutResultInfoList[i].ip, null);
|
||||
// this.root.insertSingleNode(ipNode);
|
||||
// var portNode = new TreeNode("sut result", sutResultInfoList[i].port,
|
||||
// null);
|
||||
// ipNode.insertSingleNode(portNode);
|
||||
// var nodeArray = insertResultList(sutResultInfoList[i].childResults);
|
||||
// for ( var j = 0; j < nodeArray.length; j++) {
|
||||
// portNode.insertSingleNode(nodeArray[j]);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
//function insertResultList(childResults) {
|
||||
//
|
||||
// if (childResults == null)
|
||||
// return null;
|
||||
// else {
|
||||
// var nodeArray = new Array();
|
||||
// for ( var i = 0; i < childResults.length; i++) {
|
||||
// var node = new TreeNode(childResults[i].result,
|
||||
// childResults[i].result, null);
|
||||
// var childNode = insertResultList(childResults[i].childResults);
|
||||
// if (childNode !== null) {
|
||||
// for ( var j = 0; j < childNode.length; j++) {
|
||||
// node.insertSingleNode(childNode[j]);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// nodeArray.push(node);
|
||||
// }
|
||||
// }
|
||||
// return nodeArray;
|
||||
//};
|
|
@ -1,93 +1,93 @@
|
|||
Highcharts.theme = {
|
||||
colors: ['#058DC7', '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'],
|
||||
chart: {
|
||||
width:null,
|
||||
backgroundColor: "#fff",
|
||||
borderWidth: 0,
|
||||
plotBackgroundColor: 'rgba(255, 255, 255, .9)',
|
||||
plotShadow: false,
|
||||
plotBorderWidth: 1
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#000',
|
||||
font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#666666',
|
||||
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineWidth: 1,
|
||||
lineColor: '#000',
|
||||
tickColor: '#000',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#000',
|
||||
font: '11px Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#333',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
lineColor: '#000',
|
||||
lineWidth: 0.5,
|
||||
tickWidth: 1,
|
||||
tickColor: '#000',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#000',
|
||||
font: '12px Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#333',
|
||||
fontWeight: 'normal',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
font: '9pt Trebuchet MS, Verdana, sans-serif',
|
||||
color: 'black'
|
||||
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: '#039'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: 'gray'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#99b'
|
||||
}
|
||||
},
|
||||
|
||||
navigation: {
|
||||
buttonOptions: {
|
||||
theme: {
|
||||
stroke: '#CCCCCC',
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
Highcharts.theme = {
|
||||
colors: ['#058DC7', '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'],
|
||||
chart: {
|
||||
width:null,
|
||||
backgroundColor: "#fff",
|
||||
borderWidth: 0,
|
||||
plotBackgroundColor: 'rgba(255, 255, 255, .9)',
|
||||
plotShadow: false,
|
||||
plotBorderWidth: 1
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#000',
|
||||
font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#666666',
|
||||
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineWidth: 1,
|
||||
lineColor: '#000',
|
||||
tickColor: '#000',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#000',
|
||||
font: '11px Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#333',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
lineColor: '#000',
|
||||
lineWidth: 0.5,
|
||||
tickWidth: 1,
|
||||
tickColor: '#000',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#000',
|
||||
font: '12px Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#333',
|
||||
fontWeight: 'normal',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
font: '9pt Trebuchet MS, Verdana, sans-serif',
|
||||
color: 'black'
|
||||
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: '#039'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: 'gray'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#99b'
|
||||
}
|
||||
},
|
||||
|
||||
navigation: {
|
||||
buttonOptions: {
|
||||
theme: {
|
||||
stroke: '#CCCCCC',
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
|
|
@ -1,35 +1,35 @@
|
|||
var progress_id = "loading";
|
||||
var loadItems = function() {
|
||||
this.scriptBriefStatusAve = false;
|
||||
this.testBrief = false;
|
||||
};
|
||||
function SetProgress(progress) {
|
||||
if (progress) {
|
||||
$("#" + progress_id + " > div").css("width", String(progress) + "%"); // 控制#loading
|
||||
$("#" + progress_id + " > div").html(String(progress) + "%"); // 显示百分比
|
||||
}
|
||||
}
|
||||
|
||||
function doProgress() {
|
||||
var progress = getProgress();
|
||||
SetProgress(progress);
|
||||
if (progress >= 100) {
|
||||
$('#load').modal('hide');
|
||||
return;
|
||||
}
|
||||
if (progress < 100) {
|
||||
$('#load').modal('show');
|
||||
setTimeout("doProgress()", 1000);
|
||||
}
|
||||
}
|
||||
function getProgress() {
|
||||
var progress = 0;
|
||||
for ( var key in loadItems) {
|
||||
if (loadItems[key])
|
||||
progress += (100 /2);
|
||||
}
|
||||
return progress;
|
||||
}
|
||||
$('#cancelLoading').click(function() {
|
||||
window.location.replace("testplans.jsp");
|
||||
});
|
||||
var progress_id = "loading";
|
||||
var loadItems = function() {
|
||||
this.scriptBriefStatusAve = false;
|
||||
this.testBrief = false;
|
||||
};
|
||||
function SetProgress(progress) {
|
||||
if (progress) {
|
||||
$("#" + progress_id + " > div").css("width", String(progress) + "%"); // 控制#loading
|
||||
$("#" + progress_id + " > div").html(String(progress) + "%"); // 显示百分比
|
||||
}
|
||||
}
|
||||
|
||||
function doProgress() {
|
||||
var progress = getProgress();
|
||||
SetProgress(progress);
|
||||
if (progress >= 100) {
|
||||
$('#load').modal('hide');
|
||||
return;
|
||||
}
|
||||
if (progress < 100) {
|
||||
$('#load').modal('show');
|
||||
setTimeout("doProgress()", 1000);
|
||||
}
|
||||
}
|
||||
function getProgress() {
|
||||
var progress = 0;
|
||||
for ( var key in loadItems) {
|
||||
if (loadItems[key])
|
||||
progress += (100 /2);
|
||||
}
|
||||
return progress;
|
||||
}
|
||||
$('#cancelLoading').click(function() {
|
||||
window.location.replace("testplans.jsp");
|
||||
});
|
||||
|
|
|
@ -1,50 +1,50 @@
|
|||
function getTestBrief(testPlanId) {
|
||||
showTestPlanStatusAsync(testPlanId);
|
||||
showTestBriefStatus(testPlanId);
|
||||
var intervalId = setInterval(function() {
|
||||
showTestPlanStatusAsync(testPlanId);
|
||||
showTestBriefStatus(testPlanId);
|
||||
loadItems.testBrief = true;
|
||||
if ($('#status').attr("status") == "Complete") {
|
||||
clearInterval(intervalId);
|
||||
}
|
||||
$("#vu").html("<h4>" + 0 + "</h4>");
|
||||
|
||||
}, 5000);
|
||||
}
|
||||
function showTestPlanStatusAsync(testPlanId) {
|
||||
var urlAddress = testPlanId + "/runningInfo";
|
||||
$.post(urlAddress, {}, function(data) {
|
||||
if (!data.success) {
|
||||
return;
|
||||
}
|
||||
|
||||
else {
|
||||
data = data.testPlan;
|
||||
$('#status').attr("status", data.currentStatus);
|
||||
var testStatus = testStatusMap(data.currentStatus);
|
||||
$('#status').html("<h4>" + testStatus + '</h4>');
|
||||
}
|
||||
|
||||
}, "json");
|
||||
}
|
||||
function showTestBriefStatus(testPlanId) {
|
||||
var urlAddress = testPlanId + "/testBriefStatus";
|
||||
$.post(urlAddress, {}, function(data) {
|
||||
if (!data.success) {
|
||||
return;
|
||||
}
|
||||
|
||||
else {
|
||||
data = data.briefInfo;
|
||||
}
|
||||
loadItems.testBrief = true;
|
||||
startTime = data.time;
|
||||
$("#vu").html("<h4>" + data.vus + "</h4>");
|
||||
|
||||
$("#request").html("<h4>" + data.requests + "</h4>")
|
||||
if ($('#status').attr("status") == "Complete") {
|
||||
$("#vu").html("<h4>" + 0 + "</h4>");
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
function getTestBrief(testPlanId) {
|
||||
showTestPlanStatusAsync(testPlanId);
|
||||
showTestBriefStatus(testPlanId);
|
||||
var intervalId = setInterval(function() {
|
||||
showTestPlanStatusAsync(testPlanId);
|
||||
showTestBriefStatus(testPlanId);
|
||||
loadItems.testBrief = true;
|
||||
if ($('#status').attr("status") == "Complete") {
|
||||
clearInterval(intervalId);
|
||||
}
|
||||
$("#vu").html("<h4>" + 0 + "</h4>");
|
||||
|
||||
}, 5000);
|
||||
}
|
||||
function showTestPlanStatusAsync(testPlanId) {
|
||||
var urlAddress = testPlanId + "/runningInfo";
|
||||
$.post(urlAddress, {}, function(data) {
|
||||
if (!data.success) {
|
||||
return;
|
||||
}
|
||||
|
||||
else {
|
||||
data = data.testPlan;
|
||||
$('#status').attr("status", data.currentStatus);
|
||||
var testStatus = testStatusMap(data.currentStatus);
|
||||
$('#status').html("<h4>" + testStatus + '</h4>');
|
||||
}
|
||||
|
||||
}, "json");
|
||||
}
|
||||
function showTestBriefStatus(testPlanId) {
|
||||
var urlAddress = testPlanId + "/testBriefStatus";
|
||||
$.post(urlAddress, {}, function(data) {
|
||||
if (!data.success) {
|
||||
return;
|
||||
}
|
||||
|
||||
else {
|
||||
data = data.briefInfo;
|
||||
}
|
||||
loadItems.testBrief = true;
|
||||
startTime = data.time;
|
||||
$("#vu").html("<h4>" + data.vus + "</h4>");
|
||||
|
||||
$("#request").html("<h4>" + data.requests + "</h4>")
|
||||
if ($('#status').attr("status") == "Complete") {
|
||||
$("#vu").html("<h4>" + 0 + "</h4>");
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
|
|
|
@ -1,226 +1,226 @@
|
|||
//Tree
|
||||
|
||||
var TreeNode = function(childClassName, name, value, childArray) {
|
||||
this.childClassName = childClassName;
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
this.children = childArray;
|
||||
};
|
||||
TreeNode.prototype.insertSingleNode = function(childNode) {
|
||||
if (childNode == null)
|
||||
return;
|
||||
if (this.children == null)
|
||||
this.children = new Array();
|
||||
this.children.push(childNode);
|
||||
|
||||
};
|
||||
TreeNode.prototype.insertNodes = function(childNodes) {
|
||||
if (this.children == null)
|
||||
this.children = new Array();
|
||||
if (childNodes == null)
|
||||
return;
|
||||
for ( var i = 0; i < childNodes.length; i++) {
|
||||
this.children.push(childNodes[i]);
|
||||
}
|
||||
|
||||
};
|
||||
var Tree = function() {
|
||||
this.root = null;
|
||||
};
|
||||
|
||||
Tree.prototype.createRoot = function(rootChildrenClassName,name, value) {
|
||||
this.root = new TreeNode(rootChildrenClassName,name, value, null);
|
||||
};
|
||||
|
||||
Tree.prototype.getClondSubTreeByValue = function(value) {
|
||||
if (value == null)
|
||||
return null;
|
||||
if (this.root == null)
|
||||
return null;
|
||||
var clonedTree = new Tree();
|
||||
clonedTree.createRoot(this.root.childClassName, this.root.name,this.root.value);
|
||||
var parentNode = this.searchTreeNodeByValue(this.root, value);
|
||||
clonedTree.root.childClassName = parentNode.childClassName;
|
||||
this.getClonedSubTree(parentNode, clonedTree.root);// 这个就把引用传递过去了,应该没什么影响,我再看看吧
|
||||
return clonedTree;
|
||||
};
|
||||
|
||||
Tree.prototype.searchTreeNodeByValue = function(parentNode, value) {
|
||||
|
||||
if (parentNode.children == null)
|
||||
return null;
|
||||
|
||||
for ( var i = 0; i < parentNode.children.length; i++) {
|
||||
if (value == parentNode.children[i].value) {
|
||||
return parentNode.children[i];
|
||||
}
|
||||
var node = this.searchTreeNodeByValue(parentNode.children[i], value);
|
||||
if (node != null)
|
||||
return node;
|
||||
}
|
||||
|
||||
};
|
||||
Tree.prototype.getCloneTreeFromVlaue = function(pathValues) {
|
||||
|
||||
if (pathValues == null)
|
||||
return null;
|
||||
if (pathValues.length <= 0)
|
||||
return null;
|
||||
if (this.root == null)
|
||||
return null;
|
||||
var clonedTree = new Tree();
|
||||
clonedTree.createRoot(this.root.childClassName,this.root.name, this.root.value);
|
||||
var currentNode = this.root;
|
||||
var clonedTreeCurrentNode = clonedTree.root;
|
||||
for ( var i = 0; i < pathValues.length; i++) {
|
||||
var flag = false;
|
||||
for ( var j = 0; j < currentNode.children.length; j++) {
|
||||
if (currentNode.children[j].value == pathValues[i]) {
|
||||
var clonedNode = new TreeNode(
|
||||
currentNode.children[j].childClassName,currentNode.children[j].name,
|
||||
currentNode.children[j].value, null);
|
||||
clonedTreeCurrentNode.insertSingleNode(clonedNode);
|
||||
clonedTreeCurrentNode = clonedNode;
|
||||
currentNode = currentNode.children[j];
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag == false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
if (currentNode != null)
|
||||
this.getClonedSubTree(currentNode, clonedTreeCurrentNode);// 这个就把引用传递过去了,应该没什么影响,我再看看吧
|
||||
return clonedTree;
|
||||
};
|
||||
|
||||
// no problem to copy the tree
|
||||
Tree.prototype.getClonedSubTree = function(startNode, parentNode) {
|
||||
if (startNode == null)
|
||||
return null;
|
||||
if (startNode.children == null)
|
||||
return null;
|
||||
if (startNode.children.length <= 0)
|
||||
return null;
|
||||
for ( var i = 0; i < startNode.children.length; i++) {
|
||||
var node = new TreeNode(startNode.children[i].childClassName,startNode.children[i].name,
|
||||
startNode.children[i].value, null);
|
||||
parentNode.insertSingleNode(node);
|
||||
this.getClonedSubTree(startNode.children[i], node);
|
||||
}
|
||||
};
|
||||
|
||||
Tree.prototype.insertToTree = function(insertedTree, singlePathTree) {
|
||||
if (singlePathTree == null)
|
||||
return;
|
||||
|
||||
if (singlePathTree.children == null)
|
||||
return;
|
||||
if (singlePathTree.children.length < 1)
|
||||
return;
|
||||
if (insertedTree.children == null) {
|
||||
insertedTree.insertSingleNode(singlePathTree.children[0]);
|
||||
}
|
||||
var children = insertedTree.children;
|
||||
var flag = false;
|
||||
for ( var i = 0; i < children.length; i++) {
|
||||
if (children[i].value == singlePathTree.children[0].value) {
|
||||
|
||||
this.insertToTree(children[i], singlePathTree.children[0]);
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!flag)
|
||||
insertedTree.insertSingleNode(singlePathTree.children[0]);
|
||||
};
|
||||
|
||||
Tree.prototype.deleteFromTree = function(pathValues) {
|
||||
if (pathValues == null)
|
||||
return;
|
||||
if (this.root == null)
|
||||
return;
|
||||
var nodeArray = this.getTreePathNodes(pathValues);
|
||||
var currentNode = nodeArray.pop();
|
||||
var length = nodeArray.length;
|
||||
for ( var i = 0; i < length; i++) {
|
||||
var parent = nodeArray.pop();
|
||||
if (parent.treeNode.children.length == 1
|
||||
&& currentNode.treeNode.children == null)
|
||||
parent.treeNode.children = null;
|
||||
else if (parent.treeNode.children.length > 1
|
||||
&& currentNode.treeNode.children == null) {
|
||||
parent.treeNode.children.splice(currentNode.index, 1);
|
||||
} else
|
||||
return;
|
||||
currentNode = parent;
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
Tree.prototype.getTreePathNodes = function(pathValues) {
|
||||
|
||||
var DeleteNode = function(treeNode, index) {
|
||||
this.treeNode = treeNode;
|
||||
this.index = index;
|
||||
};
|
||||
if (pathValues == null)
|
||||
return;
|
||||
if (this.root == null) {
|
||||
alert("error");
|
||||
return;
|
||||
}
|
||||
var currentNode = this.root;
|
||||
|
||||
var nodeArray = new Array();
|
||||
nodeArray.push(new DeleteNode(this.root, 0));
|
||||
for ( var i = 0; i < pathValues.length; i++) {
|
||||
if (currentNode.children == null) {
|
||||
alert("error");
|
||||
return null;
|
||||
}
|
||||
for ( var j = 0; j < currentNode.children.length; j++)
|
||||
if (currentNode.children[j].value == pathValues[i]) {
|
||||
nodeArray.push(new DeleteNode(currentNode.children[j], j));
|
||||
currentNode = currentNode.children[j];
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
return nodeArray;
|
||||
};
|
||||
Tree.prototype.getClonedTree = function(tree) {
|
||||
var clonedTree = new Tree();
|
||||
clonedTree.root = this.getClonedNode(tree.root);
|
||||
return clonedTree;
|
||||
|
||||
};
|
||||
Tree.prototype.getClonedNode = function(node) {
|
||||
if (node == null)
|
||||
return null;
|
||||
var clonedNode = new TreeNode(node.childClassName, node.name,node.value, null);
|
||||
if (node.children != null && node.children.length > 0) {
|
||||
for ( var i = 0; i < node.children.length; i++) {
|
||||
var childClonedNode = this.getClonedNode(node.children[i]);
|
||||
if (childClonedNode != null)
|
||||
clonedNode.insertSingleNode(childClonedNode);
|
||||
}
|
||||
}
|
||||
return clonedNode;
|
||||
};
|
||||
function getClonedSubTree(startNode, parentNode) {
|
||||
if (startNode == null)
|
||||
return null;
|
||||
if (startNode.children == null)
|
||||
return null;
|
||||
if (startNode.children.length <= 0)
|
||||
return null;
|
||||
for ( var i = 0; i < startNode.children.length; i++) {
|
||||
var node = new TreeNode(startNode.children[i].childClassName,startNode.children[i].name,
|
||||
startNode.children[i].value, null);
|
||||
parentNode.insertSingleNode(node);
|
||||
this.getClonedSubTree(startNode.children[i], node);
|
||||
}
|
||||
};
|
||||
//Tree
|
||||
|
||||
var TreeNode = function(childClassName, name, value, childArray) {
|
||||
this.childClassName = childClassName;
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
this.children = childArray;
|
||||
};
|
||||
TreeNode.prototype.insertSingleNode = function(childNode) {
|
||||
if (childNode == null)
|
||||
return;
|
||||
if (this.children == null)
|
||||
this.children = new Array();
|
||||
this.children.push(childNode);
|
||||
|
||||
};
|
||||
TreeNode.prototype.insertNodes = function(childNodes) {
|
||||
if (this.children == null)
|
||||
this.children = new Array();
|
||||
if (childNodes == null)
|
||||
return;
|
||||
for ( var i = 0; i < childNodes.length; i++) {
|
||||
this.children.push(childNodes[i]);
|
||||
}
|
||||
|
||||
};
|
||||
var Tree = function() {
|
||||
this.root = null;
|
||||
};
|
||||
|
||||
Tree.prototype.createRoot = function(rootChildrenClassName,name, value) {
|
||||
this.root = new TreeNode(rootChildrenClassName,name, value, null);
|
||||
};
|
||||
|
||||
Tree.prototype.getClondSubTreeByValue = function(value) {
|
||||
if (value == null)
|
||||
return null;
|
||||
if (this.root == null)
|
||||
return null;
|
||||
var clonedTree = new Tree();
|
||||
clonedTree.createRoot(this.root.childClassName, this.root.name,this.root.value);
|
||||
var parentNode = this.searchTreeNodeByValue(this.root, value);
|
||||
clonedTree.root.childClassName = parentNode.childClassName;
|
||||
this.getClonedSubTree(parentNode, clonedTree.root);// 这个就把引用传递过去了,应该没什么影响,我再看看吧
|
||||
return clonedTree;
|
||||
};
|
||||
|
||||
Tree.prototype.searchTreeNodeByValue = function(parentNode, value) {
|
||||
|
||||
if (parentNode.children == null)
|
||||
return null;
|
||||
|
||||
for ( var i = 0; i < parentNode.children.length; i++) {
|
||||
if (value == parentNode.children[i].value) {
|
||||
return parentNode.children[i];
|
||||
}
|
||||
var node = this.searchTreeNodeByValue(parentNode.children[i], value);
|
||||
if (node != null)
|
||||
return node;
|
||||
}
|
||||
|
||||
};
|
||||
Tree.prototype.getCloneTreeFromVlaue = function(pathValues) {
|
||||
|
||||
if (pathValues == null)
|
||||
return null;
|
||||
if (pathValues.length <= 0)
|
||||
return null;
|
||||
if (this.root == null)
|
||||
return null;
|
||||
var clonedTree = new Tree();
|
||||
clonedTree.createRoot(this.root.childClassName,this.root.name, this.root.value);
|
||||
var currentNode = this.root;
|
||||
var clonedTreeCurrentNode = clonedTree.root;
|
||||
for ( var i = 0; i < pathValues.length; i++) {
|
||||
var flag = false;
|
||||
for ( var j = 0; j < currentNode.children.length; j++) {
|
||||
if (currentNode.children[j].value == pathValues[i]) {
|
||||
var clonedNode = new TreeNode(
|
||||
currentNode.children[j].childClassName,currentNode.children[j].name,
|
||||
currentNode.children[j].value, null);
|
||||
clonedTreeCurrentNode.insertSingleNode(clonedNode);
|
||||
clonedTreeCurrentNode = clonedNode;
|
||||
currentNode = currentNode.children[j];
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag == false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
if (currentNode != null)
|
||||
this.getClonedSubTree(currentNode, clonedTreeCurrentNode);// 这个就把引用传递过去了,应该没什么影响,我再看看吧
|
||||
return clonedTree;
|
||||
};
|
||||
|
||||
// no problem to copy the tree
|
||||
Tree.prototype.getClonedSubTree = function(startNode, parentNode) {
|
||||
if (startNode == null)
|
||||
return null;
|
||||
if (startNode.children == null)
|
||||
return null;
|
||||
if (startNode.children.length <= 0)
|
||||
return null;
|
||||
for ( var i = 0; i < startNode.children.length; i++) {
|
||||
var node = new TreeNode(startNode.children[i].childClassName,startNode.children[i].name,
|
||||
startNode.children[i].value, null);
|
||||
parentNode.insertSingleNode(node);
|
||||
this.getClonedSubTree(startNode.children[i], node);
|
||||
}
|
||||
};
|
||||
|
||||
Tree.prototype.insertToTree = function(insertedTree, singlePathTree) {
|
||||
if (singlePathTree == null)
|
||||
return;
|
||||
|
||||
if (singlePathTree.children == null)
|
||||
return;
|
||||
if (singlePathTree.children.length < 1)
|
||||
return;
|
||||
if (insertedTree.children == null) {
|
||||
insertedTree.insertSingleNode(singlePathTree.children[0]);
|
||||
}
|
||||
var children = insertedTree.children;
|
||||
var flag = false;
|
||||
for ( var i = 0; i < children.length; i++) {
|
||||
if (children[i].value == singlePathTree.children[0].value) {
|
||||
|
||||
this.insertToTree(children[i], singlePathTree.children[0]);
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!flag)
|
||||
insertedTree.insertSingleNode(singlePathTree.children[0]);
|
||||
};
|
||||
|
||||
Tree.prototype.deleteFromTree = function(pathValues) {
|
||||
if (pathValues == null)
|
||||
return;
|
||||
if (this.root == null)
|
||||
return;
|
||||
var nodeArray = this.getTreePathNodes(pathValues);
|
||||
var currentNode = nodeArray.pop();
|
||||
var length = nodeArray.length;
|
||||
for ( var i = 0; i < length; i++) {
|
||||
var parent = nodeArray.pop();
|
||||
if (parent.treeNode.children.length == 1
|
||||
&& currentNode.treeNode.children == null)
|
||||
parent.treeNode.children = null;
|
||||
else if (parent.treeNode.children.length > 1
|
||||
&& currentNode.treeNode.children == null) {
|
||||
parent.treeNode.children.splice(currentNode.index, 1);
|
||||
} else
|
||||
return;
|
||||
currentNode = parent;
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
Tree.prototype.getTreePathNodes = function(pathValues) {
|
||||
|
||||
var DeleteNode = function(treeNode, index) {
|
||||
this.treeNode = treeNode;
|
||||
this.index = index;
|
||||
};
|
||||
if (pathValues == null)
|
||||
return;
|
||||
if (this.root == null) {
|
||||
alert("error");
|
||||
return;
|
||||
}
|
||||
var currentNode = this.root;
|
||||
|
||||
var nodeArray = new Array();
|
||||
nodeArray.push(new DeleteNode(this.root, 0));
|
||||
for ( var i = 0; i < pathValues.length; i++) {
|
||||
if (currentNode.children == null) {
|
||||
alert("error");
|
||||
return null;
|
||||
}
|
||||
for ( var j = 0; j < currentNode.children.length; j++)
|
||||
if (currentNode.children[j].value == pathValues[i]) {
|
||||
nodeArray.push(new DeleteNode(currentNode.children[j], j));
|
||||
currentNode = currentNode.children[j];
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
return nodeArray;
|
||||
};
|
||||
Tree.prototype.getClonedTree = function(tree) {
|
||||
var clonedTree = new Tree();
|
||||
clonedTree.root = this.getClonedNode(tree.root);
|
||||
return clonedTree;
|
||||
|
||||
};
|
||||
Tree.prototype.getClonedNode = function(node) {
|
||||
if (node == null)
|
||||
return null;
|
||||
var clonedNode = new TreeNode(node.childClassName, node.name,node.value, null);
|
||||
if (node.children != null && node.children.length > 0) {
|
||||
for ( var i = 0; i < node.children.length; i++) {
|
||||
var childClonedNode = this.getClonedNode(node.children[i]);
|
||||
if (childClonedNode != null)
|
||||
clonedNode.insertSingleNode(childClonedNode);
|
||||
}
|
||||
}
|
||||
return clonedNode;
|
||||
};
|
||||
function getClonedSubTree(startNode, parentNode) {
|
||||
if (startNode == null)
|
||||
return null;
|
||||
if (startNode.children == null)
|
||||
return null;
|
||||
if (startNode.children.length <= 0)
|
||||
return null;
|
||||
for ( var i = 0; i < startNode.children.length; i++) {
|
||||
var node = new TreeNode(startNode.children[i].childClassName,startNode.children[i].name,
|
||||
startNode.children[i].value, null);
|
||||
parentNode.insertSingleNode(node);
|
||||
this.getClonedSubTree(startNode.children[i], node);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,139 +1,139 @@
|
|||
<!DOCTYPE html>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<html>
|
||||
<head>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<meta charset="utf-8">
|
||||
<title>Bench4Q</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description"
|
||||
content="Bench4Q, a new method for QOS benchmarking.">
|
||||
<link id="bs-css" href="lib/chrisma/css/bootstrap-cerulean.css"
|
||||
rel="stylesheet">
|
||||
<link href="lib/chrisma/css/opa-icons.css" rel="stylesheet">
|
||||
<link
|
||||
href="http://ajax.aspnetcdn.com/ajax/bootstrap/2.3.2/css/bootstrap-responsive.css"
|
||||
rel="stylesheet">
|
||||
<link href="lib/chrisma/css/charisma-app.css" rel="stylesheet">
|
||||
<link href="lib/dataTable/css/jquery.dataTables.css" rel="stylesheet">
|
||||
<style type="text/css">
|
||||
body {
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.sidebar-nav {
|
||||
padding: 9px 0;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
<link
|
||||
href="http://ajax.aspnetcdn.com/ajax/bootstrap/2.3.2/css/bootstrap-responsive.css"
|
||||
rel="stylesheet">
|
||||
<link href="lib/chrisma/css/charisma-app.css" rel="stylesheet">
|
||||
<link
|
||||
href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/themes/redmond/jquery-ui.css"
|
||||
rel="stylesheet">
|
||||
<link rel="shortcut icon" href="images/bench4q.png">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<fmt:bundle basename="i18n">
|
||||
<jsp:include page="publiccontrol/navigatebar.jsp"></jsp:include>
|
||||
<div class="container-fluid">
|
||||
<div class="row-fluid">
|
||||
<jsp:include page="publiccontrol/leftmenubar.jsp"></jsp:include>
|
||||
<noscript>
|
||||
<div class="alert alert-block span10">
|
||||
<h4 class="alert-heading">
|
||||
<fmt:message key="warning" />
|
||||
!
|
||||
</h4>
|
||||
<p>
|
||||
<fmt:message key="warningcontent1" />
|
||||
<a href="http://en.wikipedia.org/wiki/JavaScript" target="_blank">JavaScript</a>
|
||||
<fmt:message key="warningcontent2" />
|
||||
.
|
||||
</p>
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
<div id="content" class="span10">
|
||||
<!-- content starts -->
|
||||
|
||||
|
||||
<div>
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="#"><fmt:message key="home" /></a> <span
|
||||
class="divider">/</span></li>
|
||||
<li><a href="#"><fmt:message key="testplan" /></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid sortable">
|
||||
<div class="box span12 ">
|
||||
<div class="box-header well" data-original-title>
|
||||
<h2>
|
||||
<i></i>
|
||||
<fmt:message key="testplan" />
|
||||
</h2>
|
||||
<div class="box-icon">
|
||||
<a href="#" class="btn btn-minimize btn-round"><i
|
||||
class="icon-chevron-up"></i></a> <a href="#"
|
||||
class="btn btn-close btn-round"><i class="icon-remove"></i></a>
|
||||
<a href="#" class="btn btn-round" onClick="loadTestPlans()"><i
|
||||
class="icon-list"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-content">
|
||||
<table id="table"
|
||||
class="table table-striped table-bordered bootstrap-datatable datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th><fmt:message key="name" /></th>
|
||||
<th><fmt:message key="status" /></th>
|
||||
<th><fmt:message key="createdatetime" /></th>
|
||||
<th><fmt:message key="testPlan-view" /></th>
|
||||
<th><fmt:message key="actions" /></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!--/span-->
|
||||
|
||||
</div>
|
||||
<!--/row-->
|
||||
|
||||
|
||||
<!-- content ends -->
|
||||
</div>
|
||||
<!--/#content.span10-->
|
||||
</div>
|
||||
|
||||
<jsp:include page="publiccontrol/footer.jsp"></jsp:include>
|
||||
</div>
|
||||
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
|
||||
<script src="lib/dataTable/js/jquery.dataTables.js"></script>
|
||||
<script
|
||||
src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.3/jquery-ui.min.js"></script>
|
||||
<script src="lib/jqueryi18n/jquery.i18n.properties-1.0.9.js"></script>
|
||||
<script
|
||||
src="http://ajax.aspnetcdn.com/ajax/bootstrap/2.3.1/bootstrap.min.js"></script>
|
||||
<script src="lib/chrisma/js/jquery.cookie.js"></script>
|
||||
<script src="lib/chrisma/js/theme.js"></script>
|
||||
<script src="script/base.js"></script>
|
||||
<script src="script/bench4q.table.js"></script>
|
||||
<script src="script/testPlanListManage.js"></script>
|
||||
<script src="script/Share/TestStatusMap.js"></script>
|
||||
<script src="script/testPlans.js"></script>
|
||||
</fmt:bundle>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<html>
|
||||
<head>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<meta charset="utf-8">
|
||||
<title>Bench4Q</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description"
|
||||
content="Bench4Q, a new method for QOS benchmarking.">
|
||||
<link id="bs-css" href="lib/chrisma/css/bootstrap-cerulean.css"
|
||||
rel="stylesheet">
|
||||
<link href="lib/chrisma/css/opa-icons.css" rel="stylesheet">
|
||||
<link
|
||||
href="http://ajax.aspnetcdn.com/ajax/bootstrap/2.3.2/css/bootstrap-responsive.css"
|
||||
rel="stylesheet">
|
||||
<link href="lib/chrisma/css/charisma-app.css" rel="stylesheet">
|
||||
<link href="lib/dataTable/css/jquery.dataTables.css" rel="stylesheet">
|
||||
<style type="text/css">
|
||||
body {
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.sidebar-nav {
|
||||
padding: 9px 0;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
<link
|
||||
href="http://ajax.aspnetcdn.com/ajax/bootstrap/2.3.2/css/bootstrap-responsive.css"
|
||||
rel="stylesheet">
|
||||
<link href="lib/chrisma/css/charisma-app.css" rel="stylesheet">
|
||||
<link
|
||||
href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/themes/redmond/jquery-ui.css"
|
||||
rel="stylesheet">
|
||||
<link rel="shortcut icon" href="images/bench4q.png">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<fmt:bundle basename="i18n">
|
||||
<jsp:include page="publiccontrol/navigatebar.jsp"></jsp:include>
|
||||
<div class="container-fluid">
|
||||
<div class="row-fluid">
|
||||
<jsp:include page="publiccontrol/leftmenubar.jsp"></jsp:include>
|
||||
<noscript>
|
||||
<div class="alert alert-block span10">
|
||||
<h4 class="alert-heading">
|
||||
<fmt:message key="warning" />
|
||||
!
|
||||
</h4>
|
||||
<p>
|
||||
<fmt:message key="warningcontent1" />
|
||||
<a href="http://en.wikipedia.org/wiki/JavaScript" target="_blank">JavaScript</a>
|
||||
<fmt:message key="warningcontent2" />
|
||||
.
|
||||
</p>
|
||||
</div>
|
||||
</noscript>
|
||||
|
||||
<div id="content" class="span10">
|
||||
<!-- content starts -->
|
||||
|
||||
|
||||
<div>
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="#"><fmt:message key="home" /></a> <span
|
||||
class="divider">/</span></li>
|
||||
<li><a href="#"><fmt:message key="testplan" /></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid sortable">
|
||||
<div class="box span12 ">
|
||||
<div class="box-header well" data-original-title>
|
||||
<h2>
|
||||
<i></i>
|
||||
<fmt:message key="testplan" />
|
||||
</h2>
|
||||
<div class="box-icon">
|
||||
<a href="#" class="btn btn-minimize btn-round"><i
|
||||
class="icon-chevron-up"></i></a> <a href="#"
|
||||
class="btn btn-close btn-round"><i class="icon-remove"></i></a>
|
||||
<a href="#" class="btn btn-round" onClick="loadTestPlans()"><i
|
||||
class="icon-list"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-content">
|
||||
<table id="table"
|
||||
class="table table-striped table-bordered bootstrap-datatable datatable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th><fmt:message key="name" /></th>
|
||||
<th><fmt:message key="status" /></th>
|
||||
<th><fmt:message key="createdatetime" /></th>
|
||||
<th><fmt:message key="testPlan-view" /></th>
|
||||
<th><fmt:message key="actions" /></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!--/span-->
|
||||
|
||||
</div>
|
||||
<!--/row-->
|
||||
|
||||
|
||||
<!-- content ends -->
|
||||
</div>
|
||||
<!--/#content.span10-->
|
||||
</div>
|
||||
|
||||
<jsp:include page="publiccontrol/footer.jsp"></jsp:include>
|
||||
</div>
|
||||
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
|
||||
<script src="lib/dataTable/js/jquery.dataTables.js"></script>
|
||||
<script
|
||||
src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.3/jquery-ui.min.js"></script>
|
||||
<script src="lib/jqueryi18n/jquery.i18n.properties-1.0.9.js"></script>
|
||||
<script
|
||||
src="http://ajax.aspnetcdn.com/ajax/bootstrap/2.3.1/bootstrap.min.js"></script>
|
||||
<script src="lib/chrisma/js/jquery.cookie.js"></script>
|
||||
<script src="lib/chrisma/js/theme.js"></script>
|
||||
<script src="script/base.js"></script>
|
||||
<script src="script/bench4q.table.js"></script>
|
||||
<script src="script/testPlanListManage.js"></script>
|
||||
<script src="script/Share/TestStatusMap.js"></script>
|
||||
<script src="script/testPlans.js"></script>
|
||||
</fmt:bundle>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
package org.bench4q.web.test.masterMessager;
|
||||
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
@XmlRootElement
|
||||
public class ParamInfoModel_Test {
|
||||
private String label;
|
||||
private String name;
|
||||
|
||||
@XmlElement
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLable(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
@XmlElement
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
||||
package org.bench4q.web.test.masterMessager;
|
||||
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
@XmlRootElement
|
||||
public class ParamInfoModel_Test {
|
||||
private String label;
|
||||
private String name;
|
||||
|
||||
@XmlElement
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLable(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
@XmlElement
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
|
||||
<context:component-scan base-package="org.bench4q.web,org.bench4q.share" />
|
||||
<mvc:annotation-driven />
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
|
||||
<context:component-scan base-package="org.bench4q.web,org.bench4q.share" />
|
||||
<mvc:annotation-driven />
|
||||
|
||||
</beans>
|
Loading…
Reference in New Issue