diff --git a/Bench4Q-Recorder/src/main/java/org/bench4q/recorder/httpcapture/generator/AbstractCodeGenerator.java b/Bench4Q-Recorder/src/main/java/org/bench4q/recorder/httpcapture/generator/AbstractCodeGenerator.java index 75a5e46d..c420a29d 100644 --- a/Bench4Q-Recorder/src/main/java/org/bench4q/recorder/httpcapture/generator/AbstractCodeGenerator.java +++ b/Bench4Q-Recorder/src/main/java/org/bench4q/recorder/httpcapture/generator/AbstractCodeGenerator.java @@ -293,7 +293,7 @@ public abstract class AbstractCodeGenerator implements IScriptGenerator, cont_len_str = ", " + header.contentLength; doSetData(action.getMultiPartData()); } - doCallUrl(action, method, data_str, cont_len_str); + doCallUrl(action, method, data_str, cont_len_str,respCode,respContentType); this.requestCount++; } @@ -406,7 +406,7 @@ public abstract class AbstractCodeGenerator implements IScriptGenerator, throws Utils.UserException; public abstract void doCallUrl(Action action, String paramString2, - String paramString3, String paramString4) + String paramString3, String paramString4, int paramInt, String paramString5) throws Utils.UserException; public abstract void doEndTransaction() throws Utils.UserException; diff --git a/Bench4Q-Recorder/src/main/java/org/bench4q/recorder/httpcapture/generator/Bench4qCodeGenerator.java b/Bench4Q-Recorder/src/main/java/org/bench4q/recorder/httpcapture/generator/Bench4qCodeGenerator.java index 2dfed0a7..47b5424c 100644 --- a/Bench4Q-Recorder/src/main/java/org/bench4q/recorder/httpcapture/generator/Bench4qCodeGenerator.java +++ b/Bench4Q-Recorder/src/main/java/org/bench4q/recorder/httpcapture/generator/Bench4qCodeGenerator.java @@ -157,11 +157,11 @@ public class Bench4qCodeGenerator extends AbstractCodeGenerator { } public void doCallUrl(Action action, String method, String data, - String contentLength) throws Utils.UserException { + String contentLength, int respCode, String respContentType) throws Utils.UserException { if (!isFirstRequest()) doInsertDelay(getTimeElapsedSinceLastestRequest()); BehaviorModel userBehavior = createHttpBehavior(this.getRequestCount(), - action.getUrl(), method); + action.getUrl(), method, respCode, respContentType); insertBehavior(userBehavior); this.queryStringParameters = ""; @@ -169,12 +169,14 @@ public class Bench4qCodeGenerator extends AbstractCodeGenerator { } public BehaviorModel createHttpBehavior(int behaviorId, String url, - String method) { + String method, int respCode, String respContentType) { List params = new ArrayList(); params.add(ParameterModel.createParameter("url", url)); params.add(ParameterModel.createParameter("queryParams", this.queryStringParameters)); params.add(ParameterModel.createParameter("headers", this.headers)); + params.add(ParameterModel.createParameter("expResCode", Integer.toString(respCode))); + params.add(ParameterModel.createParameter("expResCnttype", respContentType)); if (method.equalsIgnoreCase("post")) { if (body.length() > 0) { params.add(ParameterModel.createParameter("bodyContent",