hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r937295 [8/9] - in /httpcomponents/httpcore/trunk/httpcore/src: main/java/org/apache/http/ main/java/org/apache/http/entity/ main/java/org/apache/http/impl/ main/java/org/apache/http/impl/entity/ main/java/org/apache/http/impl/io/ main/java...
Date Fri, 23 Apr 2010 13:44:05 GMT
Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestHeaderElement.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestHeaderElement.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestHeaderElement.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestHeaderElement.java Fri Apr 23 13:44:00 2010
@@ -50,7 +50,7 @@ public class TestHeaderElement extends T
     // ------------------------------------------------------- TestCase Methods
 
     public void testConstructor3() throws Exception {
-        HeaderElement element = new BasicHeaderElement("name", "value", 
+        HeaderElement element = new BasicHeaderElement("name", "value",
                 new NameValuePair[] {
                     new BasicNameValuePair("param1", "value1"),
                     new BasicNameValuePair("param2", "value2")
@@ -72,7 +72,7 @@ public class TestHeaderElement extends T
 
     public void testInvalidName() {
         try {
-            new BasicHeaderElement(null, null, null); 
+            new BasicHeaderElement(null, null, null);
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             //expected
@@ -81,7 +81,7 @@ public class TestHeaderElement extends T
 
     public void testParamByName() throws Exception {
         String s = "name = value; param1 = value1; param2 = value2";
-        HeaderElement element = BasicHeaderValueParser.parseHeaderElement(s, null); 
+        HeaderElement element = BasicHeaderValueParser.parseHeaderElement(s, null);
         assertEquals("value1", element.getParameterByName("param1").getValue());
         assertEquals("value2", element.getParameterByName("param2").getValue());
         assertNull(element.getParameterByName("param3"));
@@ -94,19 +94,19 @@ public class TestHeaderElement extends T
     }
 
     public void testHashCode() {
-        HeaderElement element1 = new BasicHeaderElement("name", "value", 
+        HeaderElement element1 = new BasicHeaderElement("name", "value",
                 new NameValuePair[] {
                     new BasicNameValuePair("param1", "value1"),
                     new BasicNameValuePair("param2", "value2")
                 } );
-        HeaderElement element2 = new BasicHeaderElement("name", "value", 
+        HeaderElement element2 = new BasicHeaderElement("name", "value",
                 new NameValuePair[] {
                     new BasicNameValuePair("param2", "value2"),
                     new BasicNameValuePair("param1", "value1")
                 } );
-        HeaderElement element3 = new BasicHeaderElement("name", "value"); 
-        HeaderElement element4 = new BasicHeaderElement("name", "value"); 
-        HeaderElement element5 = new BasicHeaderElement("name", "value", 
+        HeaderElement element3 = new BasicHeaderElement("name", "value");
+        HeaderElement element4 = new BasicHeaderElement("name", "value");
+        HeaderElement element5 = new BasicHeaderElement("name", "value",
                 new NameValuePair[] {
                     new BasicNameValuePair("param1", "value1"),
                     new BasicNameValuePair("param2", "value2")
@@ -117,21 +117,21 @@ public class TestHeaderElement extends T
         assertTrue(element3.hashCode() == element4.hashCode());
         assertTrue(element1.hashCode() == element5.hashCode());
     }
-    
+
     public void testEquals() {
-        HeaderElement element1 = new BasicHeaderElement("name", "value", 
+        HeaderElement element1 = new BasicHeaderElement("name", "value",
                 new NameValuePair[] {
                     new BasicNameValuePair("param1", "value1"),
                     new BasicNameValuePair("param2", "value2")
                 } );
-        HeaderElement element2 = new BasicHeaderElement("name", "value", 
+        HeaderElement element2 = new BasicHeaderElement("name", "value",
                 new NameValuePair[] {
                     new BasicNameValuePair("param2", "value2"),
                     new BasicNameValuePair("param1", "value1")
                 } );
-        HeaderElement element3 = new BasicHeaderElement("name", "value"); 
-        HeaderElement element4 = new BasicHeaderElement("name", "value"); 
-        HeaderElement element5 = new BasicHeaderElement("name", "value", 
+        HeaderElement element3 = new BasicHeaderElement("name", "value");
+        HeaderElement element4 = new BasicHeaderElement("name", "value");
+        HeaderElement element5 = new BasicHeaderElement("name", "value",
                 new NameValuePair[] {
                     new BasicNameValuePair("param1", "value1"),
                     new BasicNameValuePair("param2", "value2")
@@ -145,7 +145,7 @@ public class TestHeaderElement extends T
         assertFalse(element1.equals(null));
         assertFalse(element1.equals("name = value; param1 = value1; param2 = value2"));
     }
-    
+
     public void testToString() {
         String s = "name=value; param1=value1; param2=value2";
         HeaderElement element = BasicHeaderValueParser.parseHeaderElement(s, null);
@@ -154,9 +154,9 @@ public class TestHeaderElement extends T
         element = BasicHeaderValueParser.parseHeaderElement(s, null);
         assertEquals(s, element.toString());
     }
-    
+
     public void testCloning() throws Exception {
-        BasicHeaderElement orig = new BasicHeaderElement("name", "value", 
+        BasicHeaderElement orig = new BasicHeaderElement("name", "value",
                 new NameValuePair[] {
                     new BasicNameValuePair("param1", "value1"),
                     new BasicNameValuePair("param2", "value2")
@@ -164,5 +164,5 @@ public class TestHeaderElement extends T
         BasicHeaderElement clone = (BasicHeaderElement) orig.clone();
         assertEquals(orig, clone);
     }
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestHeaderGroup.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestHeaderGroup.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestHeaderGroup.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestHeaderGroup.java Fri Apr 23 13:44:00 2010
@@ -48,7 +48,7 @@ public class TestHeaderGroup extends Tes
         assertNotNull(headergroup.getAllHeaders());
         assertEquals(0, headergroup.getAllHeaders().length);
     }
-    
+
     public void testClear() {
         HeaderGroup headergroup = new HeaderGroup();
         headergroup.addHeader(new BasicHeader("name", "value"));
@@ -56,7 +56,7 @@ public class TestHeaderGroup extends Tes
         headergroup.clear();
         assertEquals(0, headergroup.getAllHeaders().length);
     }
-    
+
     public void testAddRemoveHeader() {
         HeaderGroup headergroup = new HeaderGroup();
         Header header = new BasicHeader("name", "value");
@@ -107,10 +107,10 @@ public class TestHeaderGroup extends Tes
         Header header2 = new BasicHeader("name", "value2");
         Header header3 = new BasicHeader("name", "value3");
         headergroup.setHeaders(new Header[] { header1, header2, header3 });
-        
+
         assertNull(headergroup.getFirstHeader("whatever"));
         assertNull(headergroup.getLastHeader("whatever"));
-        
+
         assertEquals("value1", headergroup.getFirstHeader("name").getValue());
         assertEquals("value3", headergroup.getLastHeader("name").getValue());
     }
@@ -118,12 +118,12 @@ public class TestHeaderGroup extends Tes
     public void testCondensedHeader() {
         HeaderGroup headergroup = new HeaderGroup();
         assertNull(headergroup.getCondensedHeader("name"));
-        
+
         Header header1 = new BasicHeader("name", "value1");
         Header header2 = new BasicHeader("name", "value2");
         Header header3 = new BasicHeader("name", "value3");
         headergroup.setHeaders(new Header[] { header1, header2, header3 });
-        
+
         assertEquals("value1, value2, value3", headergroup.getCondensedHeader("name").getValue());
 
         headergroup.setHeaders(new Header[] { header1 });
@@ -136,7 +136,7 @@ public class TestHeaderGroup extends Tes
         assertNotNull(i);
         assertFalse(i.hasNext());
     }
-    
+
     public void testHeaderRemove() {
         HeaderGroup headergroup = new HeaderGroup();
         Header header1 = new BasicHeader("name", "value1");
@@ -157,7 +157,7 @@ public class TestHeaderGroup extends Tes
         assertEquals(1, headergroup.getAllHeaders().length);
         assertFalse(i.hasNext());
     }
-    
+
     public void testCloning() throws Exception {
         HeaderGroup orig = new HeaderGroup();
         Header header1 = new BasicHeader("name", "value1");
@@ -174,5 +174,5 @@ public class TestHeaderGroup extends Tes
             assertEquals(headers1[i], headers2[i]);
         }
     }
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestNameValuePair.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestNameValuePair.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestNameValuePair.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestNameValuePair.java Fri Apr 23 13:44:00 2010
@@ -43,10 +43,10 @@ public class TestNameValuePair extends T
 
     public void testConstructor() {
         NameValuePair param = new BasicNameValuePair("name", "value");
-        assertEquals("name", param.getName()); 
-        assertEquals("value", param.getValue()); 
+        assertEquals("name", param.getName());
+        assertEquals("value", param.getValue());
     }
-    
+
     public void testInvalidName() {
         try {
             new BasicNameValuePair(null, null);
@@ -55,7 +55,7 @@ public class TestNameValuePair extends T
             //expected
         }
     }
-    
+
     public void testHashCode() {
         NameValuePair param1 = new BasicNameValuePair("name1", "value1");
         NameValuePair param2 = new BasicNameValuePair("name2", "value2");
@@ -63,7 +63,7 @@ public class TestNameValuePair extends T
         assertTrue(param1.hashCode() != param2.hashCode());
         assertTrue(param1.hashCode() == param3.hashCode());
     }
-    
+
     public void testEquals() {
         NameValuePair param1 = new BasicNameValuePair("name1", "value1");
         NameValuePair param2 = new BasicNameValuePair("name2", "value2");
@@ -75,18 +75,18 @@ public class TestNameValuePair extends T
         assertTrue(param2.equals(param2));
         assertTrue(param1.equals(param3));
     }
-    
+
     public void testToString() {
         NameValuePair param1 = new BasicNameValuePair("name1", "value1");
         assertEquals("name1=value1", param1.toString());
         NameValuePair param2 = new BasicNameValuePair("name1", null);
         assertEquals("name1", param2.toString());
     }
-    
+
     public void testCloning() throws Exception {
         BasicNameValuePair orig = new BasicNameValuePair("name1", "value1");
         BasicNameValuePair clone = (BasicNameValuePair) orig.clone();
         assertEquals(orig, clone);
     }
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestRequestLine.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestRequestLine.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestRequestLine.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestRequestLine.java Fri Apr 23 13:44:00 2010
@@ -48,11 +48,11 @@ public class TestRequestLine extends Tes
 
     public void testConstructor() {
         RequestLine requestline = new BasicRequestLine("GET", "/stuff", HttpVersion.HTTP_1_1);
-        assertEquals("GET", requestline.getMethod()); 
-        assertEquals("/stuff", requestline.getUri()); 
-        assertEquals(HttpVersion.HTTP_1_1, requestline.getProtocolVersion()); 
+        assertEquals("GET", requestline.getMethod());
+        assertEquals("/stuff", requestline.getUri());
+        assertEquals(HttpVersion.HTTP_1_1, requestline.getProtocolVersion());
     }
-        
+
     public void testConstructorInvalidInput() {
         try {
             new BasicRequestLine(null, "/stuff", HttpVersion.HTTP_1_1);
@@ -67,7 +67,7 @@ public class TestRequestLine extends Tes
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException e) { /* expected */ }
     }
-    
+
     public void testCloning() throws Exception {
         BasicRequestLine orig = new BasicRequestLine("GET", "/stuff", HttpVersion.HTTP_1_1);
         BasicRequestLine clone = (BasicRequestLine) orig.clone();
@@ -75,5 +75,5 @@ public class TestRequestLine extends Tes
         assertEquals(orig.getUri(), clone.getUri());
         assertEquals(orig.getProtocolVersion(), clone.getProtocolVersion());
     }
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestStatusLine.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestStatusLine.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestStatusLine.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestStatusLine.java Fri Apr 23 13:44:00 2010
@@ -36,7 +36,7 @@ import org.apache.http.StatusLine;
 /**
  * Simple tests for {@link StatusLine}.
  *
- * 
+ *
  * @version $Id$
  */
 public class TestStatusLine extends TestCase {
@@ -50,11 +50,11 @@ public class TestStatusLine extends Test
 
     public void testConstructor() {
         StatusLine statusline = new BasicStatusLine(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
-        assertEquals(HttpVersion.HTTP_1_1, statusline.getProtocolVersion()); 
-        assertEquals(HttpStatus.SC_OK, statusline.getStatusCode()); 
-        assertEquals("OK", statusline.getReasonPhrase()); 
+        assertEquals(HttpVersion.HTTP_1_1, statusline.getProtocolVersion());
+        assertEquals(HttpStatus.SC_OK, statusline.getStatusCode());
+        assertEquals("OK", statusline.getReasonPhrase());
     }
-        
+
     public void testConstructorInvalidInput() {
         try {
             new BasicStatusLine(null, HttpStatus.SC_OK, "OK");
@@ -73,7 +73,7 @@ public class TestStatusLine extends Test
         // toString uses default formatting, hence the trailing space
         assertEquals("HTTP/1.1 200 ", statusline.toString());
     }
-    
+
     public void testCloning() throws Exception {
         BasicStatusLine orig = new BasicStatusLine(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
         BasicStatusLine clone = (BasicStatusLine) orig.clone();
@@ -81,5 +81,5 @@ public class TestStatusLine extends Test
         assertEquals(orig.getStatusCode(), clone.getStatusCode());
         assertEquals(orig.getProtocolVersion(), clone.getProtocolVersion());
     }
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/HttpConnectionMockup.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/HttpConnectionMockup.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/HttpConnectionMockup.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/HttpConnectionMockup.java Fri Apr 23 13:44:00 2010
@@ -39,34 +39,34 @@ import org.apache.http.HttpConnectionMet
 public class HttpConnectionMockup implements HttpConnection {
 
     private boolean open = true;
-    
+
     public HttpConnectionMockup() {
         super();
     }
-    
+
     public void close() throws IOException {
         this.open = false;
     }
-    
+
     public void shutdown() throws IOException {
         this.open = false;
     }
-    
+
     public void setSocketTimeout(int timeout) {
     }
 
     public int getSocketTimeout() {
         return -1;
     }
-    
+
     public boolean isOpen() {
         return this.open;
     }
-    
+
     public boolean isStale() {
         return false;
     }
-    
+
     public HttpConnectionMetrics getMetrics() {
         return null;
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/HttpEntityMockup.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/HttpEntityMockup.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/HttpEntityMockup.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/HttpEntityMockup.java Fri Apr 23 13:44:00 2010
@@ -40,7 +40,7 @@ import org.apache.http.entity.AbstractHt
 public class HttpEntityMockup extends AbstractHttpEntity {
 
     private boolean stream;
-    
+
     public InputStream getContent() throws IOException, IllegalStateException {
         return null;
     }
@@ -62,6 +62,6 @@ public class HttpEntityMockup extends Ab
     }
 
     public void writeTo(OutputStream outstream) throws IOException {
-    }    
-    
+    }
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/HttpMessageMockup.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/HttpMessageMockup.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/HttpMessageMockup.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/HttpMessageMockup.java Fri Apr 23 13:44:00 2010
@@ -33,10 +33,10 @@ import org.apache.http.params.HttpProtoc
 
 /**
  *  {@link org.apache.http.HttpMessage} mockup implementation.
- *  
+ *
  */
 public class HttpMessageMockup extends AbstractHttpMessage {
-    
+
     public HttpMessageMockup() {
         super();
     }
@@ -44,5 +44,5 @@ public class HttpMessageMockup extends A
     public ProtocolVersion getProtocolVersion() {
         return HttpProtocolParams.getVersion(this.getParams());
     }
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/SessionInputBufferMockup.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/SessionInputBufferMockup.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/SessionInputBufferMockup.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/SessionInputBufferMockup.java Fri Apr 23 13:44:00 2010
@@ -42,23 +42,23 @@ import org.apache.http.params.HttpParams
 public class SessionInputBufferMockup extends AbstractSessionInputBuffer {
 
     public static final int BUFFER_SIZE = 16;
-    
+
     public SessionInputBufferMockup(
-            final InputStream instream, 
-            int buffersize, 
+            final InputStream instream,
+            int buffersize,
             final HttpParams params) {
         super();
         init(instream, buffersize, params);
     }
 
     public SessionInputBufferMockup(
-            final InputStream instream, 
+            final InputStream instream,
             int buffersize) {
         this(instream, buffersize, new BasicHttpParams());
     }
 
     public SessionInputBufferMockup(
-            final byte[] bytes, 
+            final byte[] bytes,
             final HttpParams params) {
         this(bytes, BUFFER_SIZE, params);
     }
@@ -69,53 +69,53 @@ public class SessionInputBufferMockup ex
     }
 
     public SessionInputBufferMockup(
-            final byte[] bytes, 
-            int buffersize, 
+            final byte[] bytes,
+            int buffersize,
             final HttpParams params) {
         this(new ByteArrayInputStream(bytes), buffersize, params);
     }
 
     public SessionInputBufferMockup(
-            final byte[] bytes, 
+            final byte[] bytes,
             int buffersize) {
         this(new ByteArrayInputStream(bytes), buffersize, new BasicHttpParams());
     }
 
     public SessionInputBufferMockup(
-            final String s, 
-            final String charset, 
+            final String s,
+            final String charset,
             int buffersize,
-            final HttpParams params) 
+            final HttpParams params)
         throws UnsupportedEncodingException {
         this(s.getBytes(charset), buffersize, params);
     }
-    
+
     public SessionInputBufferMockup(
-            final String s, 
-            final String charset, 
-            int buffersize) 
+            final String s,
+            final String charset,
+            int buffersize)
         throws UnsupportedEncodingException {
         this(s.getBytes(charset), buffersize, new BasicHttpParams());
     }
-    
+
     public SessionInputBufferMockup(
-            final String s, 
+            final String s,
             final String charset,
-            final HttpParams params) 
+            final HttpParams params)
         throws UnsupportedEncodingException {
         this(s.getBytes(charset), params);
     }
-    
+
     public SessionInputBufferMockup(
-            final String s, 
-            final String charset) 
+            final String s,
+            final String charset)
         throws UnsupportedEncodingException {
         this(s.getBytes(charset), new BasicHttpParams());
-    
+
     }
-    
+
     public boolean isDataAvailable(int timeout) throws IOException {
         return true;
     }
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/SessionOutputBufferMockup.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/SessionOutputBufferMockup.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/SessionOutputBufferMockup.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/SessionOutputBufferMockup.java Fri Apr 23 13:44:00 2010
@@ -42,9 +42,9 @@ public class SessionOutputBufferMockup e
 
     private ByteArrayOutputStream buffer = new ByteArrayOutputStream();
     public static final int BUFFER_SIZE = 16;
-    
+
     public SessionOutputBufferMockup(
-            final OutputStream outstream, 
+            final OutputStream outstream,
             int buffersize,
             final HttpParams params) {
         super();
@@ -52,7 +52,7 @@ public class SessionOutputBufferMockup e
     }
 
     public SessionOutputBufferMockup(
-            final OutputStream outstream, 
+            final OutputStream outstream,
             int buffersize) {
         this(outstream, buffersize, new BasicHttpParams());
     }
@@ -85,5 +85,5 @@ public class SessionOutputBufferMockup e
             return new byte[] {};
         }
     }
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/TestHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/TestHttpClient.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/TestHttpClient.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/TestHttpClient.java Fri Apr 23 13:44:00 2010
@@ -62,7 +62,7 @@ public class TestHttpClient {
     private final HttpRequestExecutor httpexecutor;
     private final ConnectionReuseStrategy connStrategy;
     private final HttpContext context;
-    
+
     public TestHttpClient() {
         super();
         this.params = new SyncBasicHttpParams();
@@ -77,7 +77,7 @@ public class TestHttpClient {
                         new RequestTargetHost(),
                         new RequestConnControl(),
                         new RequestUserAgent(),
-                        new RequestExpectContinue()                        
+                        new RequestExpectContinue()
                 });
         this.httpexecutor = new HttpRequestExecutor();
         this.connStrategy = new DefaultConnectionReuseStrategy();
@@ -87,7 +87,7 @@ public class TestHttpClient {
     public HttpParams getParams() {
         return this.params;
     }
-    
+
     public HttpResponse execute(
             final HttpRequest request,
             final HttpHost targetHost,
@@ -103,9 +103,9 @@ public class TestHttpClient {
         this.httpexecutor.postProcess(response, this.httpproc, this.context);
         return response;
     }
-    
+
     public boolean keepAlive(final HttpResponse response) {
         return this.connStrategy.keepAlive(response, this.context);
     }
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/TestHttpServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/TestHttpServer.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/TestHttpServer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/TestHttpServer.java Fri Apr 23 13:44:00 2010
@@ -61,18 +61,18 @@ import org.apache.http.protocol.Response
 
 public class TestHttpServer {
 
-    private final HttpParams params; 
+    private final HttpParams params;
     private final HttpProcessor httpproc;
     private final ConnectionReuseStrategy connStrategy;
     private final HttpResponseFactory responseFactory;
     private final HttpRequestHandlerRegistry reqistry;
     private final ServerSocket serversocket;
-    
+
     private HttpExpectationVerifier expectationVerifier;
-    
+
     private Thread listener;
     private volatile boolean shutdown;
-    
+
     public TestHttpServer() throws IOException {
         super();
         this.params = new SyncBasicHttpParams();
@@ -94,38 +94,38 @@ public class TestHttpServer {
         this.reqistry = new HttpRequestHandlerRegistry();
         this.serversocket = new ServerSocket(0);
     }
-    
+
     public void registerHandler(
-            final String pattern, 
+            final String pattern,
             final HttpRequestHandler handler) {
         this.reqistry.register(pattern, handler);
     }
-    
+
     public void setExpectationVerifier(final HttpExpectationVerifier expectationVerifier) {
         this.expectationVerifier = expectationVerifier;
     }
-    
+
     private HttpServerConnection acceptConnection() throws IOException {
         Socket socket = this.serversocket.accept();
         DefaultHttpServerConnection conn = new DefaultHttpServerConnection();
         conn.bind(socket, this.params);
         return conn;
     }
-    
+
     public int getPort() {
         return this.serversocket.getLocalPort();
     }
-    
+
     public InetAddress getInetAddress() {
         return this.serversocket.getInetAddress();
     }
-    
+
     public void start() {
         if (this.listener != null) {
             throw new IllegalStateException("Listener already running");
         }
         this.listener = new Thread(new Runnable() {
-           
+
             public void run() {
                 while (!shutdown && !Thread.interrupted()) {
                     try {
@@ -133,7 +133,7 @@ public class TestHttpServer {
                         HttpServerConnection conn = acceptConnection();
                         // Set up the HTTP service
                         HttpService httpService = new HttpService(
-                                httpproc, 
+                                httpproc,
                                 connStrategy,
                                 responseFactory,
                                 reqistry,
@@ -150,7 +150,7 @@ public class TestHttpServer {
                     }
                 }
             }
-            
+
         });
         this.listener.start();
     }
@@ -168,20 +168,20 @@ public class TestHttpServer {
             this.listener.join(1000);
         } catch (InterruptedException ignore) {}
     }
-    
+
     static class WorkerThread extends Thread {
 
         private final HttpService httpservice;
         private final HttpServerConnection conn;
-        
+
         public WorkerThread(
-                final HttpService httpservice, 
+                final HttpService httpservice,
                 final HttpServerConnection conn) {
             super();
             this.httpservice = httpservice;
             this.conn = conn;
         }
-        
+
         public void run() {
             HttpContext context = new BasicHttpContext(null);
             try {
@@ -201,5 +201,5 @@ public class TestHttpServer {
         }
 
     }
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/TimeoutByteArrayInputStream.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/TimeoutByteArrayInputStream.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/TimeoutByteArrayInputStream.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/TimeoutByteArrayInputStream.java Fri Apr 23 13:44:00 2010
@@ -33,26 +33,26 @@ import java.io.InterruptedIOException;
 
 /**
  * Test class similar to {@link java.io.ByteArrayInputStream} that throws if encounters
- * value zero '\000' in the source byte array. 
+ * value zero '\000' in the source byte array.
  */
 public class TimeoutByteArrayInputStream extends InputStream {
-    
+
     private final byte[] buf;
-    
+
     private int pos;
     protected int count;
-    
+
     public TimeoutByteArrayInputStream(byte[] buf, int off, int len) {
         super();
         this.buf = buf;
         this.pos = off;
         this.count = Math.min(off + len, buf.length);
     }
-    
+
     public TimeoutByteArrayInputStream(byte[] buf) {
         this(buf, 0, buf.length);
     }
-    
+
     public int read() throws IOException {
         if (this.pos < this.count) {
             return -1;
@@ -64,7 +64,7 @@ public class TimeoutByteArrayInputStream
             throw new InterruptedIOException("Timeout");
         }
     }
-    
+
     public int read(byte b[], int off, int len) throws IOException {
         if (b == null) {
             throw new NullPointerException();
@@ -96,7 +96,7 @@ public class TimeoutByteArrayInputStream
         }
         return len;
     }
- 
+
     public long skip(long n) {
         if (this.pos + n > this.count) {
             n = this.count - this.pos;
@@ -111,9 +111,9 @@ public class TimeoutByteArrayInputStream
     public int available() {
         return this.count - this.pos;
     }
-    
+
     public boolean markSupported() {
         return false;
     }
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/params/TestBasicHttpParams.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/params/TestBasicHttpParams.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/params/TestBasicHttpParams.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/params/TestBasicHttpParams.java Fri Apr 23 13:44:00 2010
@@ -42,14 +42,14 @@ public class TestBasicHttpParams extends
     public void testRemoveParam() {
         BasicHttpParams params = new BasicHttpParams();
         params.setParameter("param1", "paramValue1");
-        assertTrue("The parameter should be removed successfully", 
+        assertTrue("The parameter should be removed successfully",
                 params.removeParameter("param1"));
-        assertFalse("The parameter should not be present", 
+        assertFalse("The parameter should not be present",
                 params.removeParameter("param1"));
-        
+
         //try a remove from an empty params
         params = new BasicHttpParams();
-        assertFalse("The parameter should not be present", 
+        assertFalse("The parameter should not be present",
                 params.removeParameter("param1"));
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestBasicHttpProcessor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestBasicHttpProcessor.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestBasicHttpProcessor.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestBasicHttpProcessor.java Fri Apr 23 13:44:00 2010
@@ -40,9 +40,9 @@ import org.apache.http.HttpRequestInterc
 public class TestBasicHttpProcessor extends TestCase {
 
     static class TestHttpRequestInterceptorPlaceHolder implements HttpRequestInterceptor {
-        
+
         public void process(
-                HttpRequest request, 
+                HttpRequest request,
                 HttpContext context) throws HttpException, IOException {
         }
     }
@@ -111,12 +111,12 @@ public class TestBasicHttpProcessor exte
         HttpRequestInterceptor itcp1 = new TestHttpRequestInterceptorPlaceHolder();
         HttpRequestInterceptor itcp2 = new TestHttpRequestInterceptorPlaceHolder();
         HttpRequestInterceptor itcp3 = new HttpRequestInterceptor() {
-            
+
             public void process(
-                    HttpRequest request, 
+                    HttpRequest request,
                     HttpContext context) throws HttpException, IOException {
             }
-            
+
         };
         BasicHttpProcessor instance = new BasicHttpProcessor();
         instance.addRequestInterceptor(itcp1);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestHttpExecutionContext.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestHttpExecutionContext.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestHttpExecutionContext.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestHttpExecutionContext.java Fri Apr 23 13:44:00 2010
@@ -41,23 +41,23 @@ public class TestHttpExecutionContext ex
     // ------------------------------------------------------- TestCase Methods
 
     public void testContextOperations() {
-        HttpContext parentContext = new SyncBasicHttpContext(null); 
-        HttpContext currentContext = new SyncBasicHttpContext(parentContext); 
+        HttpContext parentContext = new SyncBasicHttpContext(null);
+        HttpContext currentContext = new SyncBasicHttpContext(parentContext);
 
         parentContext.setAttribute("param1", "1");
         parentContext.setAttribute("param2", "2");
         currentContext.setAttribute("param3", "3");
         currentContext.setAttribute("param2", "4");
-        
+
         assertEquals("1", parentContext.getAttribute("param1"));
         assertEquals("2", parentContext.getAttribute("param2"));
         assertEquals(null, parentContext.getAttribute("param3"));
-        
+
         assertEquals("1", currentContext.getAttribute("param1"));
         assertEquals("4", currentContext.getAttribute("param2"));
         assertEquals("3", currentContext.getAttribute("param3"));
         assertEquals(null, currentContext.getAttribute("param4"));
-        
+
         currentContext.removeAttribute("param1");
         currentContext.removeAttribute("param2");
         currentContext.removeAttribute("param3");
@@ -70,14 +70,14 @@ public class TestHttpExecutionContext ex
     }
 
     public void testEmptyContextOperations() {
-        HttpContext currentContext = new SyncBasicHttpContext(null); 
+        HttpContext currentContext = new SyncBasicHttpContext(null);
         assertEquals(null, currentContext.getAttribute("param1"));
         currentContext.removeAttribute("param1");
         assertEquals(null, currentContext.getAttribute("param1"));
     }
 
     public void testContextInvalidInput() throws Exception {
-        HttpContext currentContext = new SyncBasicHttpContext(null); 
+        HttpContext currentContext = new SyncBasicHttpContext(null);
         try {
             currentContext.setAttribute(null, null);
             fail("IllegalArgumentException should have been thrown");
@@ -97,5 +97,5 @@ public class TestHttpExecutionContext ex
             // expected
         }
     }
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestHttpRequestHandlerRegistry.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestHttpRequestHandlerRegistry.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestHttpRequestHandlerRegistry.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestHttpRequestHandlerRegistry.java Fri Apr 23 13:44:00 2010
@@ -48,25 +48,25 @@ public class TestHttpRequestHandlerRegis
     private static class DummyHttpRequestHandler implements HttpRequestHandler {
 
         public void handle(
-                final HttpRequest request, 
-                final HttpResponse response, 
+                final HttpRequest request,
+                final HttpResponse response,
                 final HttpContext context) throws HttpException, IOException {
         }
-        
+
     }
-    
+
     public void testRegisterUnregister() throws Exception {
         HttpRequestHandler h1 = new DummyHttpRequestHandler();
         HttpRequestHandler h2 = new DummyHttpRequestHandler();
         HttpRequestHandler h3 = new DummyHttpRequestHandler();
-        
+
         HttpRequestHandlerRegistry registry = new HttpRequestHandlerRegistry();
         registry.register("/h1", h1);
         registry.register("/h2", h2);
         registry.register("/h3", h3);
-        
+
         HttpRequestHandler h;
-        
+
         h = registry.lookup("/h1");
         assertNotNull(h);
         assertTrue(h1 == h);
@@ -76,11 +76,11 @@ public class TestHttpRequestHandlerRegis
         h = registry.lookup("/h3");
         assertNotNull(h);
         assertTrue(h3 == h);
-        
+
         registry.unregister("/h1");
         h = registry.lookup("/h1");
         assertNull(h);
-        
+
         Map map = new HashMap();
         map.put("/a1", h1);
         map.put("/a2", h2);
@@ -96,25 +96,25 @@ public class TestHttpRequestHandlerRegis
         assertNotNull(h);
         assertTrue(h1 == h);
     }
-    
+
     public void testWildCardMatching1() throws Exception {
         HttpRequestHandler h1 = new DummyHttpRequestHandler();
         HttpRequestHandler h2 = new DummyHttpRequestHandler();
         HttpRequestHandler h3 = new DummyHttpRequestHandler();
         HttpRequestHandler def = new DummyHttpRequestHandler();
-        
+
         HttpRequestHandlerRegistry registry = new HttpRequestHandlerRegistry();
         registry.register("*", def);
         registry.register("/one/*", h1);
         registry.register("/one/two/*", h2);
         registry.register("/one/two/three/*", h3);
-        
+
         HttpRequestHandler h;
-        
+
         h = registry.lookup("/one/request");
         assertNotNull(h);
         assertTrue(h1 == h);
-        
+
         h = registry.lookup("/one/two/request");
         assertNotNull(h);
         assertTrue(h2 == h);
@@ -132,18 +132,18 @@ public class TestHttpRequestHandlerRegis
         HttpRequestHandler h1 = new DummyHttpRequestHandler();
         HttpRequestHandler h2 = new DummyHttpRequestHandler();
         HttpRequestHandler def = new DummyHttpRequestHandler();
-        
+
         HttpRequestHandlerRegistry registry = new HttpRequestHandlerRegistry();
         registry.register("*", def);
         registry.register("*.view", h1);
         registry.register("*.form", h2);
-        
+
         HttpRequestHandler h;
-        
+
         h = registry.lookup("/that.view");
         assertNotNull(h);
         assertTrue(h1 == h);
-        
+
         h = registry.lookup("/that.form");
         assertNotNull(h);
         assertTrue(h2 == h);
@@ -157,18 +157,18 @@ public class TestHttpRequestHandlerRegis
         HttpRequestHandler h1 = new DummyHttpRequestHandler();
         HttpRequestHandler h2 = new DummyHttpRequestHandler();
         HttpRequestHandler def = new DummyHttpRequestHandler();
-        
+
         HttpRequestHandlerRegistry registry = new HttpRequestHandlerRegistry();
         registry.register("*", def);
         registry.register("*.view", h1);
         registry.register("*.form", h2);
-        
+
         HttpRequestHandler h;
-        
+
         h = registry.lookup("/that.view?param=value");
         assertNotNull(h);
         assertTrue(h1 == h);
-        
+
         h = registry.lookup("/that.form?whatever");
         assertNotNull(h);
         assertTrue(h2 == h);
@@ -181,13 +181,13 @@ public class TestHttpRequestHandlerRegis
     public void testSuffixPatternOverPrefixPatternMatch() throws Exception {
         HttpRequestHandler h1 = new DummyHttpRequestHandler();
         HttpRequestHandler h2 = new DummyHttpRequestHandler();
-        
+
         HttpRequestHandlerRegistry registry = new HttpRequestHandlerRegistry();
         registry.register("/ma*", h1);
         registry.register("*tch", h2);
-        
+
         HttpRequestHandler h;
-        
+
         h = registry.lookup("/match");
         assertNotNull(h);
         assertTrue(h1 == h);
@@ -201,7 +201,7 @@ public class TestHttpRequestHandlerRegis
         } catch (IllegalArgumentException ex) {
             // expected
         }
-        
+
         try {
             registry.register("", null);
             fail("IllegalArgumentException should have been thrown");
@@ -210,14 +210,14 @@ public class TestHttpRequestHandlerRegis
         }
 
         registry.unregister(null);
-        
+
         try {
             registry.setHandlers(null);
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
         }
-        
+
         try {
             registry.lookup(null);
             fail("IllegalArgumentException should have been thrown");
@@ -225,5 +225,5 @@ public class TestHttpRequestHandlerRegis
             // expected
         }
     }
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestHttpServiceAndExecutor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestHttpServiceAndExecutor.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestHttpServiceAndExecutor.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestHttpServiceAndExecutor.java Fri Apr 23 13:44:00 2010
@@ -74,7 +74,7 @@ public class TestHttpServiceAndExecutor 
 
     private TestHttpServer server;
     private TestHttpClient client;
-    
+
     protected void setUp() throws Exception {
         this.server = new TestHttpServer();
         this.client = new TestHttpClient();
@@ -85,14 +85,14 @@ public class TestHttpServiceAndExecutor 
     }
 
     /**
-     * This test case executes a series of simple GET requests 
+     * This test case executes a series of simple GET requests
      */
     public void testSimpleBasicHttpRequests() throws Exception {
-        
+
         int reqNo = 20;
-        
+
         Random rnd = new Random();
-        
+
         // Prepare some random data
         final List testData = new ArrayList(reqNo);
         for (int i = 0; i < reqNo; i++) {
@@ -106,39 +106,39 @@ public class TestHttpServiceAndExecutor 
         this.server.registerHandler("*", new HttpRequestHandler() {
 
             public void handle(
-                    final HttpRequest request, 
-                    final HttpResponse response, 
+                    final HttpRequest request,
+                    final HttpResponse response,
                     final HttpContext context) throws HttpException, IOException {
-                
+
                 String s = request.getRequestLine().getUri();
                 if (s.startsWith("/?")) {
                     s = s.substring(2);
                 }
                 int index = Integer.parseInt(s);
                 byte[] data = (byte []) testData.get(index);
-                ByteArrayEntity entity = new ByteArrayEntity(data); 
+                ByteArrayEntity entity = new ByteArrayEntity(data);
                 response.setEntity(entity);
             }
-            
+
         });
-        
+
         this.server.start();
-        
+
         DefaultHttpClientConnection conn = new DefaultHttpClientConnection();
         HttpHost host = new HttpHost("localhost", this.server.getPort());
-        
+
         try {
             for (int r = 0; r < reqNo; r++) {
                 if (!conn.isOpen()) {
                     Socket socket = new Socket(host.getHostName(), host.getPort());
                     conn.bind(socket, this.client.getParams());
                 }
-                
+
                 BasicHttpRequest get = new BasicHttpRequest("GET", "/?" + r);
                 HttpResponse response = this.client.execute(get, host, conn);
                 byte[] received = EntityUtils.toByteArray(response.getEntity());
                 byte[] expected = (byte[]) testData.get(r);
-                
+
                 assertEquals(expected.length, received.length);
                 for (int i = 0; i < expected.length; i++) {
                     assertEquals(expected[i], received[i]);
@@ -147,12 +147,12 @@ public class TestHttpServiceAndExecutor 
                     conn.close();
                 }
             }
-            
+
             //Verify the connection metrics
             HttpConnectionMetrics cm = conn.getMetrics();
             assertEquals(reqNo, cm.getRequestCount());
             assertEquals(reqNo, cm.getResponseCount());
-            
+
         } finally {
             conn.close();
             this.server.shutdown();
@@ -160,15 +160,15 @@ public class TestHttpServiceAndExecutor 
     }
 
     /**
-     * This test case executes a series of simple POST requests with content length 
-     * delimited content. 
+     * This test case executes a series of simple POST requests with content length
+     * delimited content.
      */
     public void testSimpleHttpPostsWithContentLength() throws Exception {
-        
+
         int reqNo = 20;
-        
+
         Random rnd = new Random();
-        
+
         // Prepare some random data
         List testData = new ArrayList(reqNo);
         for (int i = 0; i < reqNo; i++) {
@@ -182,37 +182,37 @@ public class TestHttpServiceAndExecutor 
         this.server.registerHandler("*", new HttpRequestHandler() {
 
             public void handle(
-                    final HttpRequest request, 
-                    final HttpResponse response, 
+                    final HttpRequest request,
+                    final HttpResponse response,
                     final HttpContext context) throws HttpException, IOException {
-                
+
                 if (request instanceof HttpEntityEnclosingRequest) {
                     HttpEntity incoming = ((HttpEntityEnclosingRequest) request).getEntity();
                     byte[] data = EntityUtils.toByteArray(incoming);
-                    
+
                     ByteArrayEntity outgoing = new ByteArrayEntity(data);
                     outgoing.setChunked(false);
                     response.setEntity(outgoing);
                 } else {
-                    StringEntity outgoing = new StringEntity("No content"); 
+                    StringEntity outgoing = new StringEntity("No content");
                     response.setEntity(outgoing);
                 }
             }
-            
+
         });
-        
+
         this.server.start();
-        
+
         DefaultHttpClientConnection conn = new DefaultHttpClientConnection();
         HttpHost host = new HttpHost("localhost", this.server.getPort());
-        
+
         try {
             for (int r = 0; r < reqNo; r++) {
                 if (!conn.isOpen()) {
                     Socket socket = new Socket(host.getHostName(), host.getPort());
                     conn.bind(socket, this.client.getParams());
                 }
-                
+
                 BasicHttpEntityEnclosingRequest post = new BasicHttpEntityEnclosingRequest("POST", "/");
                 byte[] data = (byte[]) testData.get(r);
                 ByteArrayEntity outgoing = new ByteArrayEntity(data);
@@ -221,7 +221,7 @@ public class TestHttpServiceAndExecutor 
                 HttpResponse response = this.client.execute(post, host, conn);
                 byte[] received = EntityUtils.toByteArray(response.getEntity());
                 byte[] expected = (byte[]) testData.get(r);
-                
+
                 assertEquals(expected.length, received.length);
                 for (int i = 0; i < expected.length; i++) {
                     assertEquals(expected[i], received[i]);
@@ -234,7 +234,7 @@ public class TestHttpServiceAndExecutor 
             HttpConnectionMetrics cm = conn.getMetrics();
             assertEquals(reqNo, cm.getRequestCount());
             assertEquals(reqNo, cm.getResponseCount());
-            
+
         } finally {
             conn.close();
             this.server.shutdown();
@@ -242,15 +242,15 @@ public class TestHttpServiceAndExecutor 
     }
 
     /**
-     * This test case executes a series of simple POST requests with chunk 
-     * coded content content. 
+     * This test case executes a series of simple POST requests with chunk
+     * coded content content.
      */
     public void testSimpleHttpPostsChunked() throws Exception {
-        
+
         int reqNo = 20;
-        
+
         Random rnd = new Random();
-        
+
         // Prepare some random data
         List testData = new ArrayList(reqNo);
         for (int i = 0; i < reqNo; i++) {
@@ -264,37 +264,37 @@ public class TestHttpServiceAndExecutor 
         this.server.registerHandler("*", new HttpRequestHandler() {
 
             public void handle(
-                    final HttpRequest request, 
-                    final HttpResponse response, 
+                    final HttpRequest request,
+                    final HttpResponse response,
                     final HttpContext context) throws HttpException, IOException {
-                
+
                 if (request instanceof HttpEntityEnclosingRequest) {
                     HttpEntity incoming = ((HttpEntityEnclosingRequest) request).getEntity();
                     byte[] data = EntityUtils.toByteArray(incoming);
-                    
+
                     ByteArrayEntity outgoing = new ByteArrayEntity(data);
                     outgoing.setChunked(true);
                     response.setEntity(outgoing);
                 } else {
-                    StringEntity outgoing = new StringEntity("No content"); 
+                    StringEntity outgoing = new StringEntity("No content");
                     response.setEntity(outgoing);
                 }
             }
-            
+
         });
-        
+
         this.server.start();
-        
+
         DefaultHttpClientConnection conn = new DefaultHttpClientConnection();
         HttpHost host = new HttpHost("localhost", this.server.getPort());
-        
+
         try {
             for (int r = 0; r < reqNo; r++) {
                 if (!conn.isOpen()) {
                     Socket socket = new Socket(host.getHostName(), host.getPort());
                     conn.bind(socket, this.client.getParams());
                 }
-                
+
                 BasicHttpEntityEnclosingRequest post = new BasicHttpEntityEnclosingRequest("POST", "/");
                 byte[] data = (byte[]) testData.get(r);
                 ByteArrayEntity outgoing = new ByteArrayEntity(data);
@@ -304,7 +304,7 @@ public class TestHttpServiceAndExecutor 
                 HttpResponse response = this.client.execute(post, host, conn);
                 byte[] received = EntityUtils.toByteArray(response.getEntity());
                 byte[] expected = (byte[]) testData.get(r);
-                
+
                 assertEquals(expected.length, received.length);
                 for (int i = 0; i < expected.length; i++) {
                     assertEquals(expected[i], received[i]);
@@ -324,14 +324,14 @@ public class TestHttpServiceAndExecutor 
     }
 
     /**
-     * This test case executes a series of simple HTTP/1.0 POST requests. 
+     * This test case executes a series of simple HTTP/1.0 POST requests.
      */
     public void testSimpleHttpPostsHTTP10() throws Exception {
-        
+
         int reqNo = 20;
-        
+
         Random rnd = new Random();
-        
+
         // Prepare some random data
         List testData = new ArrayList(reqNo);
         for (int i = 0; i < reqNo; i++) {
@@ -345,41 +345,41 @@ public class TestHttpServiceAndExecutor 
         this.server.registerHandler("*", new HttpRequestHandler() {
 
             public void handle(
-                    final HttpRequest request, 
-                    final HttpResponse response, 
+                    final HttpRequest request,
+                    final HttpResponse response,
                     final HttpContext context) throws HttpException, IOException {
-                
+
                 if (request instanceof HttpEntityEnclosingRequest) {
                     HttpEntity incoming = ((HttpEntityEnclosingRequest) request).getEntity();
                     byte[] data = EntityUtils.toByteArray(incoming);
-                    
+
                     ByteArrayEntity outgoing = new ByteArrayEntity(data);
                     outgoing.setChunked(false);
                     response.setEntity(outgoing);
                 } else {
-                    StringEntity outgoing = new StringEntity("No content"); 
+                    StringEntity outgoing = new StringEntity("No content");
                     response.setEntity(outgoing);
                 }
             }
-            
+
         });
-        
+
         this.server.start();
-        
+
         // Set protocol level to HTTP/1.0
         this.client.getParams().setParameter(
                 CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_0);
-        
+
         DefaultHttpClientConnection conn = new DefaultHttpClientConnection();
         HttpHost host = new HttpHost("localhost", this.server.getPort());
-        
+
         try {
             for (int r = 0; r < reqNo; r++) {
                 if (!conn.isOpen()) {
                     Socket socket = new Socket(host.getHostName(), host.getPort());
                     conn.bind(socket, this.client.getParams());
                 }
-                
+
                 BasicHttpEntityEnclosingRequest post = new BasicHttpEntityEnclosingRequest("POST", "/");
                 byte[] data = (byte[]) testData.get(r);
                 ByteArrayEntity outgoing = new ByteArrayEntity(data);
@@ -389,7 +389,7 @@ public class TestHttpServiceAndExecutor 
                 assertEquals(HttpVersion.HTTP_1_0, response.getStatusLine().getProtocolVersion());
                 byte[] received = EntityUtils.toByteArray(response.getEntity());
                 byte[] expected = (byte[]) testData.get(r);
-                
+
                 assertEquals(expected.length, received.length);
                 for (int i = 0; i < expected.length; i++) {
                     assertEquals(expected[i], received[i]);
@@ -398,7 +398,7 @@ public class TestHttpServiceAndExecutor 
                     conn.close();
                 }
             }
-            
+
             //Verify the connection metrics
             HttpConnectionMetrics cm = conn.getMetrics();
             assertEquals(reqNo, cm.getRequestCount());
@@ -410,15 +410,15 @@ public class TestHttpServiceAndExecutor 
     }
 
     /**
-     * This test case executes a series of simple POST requests using 
-     * the 'expect: continue' handshake. 
+     * This test case executes a series of simple POST requests using
+     * the 'expect: continue' handshake.
      */
     public void testHttpPostsWithExpectContinue() throws Exception {
-        
+
         int reqNo = 20;
-        
+
         Random rnd = new Random();
-        
+
         // Prepare some random data
         List testData = new ArrayList(reqNo);
         for (int i = 0; i < reqNo; i++) {
@@ -432,40 +432,40 @@ public class TestHttpServiceAndExecutor 
         this.server.registerHandler("*", new HttpRequestHandler() {
 
             public void handle(
-                    final HttpRequest request, 
-                    final HttpResponse response, 
+                    final HttpRequest request,
+                    final HttpResponse response,
                     final HttpContext context) throws HttpException, IOException {
-                
+
                 if (request instanceof HttpEntityEnclosingRequest) {
                     HttpEntity incoming = ((HttpEntityEnclosingRequest) request).getEntity();
                     byte[] data = EntityUtils.toByteArray(incoming);
-                    
+
                     ByteArrayEntity outgoing = new ByteArrayEntity(data);
                     outgoing.setChunked(true);
                     response.setEntity(outgoing);
                 } else {
-                    StringEntity outgoing = new StringEntity("No content"); 
+                    StringEntity outgoing = new StringEntity("No content");
                     response.setEntity(outgoing);
                 }
             }
-            
+
         });
-        
+
         this.server.start();
-        
+
         // Activate 'expect: continue' handshake
         this.client.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
-        
+
         DefaultHttpClientConnection conn = new DefaultHttpClientConnection();
         HttpHost host = new HttpHost("localhost", this.server.getPort());
-        
+
         try {
             for (int r = 0; r < reqNo; r++) {
                 if (!conn.isOpen()) {
                     Socket socket = new Socket(host.getHostName(), host.getPort());
                     conn.bind(socket, this.client.getParams());
                 }
-                
+
                 BasicHttpEntityEnclosingRequest post = new BasicHttpEntityEnclosingRequest("POST", "/");
                 byte[] data = (byte[]) testData.get(r);
                 ByteArrayEntity outgoing = new ByteArrayEntity(data);
@@ -475,7 +475,7 @@ public class TestHttpServiceAndExecutor 
                 HttpResponse response = this.client.execute(post, host, conn);
                 byte[] received = EntityUtils.toByteArray(response.getEntity());
                 byte[] expected = (byte[]) testData.get(r);
-                
+
                 assertEquals(expected.length, received.length);
                 for (int i = 0; i < expected.length; i++) {
                     assertEquals(expected[i], received[i]);
@@ -484,7 +484,7 @@ public class TestHttpServiceAndExecutor 
                     conn.close();
                 }
             }
-            
+
             //Verify the connection metrics
             HttpConnectionMetrics cm = conn.getMetrics();
             assertEquals(reqNo, cm.getRequestCount());
@@ -494,35 +494,35 @@ public class TestHttpServiceAndExecutor 
             this.server.shutdown();
         }
     }
-    
-    
+
+
     /**
-     * This test case executes a series of simple POST requests that do not 
-     * meet the target server expectations. 
+     * This test case executes a series of simple POST requests that do not
+     * meet the target server expectations.
      */
     public void testHttpPostsWithExpectationVerification() throws Exception {
-        
+
         int reqNo = 3;
-        
+
         // Initialize the server-side request handler
         this.server.registerHandler("*", new HttpRequestHandler() {
 
             public void handle(
-                    final HttpRequest request, 
-                    final HttpResponse response, 
+                    final HttpRequest request,
+                    final HttpResponse response,
                     final HttpContext context) throws HttpException, IOException {
-                
-                StringEntity outgoing = new StringEntity("No content"); 
+
+                StringEntity outgoing = new StringEntity("No content");
                 response.setEntity(outgoing);
             }
-            
+
         });
-        
+
         this.server.setExpectationVerifier(new HttpExpectationVerifier() {
 
             public void verify(
-                    final HttpRequest request, 
-                    final HttpResponse response, 
+                    final HttpRequest request,
+                    final HttpResponse response,
                     final HttpContext context) throws HttpException {
                 Header someheader = request.getFirstHeader("Secret");
                 if (someheader != null) {
@@ -536,33 +536,33 @@ public class TestHttpServiceAndExecutor 
                     if (secretNumber < 2) {
                         response.setStatusCode(HttpStatus.SC_EXPECTATION_FAILED);
                         ByteArrayEntity outgoing = new ByteArrayEntity(
-                                EncodingUtils.getAsciiBytes("Wrong secret number")); 
+                                EncodingUtils.getAsciiBytes("Wrong secret number"));
                         response.setEntity(outgoing);
                     }
                 }
             }
-            
+
         });
-        
+
         this.server.start();
-        
+
         // Activate 'expect: continue' handshake
         this.client.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
-        
+
         DefaultHttpClientConnection conn = new DefaultHttpClientConnection();
         HttpHost host = new HttpHost("localhost", this.server.getPort());
-        
+
         try {
             for (int r = 0; r < reqNo; r++) {
                 if (!conn.isOpen()) {
                     Socket socket = new Socket(host.getHostName(), host.getPort());
                     conn.bind(socket, this.client.getParams());
                 }
-                
+
                 BasicHttpEntityEnclosingRequest post = new BasicHttpEntityEnclosingRequest("POST", "/");
                 post.addHeader("Secret", Integer.toString(r));
                 ByteArrayEntity outgoing = new ByteArrayEntity(
-                        EncodingUtils.getAsciiBytes("No content")); 
+                        EncodingUtils.getAsciiBytes("No content"));
                 post.setEntity(outgoing);
 
                 HttpResponse response = this.client.execute(post, host, conn);
@@ -570,13 +570,13 @@ public class TestHttpServiceAndExecutor 
                 HttpEntity entity = response.getEntity();
                 assertNotNull(entity);
                 EntityUtils.consume(entity);
-                
+
                 if (r < 2) {
                     assertEquals(HttpStatus.SC_EXPECTATION_FAILED, response.getStatusLine().getStatusCode());
                 } else {
                     assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
                 }
-                
+
                 if (!this.client.keepAlive(response)) {
                     conn.close();
                 }
@@ -590,12 +590,12 @@ public class TestHttpServiceAndExecutor 
             this.server.shutdown();
         }
     }
-    
+
     static class RepeatingEntity extends AbstractHttpEntity {
 
         private final byte[] raw;
         private int n;
-        
+
         public RepeatingEntity(final String content, String charset, int n) {
             super();
             if (content == null) {
@@ -607,7 +607,7 @@ public class TestHttpServiceAndExecutor 
             if (charset == null) {
                 charset = "US-ASCII";
             }
-            byte[] b; 
+            byte[] b;
             try {
                 b = content.getBytes(charset);
             } catch (UnsupportedEncodingException ex) {
@@ -616,7 +616,7 @@ public class TestHttpServiceAndExecutor 
             this.raw = b;
             this.n = n;
         }
-        
+
         public InputStream getContent() throws IOException, IllegalStateException {
             throw new IllegalStateException("This method is not implemented");
         }
@@ -641,13 +641,13 @@ public class TestHttpServiceAndExecutor 
             }
             outstream.flush();
         }
-        
+
     }
-    
+
     public void testHttpContent() throws Exception {
-        
+
         String[] patterns = {
-            
+
             "0123456789ABCDEF",
             "yadayada-blahblah-this-and-that-yadayada-blahblah-this-and-that-" +
             "yadayada-blahblah-this-and-that-yadayada-blahblah-this-and-that-" +
@@ -665,22 +665,22 @@ public class TestHttpServiceAndExecutor 
             "yadayada-blahblah-this-and-that-yadayada-blahblah-this-and-that-" +
             "yadayada-blahblah-this-and-that-yadayada-blahblah-this-and-that"
         };
-        
+
         // Initialize the server-side request handler
         this.server.registerHandler("*", new HttpRequestHandler() {
 
             public void handle(
-                    final HttpRequest request, 
-                    final HttpResponse response, 
+                    final HttpRequest request,
+                    final HttpResponse response,
                     final HttpContext context) throws HttpException, IOException {
-                
+
                 if (request instanceof HttpEntityEnclosingRequest) {
                     int n = 1;
                     String s = request.getRequestLine().getUri();
                     if (s.startsWith("/?n=")) {
                         s = s.substring(4);
                         try {
-                            n = Integer.parseInt(s); 
+                            n = Integer.parseInt(s);
                             if (n <= 0) {
                                 throw new HttpException("Invalid request: " +
                                         "number of repetitions cannot be negative or zero");
@@ -690,11 +690,11 @@ public class TestHttpServiceAndExecutor 
                                     "number of repetitions is invalid");
                         }
                     }
-                    
+
                     HttpEntity incoming = ((HttpEntityEnclosingRequest) request).getEntity();
                     String line = EntityUtils.toString(incoming);
                     String charset = EntityUtils.getContentCharSet(incoming);
-                    
+
                     RepeatingEntity outgoing = new RepeatingEntity(line, charset, n);
                     outgoing.setChunked(n % 2 == 0);
                     response.setEntity(outgoing);
@@ -702,13 +702,13 @@ public class TestHttpServiceAndExecutor 
                     throw new HttpException("Invalid request: POST request expected");
                 }
             }
-            
+
         });
-        
+
         this.server.start();
         DefaultHttpClientConnection conn = new DefaultHttpClientConnection();
         HttpHost host = new HttpHost("localhost", this.server.getPort());
-        
+
         try {
             for (int i = 0; i < patterns.length; i++) {
                 String pattern = patterns[i];
@@ -717,7 +717,7 @@ public class TestHttpServiceAndExecutor 
                         Socket socket = new Socket(host.getHostName(), host.getPort());
                         conn.bind(socket, this.client.getParams());
                     }
-                    
+
                     BasicHttpEntityEnclosingRequest post = new BasicHttpEntityEnclosingRequest(
                             "POST", "/?n=" + n);
                     StringEntity outgoing = new StringEntity(pattern);
@@ -727,14 +727,14 @@ public class TestHttpServiceAndExecutor 
                     HttpResponse response = this.client.execute(post, host, conn);
                     HttpEntity incoming = response.getEntity();
                     assertNotNull(incoming);
-                    InputStream instream = incoming.getContent(); 
+                    InputStream instream = incoming.getContent();
                     String charset = EntityUtils.getContentCharSet(incoming);
                     if (charset == null) {
                         charset = "US-ASCII";
                     }
                     assertNotNull(instream);
                     BufferedReader reader = new BufferedReader(new InputStreamReader(instream, charset));
-                    
+
                     String line;
                     int count = 0;
                     while ((line = reader.readLine()) != null) {

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestStandardInterceptors.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestStandardInterceptors.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestStandardInterceptors.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/protocol/TestStandardInterceptors.java Fri Apr 23 13:44:00 2010
@@ -60,7 +60,7 @@ public class TestStandardInterceptors ex
         assertNotNull(header);
         assertEquals(HTTP.CONN_KEEP_ALIVE, header.getValue());
     }
-    
+
     public void testRequestConnControlCustom() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         BasicHttpRequest request = new BasicHttpRequest("GET", "/");
@@ -73,7 +73,7 @@ public class TestStandardInterceptors ex
         assertEquals(HTTP.CONN_CLOSE, header.getValue());
         assertTrue(header == myheader);
     }
-    
+
     public void testRequestConnControlInvalidInput() throws Exception {
         RequestConnControl interceptor = new RequestConnControl();
         try {
@@ -83,7 +83,7 @@ public class TestStandardInterceptors ex
             // expected
         }
     }
-    
+
     public void testRequestContentProtocolException() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         BasicHttpRequest request1 = new BasicHttpEntityEnclosingRequest("POST", "/");
@@ -105,7 +105,7 @@ public class TestStandardInterceptors ex
             // expected
         }
    }
-    
+
     public void testRequestContentNullEntity() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         BasicHttpRequest request = new BasicHttpEntityEnclosingRequest("POST", "/");
@@ -117,7 +117,7 @@ public class TestStandardInterceptors ex
         assertEquals("0", header.getValue());
         assertNull(request.getFirstHeader(HTTP.TRANSFER_ENCODING));
    }
-    
+
     public void testRequestContentEntityContentLengthDelimitedHTTP11() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("POST", "/");
@@ -132,7 +132,7 @@ public class TestStandardInterceptors ex
         assertEquals(s.length(), Integer.parseInt(header.getValue()));
         assertNull(request.getFirstHeader(HTTP.TRANSFER_ENCODING));
    }
-    
+
     public void testRequestContentEntityChunkedHTTP11() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("POST", "/");
@@ -148,7 +148,7 @@ public class TestStandardInterceptors ex
         assertEquals("chunked", header.getValue());
         assertNull(request.getFirstHeader(HTTP.CONTENT_LEN));
    }
-    
+
     public void testRequestContentEntityUnknownLengthHTTP11() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("POST", "/");
@@ -182,7 +182,7 @@ public class TestStandardInterceptors ex
             // expected
         }
     }
-    
+
     public void testRequestContentTypeAndEncoding() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("POST", "/");
@@ -200,7 +200,7 @@ public class TestStandardInterceptors ex
         assertNotNull(h2);
         assertEquals("whatever", h2.getValue());
     }
-    
+
     public void testRequestContentNullTypeAndEncoding() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("POST", "/");
@@ -212,7 +212,7 @@ public class TestStandardInterceptors ex
         assertNull(request.getFirstHeader(HTTP.CONTENT_TYPE));
         assertNull(request.getFirstHeader(HTTP.CONTENT_ENCODING));
     }
-    
+
     public void testRequestContentEntityUnknownLengthHTTP10() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest(
@@ -240,7 +240,7 @@ public class TestStandardInterceptors ex
             // expected
         }
     }
-    
+
     public void testRequestContentIgnoreNonenclosingRequests() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         BasicHttpRequest request = new BasicHttpRequest("POST", "/");
@@ -438,7 +438,7 @@ public class TestStandardInterceptors ex
         Header header = request.getFirstHeader(HTTP.USER_AGENT);
         assertNull(header);
     }
-    
+
     public void testRequestUserAgentInvalidInput() throws Exception {
         RequestUserAgent interceptor = new RequestUserAgent();
         try {
@@ -457,7 +457,7 @@ public class TestStandardInterceptors ex
         Header header = response.getFirstHeader(HTTP.CONN_DIRECTIVE);
         assertNull(header);
     }
-    
+
     public void testResponseConnControlEntityContentLength() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
@@ -468,7 +468,7 @@ public class TestStandardInterceptors ex
         Header header = response.getFirstHeader(HTTP.CONN_DIRECTIVE);
         assertNull(header);
     }
-    
+
     public void testResponseConnControlEntityUnknownContentLength() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         BasicHttpRequest request = new BasicHttpRequest("GET", "/");
@@ -483,7 +483,7 @@ public class TestStandardInterceptors ex
         assertNotNull(header);
         assertEquals(HTTP.CONN_CLOSE, header.getValue());
     }
-    
+
     public void testResponseConnControlEntityChunked() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
@@ -495,7 +495,7 @@ public class TestStandardInterceptors ex
         Header header = response.getFirstHeader(HTTP.CONN_DIRECTIVE);
         assertNull(header);
     }
-    
+
     public void testResponseConnControlEntityUnknownContentLengthHTTP10() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         BasicHttpRequest request = new BasicHttpRequest("GET", "/");
@@ -528,7 +528,7 @@ public class TestStandardInterceptors ex
         assertNotNull(header);
         assertEquals(HTTP.CONN_KEEP_ALIVE, header.getValue());
     }
-    
+
     public void testResponseConnControlClientRequest2() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         BasicHttpRequest request = new BasicHttpRequest("GET", "/");
@@ -551,15 +551,15 @@ public class TestStandardInterceptors ex
 
         ResponseConnControl interceptor = new ResponseConnControl();
 
-        int [] statusCodes = new int[] { 
-                HttpStatus.SC_BAD_REQUEST, 
-                HttpStatus.SC_REQUEST_TIMEOUT, 
+        int [] statusCodes = new int[] {
+                HttpStatus.SC_BAD_REQUEST,
+                HttpStatus.SC_REQUEST_TIMEOUT,
                 HttpStatus.SC_LENGTH_REQUIRED,
                 HttpStatus.SC_REQUEST_TOO_LONG,
                 HttpStatus.SC_REQUEST_URI_TOO_LONG,
                 HttpStatus.SC_SERVICE_UNAVAILABLE,
                 HttpStatus.SC_NOT_IMPLEMENTED };
-        
+
         for (int i = 0; i < statusCodes.length; i++) {
             BasicHttpResponse response = new BasicHttpResponse(
                     HttpVersion.HTTP_1_1, statusCodes[i], "Unreasonable");
@@ -568,7 +568,7 @@ public class TestStandardInterceptors ex
             assertNotNull(header);
             assertEquals(HTTP.CONN_CLOSE, header.getValue());
         }
-        
+
     }
 
     public void testResponseConnControlHostInvalidInput() throws Exception {
@@ -597,7 +597,7 @@ public class TestStandardInterceptors ex
         assertNotNull(header);
         assertEquals("0", header.getValue());
     }
-    
+
     public void testResponseContentStatusNoContent() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
@@ -607,7 +607,7 @@ public class TestStandardInterceptors ex
         Header header = response.getFirstHeader(HTTP.CONTENT_LEN);
         assertNull(header);
     }
-    
+
     public void testResponseContentStatusResetContent() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
@@ -642,7 +642,7 @@ public class TestStandardInterceptors ex
         Header h2 = response.getFirstHeader(HTTP.CONTENT_LEN);
         assertNull(h2);
     }
-    
+
     public void testResponseContentEntityContentLenghtDelimited() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
@@ -657,7 +657,7 @@ public class TestStandardInterceptors ex
         Header h2 = response.getFirstHeader(HTTP.TRANSFER_ENCODING);
         assertNull(h2);
     }
-    
+
     public void testResponseContentEntityUnknownContentLength() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
@@ -670,7 +670,7 @@ public class TestStandardInterceptors ex
         Header h2 = response.getFirstHeader(HTTP.CONTENT_LEN);
         assertNull(h2);
     }
-    
+
     public void testResponseContentEntityChunkedHTTP10() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_0, HttpStatus.SC_OK, "OK");
@@ -697,7 +697,7 @@ public class TestStandardInterceptors ex
         Header h2 = response.getFirstHeader(HTTP.CONTENT_ENCODING);
         assertNull(h2);
     }
-        
+
     public void testResponseContentEntityContentTypeAndEncoding() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
@@ -724,7 +724,7 @@ public class TestStandardInterceptors ex
             // expected
         }
     }
-        
+
     public void testResponseContentInvalidResponseState() throws Exception {
         ResponseContent interceptor = new ResponseContent();
         HttpContext context = new BasicHttpContext(null);
@@ -757,7 +757,7 @@ public class TestStandardInterceptors ex
         Header h2 = response.getFirstHeader(HTTP.DATE_HEADER);
         assertNotNull(h2);
     }
-        
+
     public void testResponseDateNotGenerated() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
@@ -767,7 +767,7 @@ public class TestStandardInterceptors ex
         Header h1 = response.getFirstHeader(HTTP.DATE_HEADER);
         assertNull(h1);
     }
-        
+
     public void testResponseDateInvalidInput() throws Exception {
         ResponseDate interceptor = new ResponseDate();
         try {
@@ -792,7 +792,7 @@ public class TestStandardInterceptors ex
         Header h2 = request.getFirstHeader(HTTP.DATE_HEADER);
         assertNotNull(h2);
     }
-        
+
     public void testRequestDateNotGenerated() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         BasicHttpRequest request = new BasicHttpRequest("GET", "/");
@@ -802,7 +802,7 @@ public class TestStandardInterceptors ex
         Header h1 = request.getFirstHeader(HTTP.DATE_HEADER);
         assertNull(h1);
     }
-        
+
     public void testRequestDateInvalidInput() throws Exception {
         RequestDate interceptor = new RequestDate();
         try {
@@ -812,7 +812,7 @@ public class TestStandardInterceptors ex
             // expected
         }
     }
-            
+
     public void testResponseServerGenerated() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
@@ -823,7 +823,7 @@ public class TestStandardInterceptors ex
         assertNotNull(h1);
         assertEquals("some server", h1.getValue());
     }
-        
+
     public void testResponseServerNotGenerated() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
@@ -835,7 +835,7 @@ public class TestStandardInterceptors ex
         assertNotNull(h1);
         assertEquals("whatever", h1.getValue());
     }
-        
+
     public void testResponseServerMissing() throws Exception {
         HttpContext context = new BasicHttpContext(null);
         HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
@@ -844,7 +844,7 @@ public class TestStandardInterceptors ex
         Header h1 = response.getFirstHeader(HTTP.SERVER_HEADER);
         assertNull(h1);
     }
-        
+
     public void testResponseServerInvalidInput() throws Exception {
         ResponseServer interceptor = new ResponseServer();
         try {



Mime
View raw message