get expcode and expcnttype from recording
This commit is contained in:
parent
3c46fdda89
commit
723de68ba8
|
@ -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;
|
||||
|
|
|
@ -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<ParameterModel> params = new ArrayList<ParameterModel>();
|
||||
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",
|
||||
|
|
Loading…
Reference in New Issue