diff --git a/Bench4Q-Recorder/src/main/java/org/bench4q/recorder/httpcapture/generator/ResponseParser.java b/Bench4Q-Recorder/src/main/java/org/bench4q/recorder/httpcapture/generator/ResponseParser.java index 9db9f5d4..f37ec7a3 100644 --- a/Bench4Q-Recorder/src/main/java/org/bench4q/recorder/httpcapture/generator/ResponseParser.java +++ b/Bench4Q-Recorder/src/main/java/org/bench4q/recorder/httpcapture/generator/ResponseParser.java @@ -6,7 +6,6 @@ import java.nio.charset.Charset; import java.util.StringTokenizer; import org.apache.commons.httpclient.ChunkedInputStream; -import org.apache.commons.httpclient.ChunkedOutputStream; import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.log4j.Logger; @@ -172,13 +171,13 @@ public class ResponseParser { ChunkedInputStream chunkedIS = null; ByteArrayOutputStream out = new ByteArrayOutputStream(); try { - + chunkedIS = new ChunkedInputStream(in); int tempByte; - while ((tempByte = chunkedIS.read()) != -1){ + while ((tempByte = chunkedIS.read()) != -1) { out.write(tempByte); } - + return out.toByteArray(); } catch (IOException e) { // TODO Auto-generated catch block @@ -188,7 +187,7 @@ public class ResponseParser { if (chunkedIS != null) { chunkedIS.close(); } - if(out != null){ + if (out != null) { out.close(); } } catch (IOException e) { diff --git a/Bench4Q-Recorder/src/test/java/org/bench4q/recorder/Test_RequestHandler.java b/Bench4Q-Recorder/src/test/java/org/bench4q/recorder/Test_RequestHandler.java index 64206bdc..feebc503 100644 --- a/Bench4Q-Recorder/src/test/java/org/bench4q/recorder/Test_RequestHandler.java +++ b/Bench4Q-Recorder/src/test/java/org/bench4q/recorder/Test_RequestHandler.java @@ -1,7 +1,6 @@ package org.bench4q.recorder; import java.io.IOException; -import java.net.ServerSocket; import org.apache.commons.httpclient.HostConfiguration; import org.apache.commons.httpclient.HttpClient; @@ -15,6 +14,7 @@ import org.junit.Test; public class Test_RequestHandler { private static final int PORT = 8910; + @Test public void test() { try { @@ -34,6 +34,8 @@ public class Test_RequestHandler { private static class SendRequest implements Runnable { private HttpClient httpClient = new HttpClient(); + + @SuppressWarnings("deprecation") public void run() { HostConfiguration hostConfiguration = new HostConfiguration(); hostConfiguration.setProxy("127.0.0.1", PORT);