From f30ed0f193c55b9a32f8852dd230bd6d8a1db9d9 Mon Sep 17 00:00:00 2001 From: hemeimei <315627330@qq.com> Date: Tue, 30 Sep 2014 10:50:09 +0800 Subject: [PATCH] refactor create test plan and recording --- .../org/bench4q/master/domain/factory/TestPlanFactory.java | 4 ++-- .../java/org/bench4q/recorder/httpcapture/RequestHandler.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/factory/TestPlanFactory.java b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/factory/TestPlanFactory.java index 08dd37fd..c34a4e8b 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/factory/TestPlanFactory.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/factory/TestPlanFactory.java @@ -214,9 +214,9 @@ public class TestPlanFactory { private boolean isFilterType(String filterTypeMatch, BehaviorModel behaviorModel) { for (ParameterModel parameterModel : behaviorModel.getParameters()) { - if (parameterModel.getKey().equals("expResCnttype")) { + if (parameterModel.getKey().equals("expResCnttype") ) { - if (parameterModel.getValue().matches(filterTypeMatch)) { + if (parameterModel.getValue() != null && parameterModel.getValue().matches(filterTypeMatch)) { return true; } else { return false; diff --git a/Bench4Q-Recorder/src/main/java/org/bench4q/recorder/httpcapture/RequestHandler.java b/Bench4Q-Recorder/src/main/java/org/bench4q/recorder/httpcapture/RequestHandler.java index bb8cd380..b99637d3 100644 --- a/Bench4Q-Recorder/src/main/java/org/bench4q/recorder/httpcapture/RequestHandler.java +++ b/Bench4Q-Recorder/src/main/java/org/bench4q/recorder/httpcapture/RequestHandler.java @@ -207,7 +207,7 @@ public class RequestHandler implements Runnable { sb.append(changeList2String(headerMap.get(key)) + "\r\n"); continue; } - if(key.equals("Content-Length") && headerMap.get(key).get(0).equals("-1")){ + if(key.equals("Content-Length")){ sb.append("Content-Length: "+responseModel.getResponse().length +"\r\n"); continue; }