add test proxy server api
This commit is contained in:
parent
3ffc68d3e4
commit
69d6b8b23f
|
@ -21,9 +21,11 @@ import org.bench4q.web.masterMessager.ScriptMessager;
|
|||
import org.bench4q.web.model.ScenarioModel;
|
||||
import org.bench4q.web.service.ScriptService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
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.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
@ -101,7 +103,6 @@ public class ScriptController extends BaseController {
|
|||
if (operateScriptServerResponseModel.isSuccess()) {
|
||||
ScriptModel scriptModel = operateScriptServerResponseModel
|
||||
.getScriptModels().get(0);
|
||||
System.out.println(scriptModel.getScriptContent());
|
||||
RunScenarioModel runScenarioModel = (RunScenarioModel) MarshalHelper
|
||||
.tryUnmarshal(RunScenarioModel.class,
|
||||
scriptModel.getScriptContent());
|
||||
|
@ -132,7 +133,6 @@ public class ScriptController extends BaseController {
|
|||
if (operateScriptServerResponseModel.isSuccess()) {
|
||||
ScriptModel scriptModel = operateScriptServerResponseModel
|
||||
.getScriptModels().get(0);
|
||||
System.out.println(scriptModel.getScriptContent());
|
||||
RunScenarioModel runScenarioModel = (RunScenarioModel) MarshalHelper
|
||||
.tryUnmarshal(RunScenarioModel.class,
|
||||
scriptModel.getScriptContent());
|
||||
|
@ -252,7 +252,6 @@ public class ScriptController extends BaseController {
|
|||
Gson gson = new Gson();
|
||||
RunScenarioModel runScenarioModel = gson.fromJson(runScenarioModelStr,
|
||||
RunScenarioModel.class);
|
||||
System.out.println(MarshalHelper.tryMarshal(runScenarioModel));
|
||||
return processScriptResponse(
|
||||
map,
|
||||
this.getScriptMessager().updateScript(accessToken, scriptId,
|
||||
|
@ -290,6 +289,22 @@ public class ScriptController extends BaseController {
|
|||
port, scriptRecordUUID));
|
||||
}
|
||||
|
||||
@RequestMapping("testRecordProxy")
|
||||
@ResponseBody
|
||||
public Map<String, Object> testRecordProxy(
|
||||
@RequestHeader HttpHeaders headers) {
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
//is from proxy
|
||||
boolean isFromProxy = Boolean.parseBoolean(headers.getFirst("FromProxy"));
|
||||
if(isFromProxy)
|
||||
{
|
||||
success(map);
|
||||
}else{
|
||||
fail(map,"proxy setting error!");
|
||||
}
|
||||
return map ;
|
||||
}
|
||||
|
||||
@RequestMapping("saveScriptRecorded")
|
||||
@ResponseBody
|
||||
public Map<String, Object> saveScriptRecorded(
|
||||
|
|
|
@ -1 +1 @@
|
|||
masterAddress=133.133.2.100:8901
|
||||
masterAddress=localhost:8901
|
|
@ -65,7 +65,7 @@ DataCollector.prototype.multiFieldData = function(editor) {
|
|||
};
|
||||
|
||||
DataCollector.prototype.tableData = function(editor) {
|
||||
var thArray = editor.find("thead").children("tr")[0].children("th");
|
||||
var thArray = editor.find("thead").children("tr").children("th");
|
||||
var editorArray = editor.find("tbody").children("tr");
|
||||
var name = editor.attr("id");
|
||||
var value = "";
|
||||
|
@ -77,14 +77,14 @@ DataCollector.prototype.tableData = function(editor) {
|
|||
|| $(tdArray[j]).children("input").val() == "") {
|
||||
continue;
|
||||
}
|
||||
trValue += thArray[j] + "=" + $(tdArray[j]).children("input").val()
|
||||
trValue += thArray[j].innerText + "=" + $(tdArray[j]).children("input").val()
|
||||
+ "|";
|
||||
|
||||
}
|
||||
trValue = trValue.substring(0, trValue.length - 1);
|
||||
value += trValue + ";";
|
||||
value += trValue + "|;";
|
||||
}
|
||||
value = value.substring(0, value.length - 1);
|
||||
value = value.substring(0, value.length - 2);
|
||||
// if (!this.validate(value)) {
|
||||
// return false;
|
||||
// }
|
||||
|
|
Loading…
Reference in New Issue