hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r937295 [7/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/impl/entity/TestEntityDeserializer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestEntityDeserializer.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestEntityDeserializer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestEntityDeserializer.java Fri Apr 23 13:44:00 2010
@@ -68,8 +68,8 @@ public class TestEntityDeserializer exte
     public void testEntityWithTransferEncoding() throws Exception {
         SessionInputBuffer datareceiver = new SessionInputBufferMockup("0\r\n", "US-ASCII");
         HttpMessage message = new HttpMessageMockup();
-        
-        // lenient mode 
+
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         message.addHeader("Content-Type", "unknown");
         message.addHeader("Transfer-Encoding", "identity, chunked");
@@ -82,7 +82,7 @@ public class TestEntityDeserializer exte
         assertTrue(entity.isChunked());
         assertTrue(entity.getContent() instanceof ChunkedInputStream);
 
-        // strict mode 
+        // strict mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, true);
         entity = entitygen.deserialize(datareceiver, message);
         assertNotNull(entity);
@@ -92,11 +92,11 @@ public class TestEntityDeserializer exte
     }
 
     public void testEntityWithIdentityTransferEncoding() throws Exception {
-        SessionInputBuffer datareceiver = 
+        SessionInputBuffer datareceiver =
             new SessionInputBufferMockup(new byte[] {});
         HttpMessage message = new HttpMessageMockup();
-        
-        // lenient mode 
+
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         message.addHeader("Content-Type", "unknown");
         message.addHeader("Transfer-Encoding", "identity");
@@ -112,8 +112,8 @@ public class TestEntityDeserializer exte
     public void testEntityWithUnsupportedTransferEncoding() throws Exception {
         SessionInputBuffer datareceiver = new SessionInputBufferMockup("0\r\n", "US-ASCII");
         HttpMessage message = new HttpMessageMockup();
-        
-        // lenient mode 
+
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         message.addHeader("Content-Type", "unknown");
         message.addHeader("Transfer-Encoding", "whatever; param=value, chunked");
@@ -126,7 +126,7 @@ public class TestEntityDeserializer exte
         assertTrue(entity.isChunked());
         assertTrue(entity.getContent() instanceof ChunkedInputStream);
 
-        // strict mode 
+        // strict mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, true);
         try {
             entitygen.deserialize(datareceiver, message);
@@ -139,8 +139,8 @@ public class TestEntityDeserializer exte
     public void testChunkedTransferEncodingMustBeLast() throws Exception {
         SessionInputBuffer datareceiver = new SessionInputBufferMockup("0\r\n", "US-ASCII");
         HttpMessage message = new HttpMessageMockup();
-        
-        // lenient mode 
+
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         message.addHeader("Content-Type", "unknown");
         message.addHeader("Transfer-Encoding", "chunked, identity");
@@ -153,7 +153,7 @@ public class TestEntityDeserializer exte
         assertFalse(entity.isChunked());
         assertFalse(entity.getContent() instanceof ChunkedInputStream);
 
-        // strict mode 
+        // strict mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, true);
         try {
             entitygen.deserialize(datareceiver, message);
@@ -166,8 +166,8 @@ public class TestEntityDeserializer exte
     public void testEntityWithContentLength() throws Exception {
         SessionInputBuffer datareceiver = new SessionInputBufferMockup(new byte[] {});
         HttpMessage message = new HttpMessageMockup();
-        
-        // lenient mode 
+
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         message.addHeader("Content-Type", "unknown");
         message.addHeader("Content-Length", "0");
@@ -184,7 +184,7 @@ public class TestEntityDeserializer exte
         SessionInputBuffer datareceiver = new SessionInputBufferMockup(new byte[] {'0'});
         HttpMessage message = new HttpMessageMockup();
 
-        // lenient mode 
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         message.addHeader("Content-Type", "unknown");
         message.addHeader("Content-Length", "0");
@@ -199,8 +199,8 @@ public class TestEntityDeserializer exte
         InputStream instream = entity.getContent();
         assertNotNull(instream);
         assertTrue(instream instanceof ContentLengthInputStream);
-        
-        // strict mode 
+
+        // strict mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, true);
         try {
             entitygen.deserialize(datareceiver, message);
@@ -209,12 +209,12 @@ public class TestEntityDeserializer exte
             // expected
         }
     }
-    
+
     public void testEntityWithMultipleContentLengthSomeWrong() throws Exception {
         SessionInputBuffer datareceiver = new SessionInputBufferMockup(new byte[] {'0'});
         HttpMessage message = new HttpMessageMockup();
 
-        // lenient mode 
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         message.addHeader("Content-Type", "unknown");
         message.addHeader("Content-Length", "1");
@@ -229,8 +229,8 @@ public class TestEntityDeserializer exte
         InputStream instream = entity.getContent();
         assertNotNull(instream);
         assertTrue(instream instanceof ContentLengthInputStream);
-        
-        // strict mode 
+
+        // strict mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, true);
         try {
             entitygen.deserialize(datareceiver, message);
@@ -239,12 +239,12 @@ public class TestEntityDeserializer exte
             // expected
         }
     }
-    
+
     public void testEntityWithMultipleContentLengthAllWrong() throws Exception {
         SessionInputBuffer datareceiver = new SessionInputBufferMockup(new byte[] {'0'});
         HttpMessage message = new HttpMessageMockup();
 
-        // lenient mode 
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         message.addHeader("Content-Type", "unknown");
         message.addHeader("Content-Length", "yyy");
@@ -259,8 +259,8 @@ public class TestEntityDeserializer exte
         assertNotNull(instream);
         assertFalse(instream instanceof ContentLengthInputStream);
         assertTrue(instream instanceof IdentityInputStream);
-        
-        // strict mode 
+
+        // strict mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, true);
         try {
             entitygen.deserialize(datareceiver, message);
@@ -274,7 +274,7 @@ public class TestEntityDeserializer exte
         SessionInputBuffer datareceiver = new SessionInputBufferMockup(new byte[] {'0'});
         HttpMessage message = new HttpMessageMockup();
 
-        // lenient mode 
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         message.addHeader("Content-Type", "unknown");
         message.addHeader("Content-Length", "xxx");
@@ -288,8 +288,8 @@ public class TestEntityDeserializer exte
         assertNotNull(instream);
         assertFalse(instream instanceof ContentLengthInputStream);
         assertTrue(instream instanceof IdentityInputStream);
-        
-        // strict mode 
+
+        // strict mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, true);
         try {
             entitygen.deserialize(datareceiver, message);
@@ -303,7 +303,7 @@ public class TestEntityDeserializer exte
         SessionInputBuffer datareceiver = new SessionInputBufferMockup(new byte[] {'0'});
         HttpMessage message = new HttpMessageMockup();
 
-        // lenient mode 
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         EntityDeserializer entitygen = new EntityDeserializer(
                 new LaxContentLengthStrategy());
@@ -343,6 +343,6 @@ public class TestEntityDeserializer exte
         assertNotNull(entity.getContentEncoding());
         assertEquals("what not", entity.getContentEncoding().getValue());
     }
-    
+
 }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestEntitySerializer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestEntitySerializer.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestEntitySerializer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestEntitySerializer.java Fri Apr 23 13:44:00 2010
@@ -95,7 +95,7 @@ public class TestEntitySerializer extend
         assertNotNull(outstream);
         assertTrue(outstream instanceof IdentityOutputStream);
     }
-    
+
     public void testEntityWithInvalidTransferEncoding() throws Exception {
         SessionOutputBuffer datatransmitter = new SessionOutputBufferMockup();
         HttpMessage message = new HttpMessageMockup();
@@ -110,11 +110,11 @@ public class TestEntitySerializer extend
             // expected
         }
     }
-    
+
     public void testEntityWithInvalidChunkEncodingAndHTTP10() throws Exception {
         SessionOutputBuffer datatransmitter = new SessionOutputBufferMockup();
         HttpMessage message = new HttpMessageMockup();
-        message.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, 
+        message.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION,
                 HttpVersion.HTTP_1_0);
         message.addHeader("Transfer-Encoding", "chunked");
 
@@ -127,7 +127,7 @@ public class TestEntitySerializer extend
             // expected
         }
     }
-    
+
     public void testEntityWithContentLength() throws Exception {
         SessionOutputBuffer datatransmitter = new SessionOutputBufferMockup();
         HttpMessage message = new HttpMessageMockup();
@@ -138,7 +138,7 @@ public class TestEntitySerializer extend
         assertNotNull(outstream);
         assertTrue(outstream instanceof ContentLengthOutputStream);
     }
-    
+
     public void testEntityWithInvalidContentLength() throws Exception {
         SessionOutputBuffer datatransmitter = new SessionOutputBufferMockup();
         HttpMessage message = new HttpMessageMockup();
@@ -163,19 +163,19 @@ public class TestEntitySerializer extend
         assertNotNull(outstream);
         assertTrue(outstream instanceof IdentityOutputStream);
     }
-        
+
     public void testEntitySerialization() throws Exception {
         byte[] content = new byte[] {1, 2, 3, 4, 5};
-        ByteArrayEntity entity = new ByteArrayEntity(content); 
-        
+        ByteArrayEntity entity = new ByteArrayEntity(content);
+
         SessionOutputBufferMockup datatransmitter = new SessionOutputBufferMockup();
         HttpMessage message = new HttpMessageMockup();
         message.addHeader("Content-Length", Integer.toString(content.length));
-        
+
         EntitySerializer entitywriter = new EntitySerializer(
                 new StrictContentLengthStrategy());
         entitywriter.serialize(datatransmitter, message, entity);
-        
+
         byte[] data = datatransmitter.getData();
         assertNotNull(data);
         assertEquals(content.length, data.length);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestLaxContentLengthStrategy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestLaxContentLengthStrategy.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestLaxContentLengthStrategy.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestLaxContentLengthStrategy.java Fri Apr 23 13:44:00 2010
@@ -44,15 +44,15 @@ public class TestLaxContentLengthStrateg
     public void testEntityWithTransferEncoding() throws Exception {
         ContentLengthStrategy lenStrategy = new LaxContentLengthStrategy();
         HttpMessage message = new HttpMessageMockup();
-        
-        // lenient mode 
+
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         message.addHeader("Content-Type", "unknown");
         message.addHeader("Transfer-Encoding", "identity, chunked");
         message.addHeader("Content-Length", "plain wrong");
         assertEquals(ContentLengthStrategy.CHUNKED, lenStrategy.determineLength(message));
 
-        // strict mode 
+        // strict mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, true);
         assertEquals(ContentLengthStrategy.CHUNKED, lenStrategy.determineLength(message));
     }
@@ -60,8 +60,8 @@ public class TestLaxContentLengthStrateg
     public void testEntityWithIdentityTransferEncoding() throws Exception {
         ContentLengthStrategy lenStrategy = new LaxContentLengthStrategy();
         HttpMessage message = new HttpMessageMockup();
-        
-        // lenient mode 
+
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         message.addHeader("Content-Type", "unknown");
         message.addHeader("Transfer-Encoding", "identity");
@@ -72,15 +72,15 @@ public class TestLaxContentLengthStrateg
     public void testEntityWithUnsupportedTransferEncoding() throws Exception {
         ContentLengthStrategy lenStrategy = new LaxContentLengthStrategy();
         HttpMessage message = new HttpMessageMockup();
-        
-        // lenient mode 
+
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         message.addHeader("Content-Type", "unknown");
         message.addHeader("Transfer-Encoding", "whatever; param=value, chunked");
         message.addHeader("Content-Length", "plain wrong");
         assertEquals(ContentLengthStrategy.CHUNKED, lenStrategy.determineLength(message));
 
-        // strict mode 
+        // strict mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, true);
         try {
             lenStrategy.determineLength(message);
@@ -93,15 +93,15 @@ public class TestLaxContentLengthStrateg
     public void testChunkedTransferEncodingMustBeLast() throws Exception {
         ContentLengthStrategy lenStrategy = new LaxContentLengthStrategy();
         HttpMessage message = new HttpMessageMockup();
-        
-        // lenient mode 
+
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         message.addHeader("Content-Type", "unknown");
         message.addHeader("Transfer-Encoding", "chunked, identity");
         message.addHeader("Content-Length", "plain wrong");
         assertEquals(ContentLengthStrategy.IDENTITY, lenStrategy.determineLength(message));
 
-        // strict mode 
+        // strict mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, true);
         try {
             lenStrategy.determineLength(message);
@@ -114,8 +114,8 @@ public class TestLaxContentLengthStrateg
     public void testEntityWithContentLength() throws Exception {
         ContentLengthStrategy lenStrategy = new LaxContentLengthStrategy();
         HttpMessage message = new HttpMessageMockup();
-        
-        // lenient mode 
+
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         message.addHeader("Content-Type", "unknown");
         message.addHeader("Content-Length", "0");
@@ -126,15 +126,15 @@ public class TestLaxContentLengthStrateg
         ContentLengthStrategy lenStrategy = new LaxContentLengthStrategy();
         HttpMessage message = new HttpMessageMockup();
 
-        // lenient mode 
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         message.addHeader("Content-Type", "unknown");
         message.addHeader("Content-Length", "0");
         message.addHeader("Content-Length", "0");
         message.addHeader("Content-Length", "1");
         assertEquals(1, lenStrategy.determineLength(message));
-        
-        // strict mode 
+
+        // strict mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, true);
         try {
             lenStrategy.determineLength(message);
@@ -143,20 +143,20 @@ public class TestLaxContentLengthStrateg
             // expected
         }
     }
-    
+
     public void testEntityWithMultipleContentLengthSomeWrong() throws Exception {
         ContentLengthStrategy lenStrategy = new LaxContentLengthStrategy();
         HttpMessage message = new HttpMessageMockup();
 
-        // lenient mode 
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         message.addHeader("Content-Type", "unknown");
         message.addHeader("Content-Length", "1");
         message.addHeader("Content-Length", "yyy");
         message.addHeader("Content-Length", "xxx");
         assertEquals(1, lenStrategy.determineLength(message));
-        
-        // strict mode 
+
+        // strict mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, true);
         try {
             lenStrategy.determineLength(message);
@@ -165,19 +165,19 @@ public class TestLaxContentLengthStrateg
             // expected
         }
     }
-    
+
     public void testEntityWithMultipleContentLengthAllWrong() throws Exception {
         ContentLengthStrategy lenStrategy = new LaxContentLengthStrategy();
         HttpMessage message = new HttpMessageMockup();
 
-        // lenient mode 
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         message.addHeader("Content-Type", "unknown");
         message.addHeader("Content-Length", "yyy");
         message.addHeader("Content-Length", "xxx");
         assertEquals(ContentLengthStrategy.IDENTITY, lenStrategy.determineLength(message));
-        
-        // strict mode 
+
+        // strict mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, true);
         try {
             lenStrategy.determineLength(message);
@@ -191,13 +191,13 @@ public class TestLaxContentLengthStrateg
         ContentLengthStrategy lenStrategy = new LaxContentLengthStrategy();
         HttpMessage message = new HttpMessageMockup();
 
-        // lenient mode 
+        // lenient mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, false);
         message.addHeader("Content-Type", "unknown");
         message.addHeader("Content-Length", "xxx");
         assertEquals(ContentLengthStrategy.IDENTITY, lenStrategy.determineLength(message));
-        
-        // strict mode 
+
+        // strict mode
         message.getParams().setBooleanParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, true);
         try {
             lenStrategy.determineLength(message);
@@ -211,7 +211,7 @@ public class TestLaxContentLengthStrateg
         ContentLengthStrategy lenStrategy = new LaxContentLengthStrategy();
         HttpMessage message = new HttpMessageMockup();
 
-        // lenient mode 
+        // lenient mode
         assertEquals(ContentLengthStrategy.IDENTITY, lenStrategy.determineLength(message));
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestStrictContentLengthStrategy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestStrictContentLengthStrategy.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestStrictContentLengthStrategy.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/TestStrictContentLengthStrategy.java Fri Apr 23 13:44:00 2010
@@ -57,7 +57,7 @@ public class TestStrictContentLengthStra
 
         assertEquals(ContentLengthStrategy.IDENTITY, lenStrategy.determineLength(message));
     }
-    
+
     public void testEntityWithInvalidTransferEncoding() throws Exception {
         ContentLengthStrategy lenStrategy = new StrictContentLengthStrategy();
         HttpMessage message = new HttpMessageMockup();
@@ -70,11 +70,11 @@ public class TestStrictContentLengthStra
             // expected
         }
     }
-    
+
     public void testEntityWithInvalidChunkEncodingAndHTTP10() throws Exception {
         ContentLengthStrategy lenStrategy = new StrictContentLengthStrategy();
         HttpMessage message = new HttpMessageMockup();
-        message.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, 
+        message.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION,
                 HttpVersion.HTTP_1_0);
         message.addHeader("Transfer-Encoding", "chunked");
 
@@ -85,14 +85,14 @@ public class TestStrictContentLengthStra
             // expected
         }
     }
-    
+
     public void testEntityWithContentLength() throws Exception {
         ContentLengthStrategy lenStrategy = new StrictContentLengthStrategy();
         HttpMessage message = new HttpMessageMockup();
         message.addHeader("Content-Length", "100");
         assertEquals(100, lenStrategy.determineLength(message));
     }
-    
+
     public void testEntityWithInvalidContentLength() throws Exception {
         ContentLengthStrategy lenStrategy = new StrictContentLengthStrategy();
         HttpMessage message = new HttpMessageMockup();
@@ -111,6 +111,6 @@ public class TestStrictContentLengthStra
         HttpMessage message = new HttpMessageMockup();
         assertEquals(ContentLengthStrategy.IDENTITY, lenStrategy.determineLength(message));
     }
-        
+
 }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestChunkCoding.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestChunkCoding.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestChunkCoding.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestChunkCoding.java Fri Apr 23 13:44:00 2010
@@ -46,7 +46,7 @@ import org.apache.http.util.EncodingUtil
 public class TestChunkCoding extends TestCase {
 
     private static final String CONTENT_CHARSET = "ISO-8859-1";
-    
+
     public TestChunkCoding(String testName) {
         super(testName);
     }
@@ -62,12 +62,12 @@ public class TestChunkCoding extends Tes
         new MalformedChunkCodingException("");
     }
 
-    private final static String CHUNKED_INPUT 
+    private final static String CHUNKED_INPUT
         = "10;key=\"value\"\r\n1234567890123456\r\n5\r\n12345\r\n0\r\nFooter1: abcde\r\nFooter2: fghij\r\n";
-    
-    private final static String CHUNKED_RESULT 
+
+    private final static String CHUNKED_RESULT
         = "123456789012345612345";
-    
+
     // Test for when buffer is larger than chunk size
     public void testChunkedInputStreamLargeBuffer() throws IOException {
         ChunkedInputStream in = new ChunkedInputStream(
@@ -81,12 +81,12 @@ public class TestChunkCoding extends Tes
         }
         assertEquals(-1, in.read(buffer));
         assertEquals(-1, in.read(buffer));
-        
+
         in.close();
-        
+
         String result = EncodingUtils.getString(out.toByteArray(), CONTENT_CHARSET);
         assertEquals(result, CHUNKED_RESULT);
-        
+
         Header[] footers = in.getFooters();
         assertNotNull(footers);
         assertEquals(2, footers.length);
@@ -94,7 +94,7 @@ public class TestChunkCoding extends Tes
         assertEquals("abcde", footers[0].getValue());
         assertEquals("Footer2", footers[1].getName());
         assertEquals("fghij", footers[1].getValue());
-    }        
+    }
 
     //Test for when buffer is smaller than chunk size.
     public void testChunkedInputStreamSmallBuffer() throws IOException {
@@ -112,7 +112,7 @@ public class TestChunkCoding extends Tes
         assertEquals(-1, in.read(buffer));
 
         in.close();
-                
+
         EncodingUtils.getString(out.toByteArray(), CONTENT_CHARSET);
         Header[] footers = in.getFooters();
         assertNotNull(footers);
@@ -122,7 +122,7 @@ public class TestChunkCoding extends Tes
         assertEquals("Footer2", footers[1].getName());
         assertEquals("fghij", footers[1].getValue());
     }
-        
+
     // One byte read
     public void testChunkedInputStreamOneByteRead() throws IOException {
         String s = "5\r\n01234\r\n5\r\n56789\r\n0\r\n";
@@ -136,11 +136,11 @@ public class TestChunkCoding extends Tes
             i++;
         }
         assertEquals(-1, in.read());
-        assertEquals(-1, in.read());        
+        assertEquals(-1, in.read());
 
-        in.close();        
+        in.close();
     }
-    
+
     public void testAvailable() throws IOException {
         String s = "5\r\n12345\r\n0\r\n";
         ChunkedInputStream in = new ChunkedInputStream(
@@ -164,7 +164,7 @@ public class TestChunkCoding extends Tes
         } catch (IOException ex) {
             // expected
         }
-        byte[] tmp = new byte[10]; 
+        byte[] tmp = new byte[10];
         try {
             in.read(tmp);
             fail("IOException should have been thrown");
@@ -314,7 +314,7 @@ public class TestChunkCoding extends Tes
         }
         assertEquals(0, out.size());
     }
-    
+
     public void testChunkedConsistence() throws IOException {
         String input = "76126;27823abcd;:q38a-\nkjc\rk%1ad\tkh/asdui\r\njkh+?\\suweb";
         ByteArrayOutputStream buffer = new ByteArrayOutputStream();
@@ -342,15 +342,15 @@ public class TestChunkCoding extends Tes
     public void testChunkedOutputStream() throws IOException {
         SessionOutputBufferMockup buffer = new SessionOutputBufferMockup();
         ChunkedOutputStream out = new ChunkedOutputStream(buffer, 2);
-        out.write('1');  
-        out.write('2');  
-        out.write('3');  
-        out.write('4');  
+        out.write('1');
+        out.write('2');
+        out.write('3');
+        out.write('4');
         out.finish();
         out.close();
-        
+
         byte [] rawdata =  buffer.getData();
-        
+
         assertEquals(19, rawdata.length);
         assertEquals('2', rawdata[0]);
         assertEquals('\r', rawdata[1]);
@@ -379,9 +379,9 @@ public class TestChunkCoding extends Tes
         out.write(new byte[] {'1', '2', '3', '4'});
         out.finish();
         out.close();
-        
+
         byte [] rawdata =  buffer.getData();
-        
+
         assertEquals(14, rawdata.length);
         assertEquals('4', rawdata[0]);
         assertEquals('\r', rawdata[1]);
@@ -403,12 +403,12 @@ public class TestChunkCoding extends Tes
         ByteArrayOutputStream buffer = new ByteArrayOutputStream();
         ChunkedOutputStream out = new ChunkedOutputStream(
                 new SessionOutputBufferMockup(buffer), 2);
-        out.write('1');  
+        out.write('1');
         out.finish();
         out.close();
-        
+
         byte [] rawdata =  buffer.toByteArray();
-        
+
         assertEquals(11, rawdata.length);
         assertEquals('1', rawdata[0]);
         assertEquals('\r', rawdata[1]);
@@ -427,13 +427,13 @@ public class TestChunkCoding extends Tes
         String s = "5\r\n01234\r\n5\r\n5\0006789\r\na\r\n0123\000456789\r\n0\r\n";
         SessionInputBuffer sessbuf = new SessionInputBufferMockup(
                 new TimeoutByteArrayInputStream(s.getBytes("ISO-8859-1")), 16);
-        InputStream in = new ChunkedInputStream(sessbuf);        
-        
+        InputStream in = new ChunkedInputStream(sessbuf);
+
         byte[] tmp = new byte[3];
-        
+
         int bytesRead = 0;
         int timeouts = 0;
-        
+
         int i = 0;
         while (i != -1) {
             try {
@@ -448,18 +448,18 @@ public class TestChunkCoding extends Tes
         assertEquals(20, bytesRead);
         assertEquals(2, timeouts);
     }
-    
+
     public void testResumeOnSocketTimeoutInChunk() throws IOException {
         String s = "5\000\r\000\n\00001234\r\n\0005\r\n56789\r\na\r\n0123456789\r\n\0000\r\n";
         SessionInputBuffer sessbuf = new SessionInputBufferMockup(
                 new TimeoutByteArrayInputStream(s.getBytes("ISO-8859-1")), 16);
-        InputStream in = new ChunkedInputStream(sessbuf);        
-        
+        InputStream in = new ChunkedInputStream(sessbuf);
+
         byte[] tmp = new byte[3];
-        
+
         int bytesRead = 0;
         int timeouts = 0;
-        
+
         int i = 0;
         while (i != -1) {
             try {

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestContentLengthInputStream.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestContentLengthInputStream.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestContentLengthInputStream.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestContentLengthInputStream.java Fri Apr 23 13:44:00 2010
@@ -43,7 +43,7 @@ public class TestContentLengthInputStrea
     }
 
     private static final String CONTENT_CHARSET = "ISO-8859-1";
-        
+
     public void testConstructors() throws Exception {
         new ContentLengthInputStream(new SessionInputBufferMockup(new byte[] {}), 10);
         try {
@@ -71,7 +71,7 @@ public class TestContentLengthInputStrea
         out.write(buffer, 0, len);
         len = in.read(buffer);
         out.write(buffer, 0, len);
-        
+
         String result = EncodingUtils.getString(out.toByteArray(), CONTENT_CHARSET);
         assertEquals(result, "1234567890");
     }
@@ -92,7 +92,7 @@ public class TestContentLengthInputStrea
         assertTrue(in.skip(10) <= 0);
         assertTrue(in.skip(-1) == 0);
         assertTrue(in.read() == -1);
-        
+
         in = new ContentLengthInputStream(new SessionInputBufferMockup(new byte[2]), 4L);
         in.read();
         assertTrue(in.skip(2) == 1);
@@ -122,7 +122,7 @@ public class TestContentLengthInputStrea
         } catch (IOException ex) {
             // expected
         }
-        byte[] tmp = new byte[10]; 
+        byte[] tmp = new byte[10];
         try {
             in.read(tmp);
             fail("IOException should have been thrown");
@@ -136,6 +136,6 @@ public class TestContentLengthInputStrea
             // expected
         }
     }
-    
+
 }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestContentLengthOutputStream.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestContentLengthOutputStream.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestContentLengthOutputStream.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestContentLengthOutputStream.java Fri Apr 23 13:44:00 2010
@@ -96,6 +96,6 @@ public class TestContentLengthOutputStre
             // expected
         }
     }
-    
+
 }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestIdentityInputStream.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestIdentityInputStream.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestIdentityInputStream.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestIdentityInputStream.java Fri Apr 23 13:44:00 2010
@@ -55,7 +55,7 @@ public class TestIdentityInputStream ext
             //expected
         }
     }
-    
+
     public void testBasicRead() throws Exception {
         byte[] input = new byte[] {'a', 'b', 'c'};
         SessionInputBufferMockup receiver = new SessionInputBufferMockup(input);
@@ -68,9 +68,9 @@ public class TestIdentityInputStream ext
         assertEquals(-1, instream.read(tmp, 0, tmp.length));
         assertEquals(-1, instream.read());
         assertEquals(-1, instream.read(tmp, 0, tmp.length));
-        assertEquals(-1, instream.read());        
+        assertEquals(-1, instream.read());
     }
-    
+
     public void testClosedCondition() throws Exception {
         byte[] input = new byte[] {'a', 'b', 'c'};
         SessionInputBufferMockup receiver = new SessionInputBufferMockup(input);
@@ -78,13 +78,13 @@ public class TestIdentityInputStream ext
 
         instream.close();
         instream.close();
-        
+
         assertEquals(0, instream.available());
         byte[] tmp = new byte[2];
         assertEquals(-1, instream.read(tmp, 0, tmp.length));
         assertEquals(-1, instream.read());
         assertEquals(-1, instream.read(tmp, 0, tmp.length));
-        assertEquals(-1, instream.read());        
+        assertEquals(-1, instream.read());
     }
 
     public void testAvailable() throws Exception {
@@ -92,7 +92,7 @@ public class TestIdentityInputStream ext
         SessionInputBufferMockup receiver = new SessionInputBufferMockup(input);
         IdentityInputStream instream = new IdentityInputStream(receiver);
         instream.read();
-        assertEquals(2, instream.available());        
+        assertEquals(2, instream.available());
     }
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestIdentityOutputStream.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestIdentityOutputStream.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestIdentityOutputStream.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestIdentityOutputStream.java Fri Apr 23 13:44:00 2010
@@ -86,7 +86,7 @@ public class TestIdentityOutputStream ex
             // expected
         }
     }
-    
+
     public void testConstructor() throws Exception {
         SessionOutputBufferMockup transmitter = new SessionOutputBufferMockup();
         new IdentityOutputStream(transmitter);
@@ -97,16 +97,16 @@ public class TestIdentityOutputStream ex
             //expected
         }
     }
-    
+
     public void testBasicWrite() throws Exception {
         SessionOutputBufferMockup transmitter = new SessionOutputBufferMockup();
         IdentityOutputStream outstream = new IdentityOutputStream(transmitter);
         outstream.write(new byte[] {'a', 'b'}, 0, 2);
         outstream.write('c');
         outstream.flush();
-        
+
         byte[] input = transmitter.getData();
-        
+
         assertNotNull(input);
         byte[] expected = new byte[] {'a', 'b', 'c'};
         assertEquals(expected.length, input.length);
@@ -114,13 +114,13 @@ public class TestIdentityOutputStream ex
             assertEquals(expected[i], input[i]);
         }
     }
-    
+
     public void testClosedCondition() throws Exception {
         SessionOutputBufferMockup transmitter = new SessionOutputBufferMockup();
         IdentityOutputStream outstream = new IdentityOutputStream(transmitter);
         outstream.close();
         outstream.close();
-        
+
         try {
             byte[] tmp = new byte[2];
             outstream.write(tmp, 0, tmp.length);
@@ -136,6 +136,6 @@ public class TestIdentityOutputStream ex
         }
     }
 
-    
+
 }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestMessageParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestMessageParser.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestMessageParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestMessageParser.java Fri Apr 23 13:44:00 2010
@@ -63,17 +63,17 @@ public class TestMessageParser extends T
             // expected
         }
     }
-    
+
     public void testBasicHeaderParsing() throws Exception {
-        String s = 
-            "header1: stuff\r\n" + 
-            "header2  : stuff \r\n" + 
-            "header3: stuff\r\n" + 
-            "     and more stuff\r\n" + 
-            "\t and even more stuff\r\n" +  
-            "     \r\n" +  
-            "\r\n"; 
-        SessionInputBuffer receiver = new SessionInputBufferMockup(s, "US-ASCII"); 
+        String s =
+            "header1: stuff\r\n" +
+            "header2  : stuff \r\n" +
+            "header3: stuff\r\n" +
+            "     and more stuff\r\n" +
+            "\t and even more stuff\r\n" +
+            "     \r\n" +
+            "\r\n";
+        SessionInputBuffer receiver = new SessionInputBufferMockup(s, "US-ASCII");
         Header[] headers = AbstractMessageParser.parseHeaders
             (receiver, -1, -1, null);
         assertNotNull(headers);
@@ -84,9 +84,9 @@ public class TestMessageParser extends T
         assertEquals("stuff", headers[1].getValue());
         assertEquals("header3", headers[2].getName());
         assertEquals("stuff and more stuff and even more stuff", headers[2].getValue());
-        
+
         Header h = headers[0];
-        
+
         assertTrue(h instanceof BufferedHeader);
         assertNotNull(((BufferedHeader)h).getBuffer());
         assertEquals("header1: stuff", ((BufferedHeader)h).toString());
@@ -94,10 +94,10 @@ public class TestMessageParser extends T
     }
 
     public void testBufferedHeader() throws Exception {
-        String s = 
-            "header1  : stuff; param1 = value1; param2 = \"value 2\" \r\n" + 
-            "\r\n"; 
-        SessionInputBuffer receiver = new SessionInputBufferMockup(s, "US-ASCII"); 
+        String s =
+            "header1  : stuff; param1 = value1; param2 = \"value 2\" \r\n" +
+            "\r\n";
+        SessionInputBuffer receiver = new SessionInputBufferMockup(s, "US-ASCII");
         Header[] headers = AbstractMessageParser.parseHeaders
             (receiver, -1, -1, null);
         assertNotNull(headers);
@@ -118,9 +118,9 @@ public class TestMessageParser extends T
     }
 
     public void testParsingInvalidHeaders() throws Exception {
-        String s = "    stuff\r\n" + 
-            "header1: stuff\r\n" + 
-            "\r\n"; 
+        String s = "    stuff\r\n" +
+            "header1: stuff\r\n" +
+            "\r\n";
         SessionInputBuffer receiver = new SessionInputBufferMockup(s, "US-ASCII");
         try {
             AbstractMessageParser.parseHeaders(receiver, -1, -1, null);
@@ -128,9 +128,9 @@ public class TestMessageParser extends T
         } catch (ProtocolException ex) {
             // expected
         }
-        s = "  :  stuff\r\n" + 
-            "header1: stuff\r\n" + 
-            "\r\n"; 
+        s = "  :  stuff\r\n" +
+            "header1: stuff\r\n" +
+            "\r\n";
         receiver = new SessionInputBufferMockup(s, "US-ASCII");
         try {
             AbstractMessageParser.parseHeaders(receiver, -1, -1, null);
@@ -139,12 +139,12 @@ public class TestMessageParser extends T
             // expected
         }
     }
-    
+
     public void testParsingMalformedFirstHeader() throws Exception {
-        String s = 
-            "    header1: stuff\r\n" + 
-            "header2  : stuff \r\n"; 
-        SessionInputBuffer receiver = new SessionInputBufferMockup(s, "US-ASCII"); 
+        String s =
+            "    header1: stuff\r\n" +
+            "header2  : stuff \r\n";
+        SessionInputBuffer receiver = new SessionInputBufferMockup(s, "US-ASCII");
         Header[] headers = AbstractMessageParser.parseHeaders
             (receiver, -1, -1, null);
         assertNotNull(headers);
@@ -154,10 +154,10 @@ public class TestMessageParser extends T
         assertEquals("header2", headers[1].getName());
         assertEquals("stuff", headers[1].getValue());
     }
-    
+
     public void testEmptyDataStream() throws Exception {
-        String s = ""; 
-        SessionInputBuffer receiver = new SessionInputBufferMockup(s, "US-ASCII"); 
+        String s = "";
+        SessionInputBuffer receiver = new SessionInputBufferMockup(s, "US-ASCII");
         Header[] headers = AbstractMessageParser.parseHeaders
             (receiver, -1, -1, null);
         assertNotNull(headers);
@@ -165,11 +165,11 @@ public class TestMessageParser extends T
     }
 
     public void testMaxHeaderCount() throws Exception {
-        String s = 
-            "header1: stuff\r\n" + 
-            "header2: stuff \r\n" + 
-            "header3: stuff\r\n" + 
-            "\r\n"; 
+        String s =
+            "header1: stuff\r\n" +
+            "header2: stuff \r\n" +
+            "header3: stuff\r\n" +
+            "\r\n";
         SessionInputBuffer receiver = new SessionInputBufferMockup(s, "US-ASCII");
         try {
             AbstractMessageParser.parseHeaders(receiver, 2, -1, null);
@@ -180,11 +180,11 @@ public class TestMessageParser extends T
     }
 
     public void testMaxHeaderCountForFoldedHeader() throws Exception {
-        String s = 
-            "header1: stuff\r\n" + 
-            " stuff \r\n" + 
-            " stuff\r\n" + 
-            "\r\n"; 
+        String s =
+            "header1: stuff\r\n" +
+            " stuff \r\n" +
+            " stuff\r\n" +
+            "\r\n";
         SessionInputBuffer receiver = new SessionInputBufferMockup(s, "US-ASCII");
         try {
             AbstractMessageParser.parseHeaders(receiver, 2, 15, null);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestRequestParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestRequestParser.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestRequestParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestRequestParser.java Fri Apr 23 13:44:00 2010
@@ -2,7 +2,7 @@
  * $HeadURL$
  * $Revision$
  * $Date$
- * 
+ *
  * ====================================================================
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -59,55 +59,55 @@ public class TestRequestParser extends T
     public void testInvalidConstructorInput() throws Exception {
         try {
             new HttpRequestParser(
-                    null, 
+                    null,
                     BasicLineParser.DEFAULT,
                     new DefaultHttpRequestFactory(),
-                    new BasicHttpParams()); 
+                    new BasicHttpParams());
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
         }
         try {
-            SessionInputBuffer inbuffer = new SessionInputBufferMockup(new byte[] {}); 
+            SessionInputBuffer inbuffer = new SessionInputBufferMockup(new byte[] {});
             new HttpRequestParser(
-                    inbuffer, 
+                    inbuffer,
                     BasicLineParser.DEFAULT,
                     null,
-                    new BasicHttpParams()); 
+                    new BasicHttpParams());
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
         }
         try {
-            SessionInputBuffer inbuffer = new SessionInputBufferMockup(new byte[] {}); 
+            SessionInputBuffer inbuffer = new SessionInputBufferMockup(new byte[] {});
             new HttpRequestParser(
-                    inbuffer, 
+                    inbuffer,
                     BasicLineParser.DEFAULT,
                     new DefaultHttpRequestFactory(),
-                    null); 
+                    null);
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
         }
     }
-    
+
     public void testBasicMessageParsing() throws Exception {
-        String s = 
-            "GET / HTTP/1.1\r\n" + 
-            "Host: localhost\r\n" + 
-            "User-Agent: whatever\r\n" + 
-            "Cookie: c1=stuff\r\n" + 
-            "\r\n"; 
+        String s =
+            "GET / HTTP/1.1\r\n" +
+            "Host: localhost\r\n" +
+            "User-Agent: whatever\r\n" +
+            "Cookie: c1=stuff\r\n" +
+            "\r\n";
         SessionInputBuffer inbuffer = new SessionInputBufferMockup(s, "US-ASCII");
-        
+
         HttpRequestParser parser = new HttpRequestParser(
-                inbuffer, 
+                inbuffer,
                 BasicLineParser.DEFAULT,
                 new DefaultHttpRequestFactory(),
-                new BasicHttpParams()); 
-        
+                new BasicHttpParams());
+
         HttpRequest httprequest = (HttpRequest) parser.parse();
-        
+
         RequestLine reqline = httprequest.getRequestLine();
         assertNotNull(reqline);
         assertEquals("GET", reqline.getMethod());
@@ -119,13 +119,13 @@ public class TestRequestParser extends T
 
     public void testConnectionClosedException() throws Exception {
         SessionInputBuffer inbuffer = new SessionInputBufferMockup(new byte[] {});
-        
+
         HttpRequestParser parser = new HttpRequestParser(
-                inbuffer, 
+                inbuffer,
                 BasicLineParser.DEFAULT,
                 new DefaultHttpRequestFactory(),
-                new BasicHttpParams()); 
-        
+                new BasicHttpParams());
+
         try {
             parser.parse();
             fail("ConnectionClosedException should have been thrown");
@@ -134,23 +134,23 @@ public class TestRequestParser extends T
     }
 
     public void testMessageParsingTimeout() throws Exception {
-        String s = 
-            "GET \000/ HTTP/1.1\r\000\n" + 
-            "Host: loca\000lhost\r\n" + 
-            "User-Agent: whatever\r\n" + 
-            "Coo\000kie: c1=stuff\r\n" + 
-            "\000\r\n"; 
+        String s =
+            "GET \000/ HTTP/1.1\r\000\n" +
+            "Host: loca\000lhost\r\n" +
+            "User-Agent: whatever\r\n" +
+            "Coo\000kie: c1=stuff\r\n" +
+            "\000\r\n";
         SessionInputBuffer inbuffer = new SessionInputBufferMockup(
                 new TimeoutByteArrayInputStream(s.getBytes("US-ASCII")), 16);
-        
+
         HttpRequestParser parser = new HttpRequestParser(
-                inbuffer, 
+                inbuffer,
                 BasicLineParser.DEFAULT,
                 new DefaultHttpRequestFactory(),
-                new BasicHttpParams()); 
-        
+                new BasicHttpParams());
+
         int timeoutCount = 0;
-        
+
         HttpRequest httprequest = null;
         for (int i = 0; i < 10; i++) {
             try {
@@ -159,7 +159,7 @@ public class TestRequestParser extends T
             } catch (InterruptedIOException ex) {
                 timeoutCount++;
             }
-            
+
         }
         assertNotNull(httprequest);
         assertEquals(5, timeoutCount);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestResponseParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestResponseParser.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestResponseParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestResponseParser.java Fri Apr 23 13:44:00 2010
@@ -55,55 +55,55 @@ public class TestResponseParser extends 
     public void testInvalidConstructorInput() throws Exception {
         try {
             new HttpResponseParser(
-                    null, 
+                    null,
                     BasicLineParser.DEFAULT,
                     new DefaultHttpResponseFactory(),
-                    new BasicHttpParams()); 
+                    new BasicHttpParams());
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
         }
         try {
-            SessionInputBuffer inbuffer = new SessionInputBufferMockup(new byte[] {}); 
+            SessionInputBuffer inbuffer = new SessionInputBufferMockup(new byte[] {});
             new HttpResponseParser(
-                    inbuffer, 
+                    inbuffer,
                     BasicLineParser.DEFAULT,
                     null,
-                    new BasicHttpParams()); 
+                    new BasicHttpParams());
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
         }
         try {
-            SessionInputBuffer inbuffer = new SessionInputBufferMockup(new byte[] {}); 
+            SessionInputBuffer inbuffer = new SessionInputBufferMockup(new byte[] {});
             new HttpResponseParser(
-                    inbuffer, 
+                    inbuffer,
                     BasicLineParser.DEFAULT,
                     new DefaultHttpResponseFactory(),
-                    null); 
+                    null);
             fail("IllegalArgumentException should have been thrown");
         } catch (IllegalArgumentException ex) {
             // expected
         }
     }
-    
+
     public void testBasicMessageParsing() throws Exception {
-        String s = 
-            "HTTP/1.1 200 OK\r\n" + 
-            "Server: whatever\r\n" + 
-            "Date: some date\r\n" + 
-            "Set-Cookie: c1=stuff\r\n" + 
-            "\r\n"; 
+        String s =
+            "HTTP/1.1 200 OK\r\n" +
+            "Server: whatever\r\n" +
+            "Date: some date\r\n" +
+            "Set-Cookie: c1=stuff\r\n" +
+            "\r\n";
         SessionInputBuffer inbuffer = new SessionInputBufferMockup(s, "US-ASCII");
-        
+
         HttpResponseParser parser = new HttpResponseParser(
-                inbuffer, 
+                inbuffer,
                 BasicLineParser.DEFAULT,
                 new DefaultHttpResponseFactory(),
-                new BasicHttpParams()); 
-        
+                new BasicHttpParams());
+
         HttpResponse httpresponse = (HttpResponse) parser.parse();
-        
+
         StatusLine statusline = httpresponse.getStatusLine();
         assertNotNull(statusline);
         assertEquals(200, statusline.getStatusCode());
@@ -115,13 +115,13 @@ public class TestResponseParser extends 
 
     public void testConnectionClosedException() throws Exception {
         SessionInputBuffer inbuffer = new SessionInputBufferMockup(new byte[] {});
-        
+
         HttpResponseParser parser = new HttpResponseParser(
-                inbuffer, 
+                inbuffer,
                 BasicLineParser.DEFAULT,
                 new DefaultHttpResponseFactory(),
-                new BasicHttpParams()); 
-        
+                new BasicHttpParams());
+
         try {
             parser.parse();
             fail("NoHttpResponseException should have been thrown");
@@ -130,23 +130,23 @@ public class TestResponseParser extends 
     }
 
     public void testMessageParsingTimeout() throws Exception {
-        String s = 
-            "HTTP\000/1.1 200\000 OK\r\n" + 
-            "Server: wha\000tever\r\n" + 
-            "Date: some date\r\n" + 
-            "Set-Coo\000kie: c1=stuff\r\n" + 
-            "\000\r\n"; 
+        String s =
+            "HTTP\000/1.1 200\000 OK\r\n" +
+            "Server: wha\000tever\r\n" +
+            "Date: some date\r\n" +
+            "Set-Coo\000kie: c1=stuff\r\n" +
+            "\000\r\n";
         SessionInputBuffer inbuffer = new SessionInputBufferMockup(
                 new TimeoutByteArrayInputStream(s.getBytes("US-ASCII")), 16);
-        
+
         HttpResponseParser parser = new HttpResponseParser(
-                inbuffer, 
+                inbuffer,
                 BasicLineParser.DEFAULT,
                 new DefaultHttpResponseFactory(),
-                new BasicHttpParams()); 
-        
+                new BasicHttpParams());
+
         int timeoutCount = 0;
-        
+
         HttpResponse httpresponse = null;
         for (int i = 0; i < 10; i++) {
             try {
@@ -155,7 +155,7 @@ public class TestResponseParser extends 
             } catch (InterruptedIOException ex) {
                 timeoutCount++;
             }
-            
+
         }
         assertNotNull(httpresponse);
         assertEquals(5, timeoutCount);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestAbstractMessage.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestAbstractMessage.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestAbstractMessage.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestAbstractMessage.java Fri Apr 23 13:44:00 2010
@@ -57,14 +57,14 @@ public class TestAbstractMessage extends
     public void testBasicHeaderOps() {
         HttpMessage message = new HttpMessageMockup();
         assertFalse(message.containsHeader("whatever"));
-        
+
         message.addHeader("name", "1");
         message.addHeader("name", "2");
-        
+
         Header[] headers = message.getAllHeaders();
         assertNotNull(headers);
         assertEquals(2, headers.length);
-        
+
         Header h = message.getFirstHeader("name");
         assertNotNull(h);
         assertEquals("1", h.getValue());
@@ -76,11 +76,11 @@ public class TestAbstractMessage extends
         h = message.getLastHeader("name");
         assertNotNull(h);
         assertEquals("2", h.getValue());
-        
+
         // Should have no effect
         message.addHeader(null);
         message.setHeader(null);
-        
+
         headers = message.getHeaders("name");
         assertNotNull(headers);
         assertEquals(2, headers.length);
@@ -88,16 +88,16 @@ public class TestAbstractMessage extends
         assertEquals("2", headers[1].getValue());
 
         message.addHeader("name", "4");
-        
+
         headers[1] = new BasicHeader("name", "5");
         message.setHeaders(headers);
-        
+
         headers = message.getHeaders("name");
         assertNotNull(headers);
         assertEquals(2, headers.length);
         assertEquals("3", headers[0].getValue());
         assertEquals("5", headers[1].getValue());
-        
+
         message.setHeader("whatever", null);
         message.removeHeaders("name");
         message.removeHeaders(null);
@@ -141,6 +141,6 @@ public class TestAbstractMessage extends
             // expected
         }
     }
-    
+
 }
 

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderElementIterator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderElementIterator.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderElementIterator.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderElementIterator.java Fri Apr 23 13:44:00 2010
@@ -37,10 +37,10 @@ import org.apache.http.HeaderElementIter
 
 /**
  * Tests for {@link BasicHeaderElementIterator}.
- * 
+ *
  */
 public class TestBasicHeaderElementIterator extends TestCase {
-    
+
     // ------------------------------------------------------------ Constructor
     public TestBasicHeaderElementIterator(String testName) {
         super(testName);
@@ -51,19 +51,19 @@ public class TestBasicHeaderElementItera
                 new BasicHeader("Name", "value0"),
                 new BasicHeader("Name", "value1")
         };
-       
-        HeaderElementIterator hei = 
+
+        HeaderElementIterator hei =
                 new BasicHeaderElementIterator(
                         new BasicHeaderIterator(headers, "Name"));
-        
+
         assertTrue(hei.hasNext());
         HeaderElement elem = (HeaderElement) hei.next();
-        assertEquals("The two header values must be equal", 
+        assertEquals("The two header values must be equal",
                 "value0", elem.getName());
-        
+
         assertTrue(hei.hasNext());
         elem = (HeaderElement)hei.next();
-        assertEquals("The two header values must be equal", 
+        assertEquals("The two header values must be equal",
                 "value1", elem.getName());
 
         assertFalse(hei.hasNext());
@@ -82,46 +82,46 @@ public class TestBasicHeaderElementItera
             // expected
         }
     }
-    
+
     public void testMultiHeaderSameLine() {
         Header[] headers = new Header[]{
                 new BasicHeader("name", "value0,value1"),
                 new BasicHeader("nAme", "cookie1=1,cookie2=2")
         };
-        
-        HeaderElementIterator hei = 
+
+        HeaderElementIterator hei =
                 new BasicHeaderElementIterator(new BasicHeaderIterator(headers, "Name"));
-        
+
         HeaderElement elem = (HeaderElement)hei.next();
-        assertEquals("The two header values must be equal", 
+        assertEquals("The two header values must be equal",
                 "value0", elem.getName());
         elem = (HeaderElement)hei.next();
-        assertEquals("The two header values must be equal", 
+        assertEquals("The two header values must be equal",
                 "value1", elem.getName());
         elem = (HeaderElement)hei.next();
-        assertEquals("The two header values must be equal", 
+        assertEquals("The two header values must be equal",
                 "cookie1", elem.getName());
-        assertEquals("The two header values must be equal", 
+        assertEquals("The two header values must be equal",
                 "1", elem.getValue());
-        
+
         elem = (HeaderElement)hei.next();
-        assertEquals("The two header values must be equal", 
+        assertEquals("The two header values must be equal",
                 "cookie2", elem.getName());
-        assertEquals("The two header values must be equal", 
+        assertEquals("The two header values must be equal",
                 "2", elem.getValue());
     }
-    
+
     public void testFringeCases() {
         Header[] headers = new Header[]{
                 new BasicHeader("Name", null),
                 new BasicHeader("Name", "    "),
                 new BasicHeader("Name", ",,,")
         };
-       
-        HeaderElementIterator hei = 
+
+        HeaderElementIterator hei =
                 new BasicHeaderElementIterator(
                         new BasicHeaderIterator(headers, "Name"));
-        
+
         assertFalse(hei.hasNext());
         try {
             hei.next();
@@ -138,5 +138,5 @@ public class TestBasicHeaderElementItera
             // expected
         }
     }
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueFormatter.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueFormatter.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueFormatter.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueFormatter.java Fri Apr 23 13:44:00 2010
@@ -49,12 +49,12 @@ public class TestBasicHeaderValueFormatt
     // ------------------------------------------------------- TestCase Methods
 
     public void testNVPFormatting() throws Exception {
-        NameValuePair param1 = new BasicNameValuePair("param", "regular_stuff"); 
-        NameValuePair param2 = new BasicNameValuePair("param", "this\\that"); 
-        NameValuePair param3 = new BasicNameValuePair("param", "this,that"); 
-        NameValuePair param4 = new BasicNameValuePair("param", "quote marks (\") must be escaped"); 
-        NameValuePair param5 = new BasicNameValuePair("param", "back slash (\\) must be escaped too"); 
-        NameValuePair param6 = new BasicNameValuePair("param", "values with\tblanks must always be quoted"); 
+        NameValuePair param1 = new BasicNameValuePair("param", "regular_stuff");
+        NameValuePair param2 = new BasicNameValuePair("param", "this\\that");
+        NameValuePair param3 = new BasicNameValuePair("param", "this,that");
+        NameValuePair param4 = new BasicNameValuePair("param", "quote marks (\") must be escaped");
+        NameValuePair param5 = new BasicNameValuePair("param", "back slash (\\) must be escaped too");
+        NameValuePair param6 = new BasicNameValuePair("param", "values with\tblanks must always be quoted");
         NameValuePair param7 = new BasicNameValuePair("param", null);
 
 
@@ -105,50 +105,50 @@ public class TestBasicHeaderValueFormatt
 
 
     public void testParamsFormatting() throws Exception {
-        NameValuePair param1 = new BasicNameValuePair("param", "regular_stuff"); 
-        NameValuePair param2 = new BasicNameValuePair("param", "this\\that"); 
+        NameValuePair param1 = new BasicNameValuePair("param", "regular_stuff");
+        NameValuePair param2 = new BasicNameValuePair("param", "this\\that");
         NameValuePair param3 = new BasicNameValuePair("param", "this,that");
-        NameValuePair[] params = new NameValuePair[] {param1, param2, param3}; 
-        assertEquals("param=regular_stuff; param=\"this\\\\that\"; param=\"this,that\"", 
+        NameValuePair[] params = new NameValuePair[] {param1, param2, param3};
+        assertEquals("param=regular_stuff; param=\"this\\\\that\"; param=\"this,that\"",
                      BasicHeaderValueFormatter.formatParameters(params, false, null));
-        assertEquals("param=\"regular_stuff\"; param=\"this\\\\that\"; param=\"this,that\"", 
+        assertEquals("param=\"regular_stuff\"; param=\"this\\\\that\"; param=\"this,that\"",
                      BasicHeaderValueFormatter.formatParameters(params, true, null));
     }
 
 
 
     public void testHEFormatting() throws Exception {
-        NameValuePair param1 = new BasicNameValuePair("param", "regular_stuff"); 
-        NameValuePair param2 = new BasicNameValuePair("param", "this\\that"); 
+        NameValuePair param1 = new BasicNameValuePair("param", "regular_stuff");
+        NameValuePair param2 = new BasicNameValuePair("param", "this\\that");
         NameValuePair param3 = new BasicNameValuePair("param", "this,that");
         NameValuePair param4 = new BasicNameValuePair("param", null);
         NameValuePair[] params = new NameValuePair[] {param1, param2, param3, param4};
-        HeaderElement element = new BasicHeaderElement("name", "value", params); 
-        
-        assertEquals("name=value; param=regular_stuff; param=\"this\\\\that\"; param=\"this,that\"; param", 
+        HeaderElement element = new BasicHeaderElement("name", "value", params);
+
+        assertEquals("name=value; param=regular_stuff; param=\"this\\\\that\"; param=\"this,that\"; param",
                      BasicHeaderValueFormatter.formatHeaderElement(element, false, null));
     }
-    
+
     public void testElementsFormatting() throws Exception {
-        NameValuePair param1 = new BasicNameValuePair("param", "regular_stuff"); 
-        NameValuePair param2 = new BasicNameValuePair("param", "this\\that"); 
+        NameValuePair param1 = new BasicNameValuePair("param", "regular_stuff");
+        NameValuePair param2 = new BasicNameValuePair("param", "this\\that");
         NameValuePair param3 = new BasicNameValuePair("param", "this,that");
         NameValuePair param4 = new BasicNameValuePair("param", null);
-        HeaderElement element1 = new BasicHeaderElement("name1", "value1", new NameValuePair[] {param1}); 
-        HeaderElement element2 = new BasicHeaderElement("name2", "value2", new NameValuePair[] {param2}); 
-        HeaderElement element3 = new BasicHeaderElement("name3", "value3", new NameValuePair[] {param3}); 
-        HeaderElement element4 = new BasicHeaderElement("name4", "value4", new NameValuePair[] {param4}); 
-        HeaderElement element5 = new BasicHeaderElement("name5", null); 
-        HeaderElement[] elements = new HeaderElement[] {element1, element2, element3, element4, element5}; 
-        
+        HeaderElement element1 = new BasicHeaderElement("name1", "value1", new NameValuePair[] {param1});
+        HeaderElement element2 = new BasicHeaderElement("name2", "value2", new NameValuePair[] {param2});
+        HeaderElement element3 = new BasicHeaderElement("name3", "value3", new NameValuePair[] {param3});
+        HeaderElement element4 = new BasicHeaderElement("name4", "value4", new NameValuePair[] {param4});
+        HeaderElement element5 = new BasicHeaderElement("name5", null);
+        HeaderElement[] elements = new HeaderElement[] {element1, element2, element3, element4, element5};
+
         assertEquals
             ("name1=value1; param=regular_stuff, name2=value2; " +
              "param=\"this\\\\that\", name3=value3; param=\"this,that\", " +
-             "name4=value4; param, name5", 
+             "name4=value4; param, name5",
              BasicHeaderValueFormatter.formatElements(elements, false, null));
     }
 
-    
+
     public void testInvalidHEArguments() throws Exception {
         try {
             BasicHeaderValueFormatter.formatHeaderElement

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueParser.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicHeaderValueParser.java Fri Apr 23 13:44:00 2010
@@ -83,7 +83,7 @@ public class TestBasicHeaderValueParser 
     }
 
     public void testParseHEEscaped() {
-        String s = 
+        String s =
           "test1 =  \"\\\"stuff\\\"\", test2= \"\\\\\", test3 = \"stuff, stuff\"";
         HeaderElement[] elements = BasicHeaderValueParser.parseElements(s, null);
         assertEquals(3, elements.length);
@@ -114,14 +114,14 @@ public class TestBasicHeaderValueParser 
     }
 
     public void testNVParseUsingCursor() {
-        
+
         HeaderValueParser parser = BasicHeaderValueParser.DEFAULT;
-        
+
         String s = "test";
         CharArrayBuffer buffer = new CharArrayBuffer(16);
         buffer.append(s);
         ParserCursor cursor = new ParserCursor(0, s.length());
-        
+
         NameValuePair param = parser.parseNameValuePair(buffer, cursor);
         assertEquals("test", param.getName());
         assertEquals(null, param.getValue());
@@ -132,40 +132,40 @@ public class TestBasicHeaderValueParser 
         buffer = new CharArrayBuffer(16);
         buffer.append(s);
         cursor = new ParserCursor(0, s.length());
-        
+
         param = parser.parseNameValuePair(buffer, cursor);
         assertEquals("test", param.getName());
         assertEquals(null, param.getValue());
         assertEquals(s.length(), cursor.getPos());
         assertTrue(cursor.atEnd());
-        
+
         s = "test  ,12";
         buffer = new CharArrayBuffer(16);
         buffer.append(s);
         cursor = new ParserCursor(0, s.length());
-        
+
         param = parser.parseNameValuePair(buffer, cursor);
         assertEquals("test", param.getName());
         assertEquals(null, param.getValue());
         assertEquals(s.length() - 2, cursor.getPos());
         assertFalse(cursor.atEnd());
-        
+
         s = "test=stuff";
         buffer = new CharArrayBuffer(16);
         buffer.append(s);
         cursor = new ParserCursor(0, s.length());
-        
+
         param = parser.parseNameValuePair(buffer, cursor);
         assertEquals("test", param.getName());
         assertEquals("stuff", param.getValue());
         assertEquals(s.length(), cursor.getPos());
         assertTrue(cursor.atEnd());
-        
+
         s = "   test  =   stuff ";
         buffer = new CharArrayBuffer(16);
         buffer.append(s);
         cursor = new ParserCursor(0, s.length());
-        
+
         param = parser.parseNameValuePair(buffer, cursor);
         assertEquals("test", param.getName());
         assertEquals("stuff", param.getValue());
@@ -176,36 +176,36 @@ public class TestBasicHeaderValueParser 
         buffer = new CharArrayBuffer(16);
         buffer.append(s);
         cursor = new ParserCursor(0, s.length());
-        
+
         param = parser.parseNameValuePair(buffer, cursor);
         assertEquals("test", param.getName());
         assertEquals("stuff", param.getValue());
         assertEquals(s.length() - 4, cursor.getPos());
         assertFalse(cursor.atEnd());
-        
+
         s = "test  = \"stuff\"";
         buffer = new CharArrayBuffer(16);
         buffer.append(s);
         cursor = new ParserCursor(0, s.length());
-        
+
         param = parser.parseNameValuePair(buffer, cursor);
         assertEquals("test", param.getName());
         assertEquals("stuff", param.getValue());
-        
+
         s = "test  = \"  stuff\\\"\"";
         buffer = new CharArrayBuffer(16);
         buffer.append(s);
         cursor = new ParserCursor(0, s.length());
-        
+
         param = parser.parseNameValuePair(buffer, cursor);
         assertEquals("test", param.getName());
         assertEquals("  stuff\\\"", param.getValue());
-        
+
         s = "  test";
         buffer = new CharArrayBuffer(16);
         buffer.append(s);
         cursor = new ParserCursor(0, s.length());
-        
+
         param = parser.parseNameValuePair(buffer, cursor);
         assertEquals("test", param.getName());
         assertEquals(null, param.getValue());
@@ -214,7 +214,7 @@ public class TestBasicHeaderValueParser 
         buffer = new CharArrayBuffer(16);
         buffer.append(s);
         cursor = new ParserCursor(0, s.length());
-        
+
         param = parser.parseNameValuePair(buffer, cursor);
         assertEquals("", param.getName());
         assertEquals(null, param.getValue());
@@ -223,7 +223,7 @@ public class TestBasicHeaderValueParser 
         buffer = new CharArrayBuffer(16);
         buffer.append(s);
         cursor = new ParserCursor(0, s.length());
-        
+
         param = parser.parseNameValuePair(buffer, cursor);
         assertEquals("", param.getName());
         assertEquals("stuff", param.getValue());
@@ -240,22 +240,22 @@ public class TestBasicHeaderValueParser 
         param = BasicHeaderValueParser.parseNameValuePair(s, null);
         assertEquals("test", param.getName());
         assertEquals("stuff", param.getValue());
-        
+
         s = "   test  =   stuff ";
         param = BasicHeaderValueParser.parseNameValuePair(s, null);
         assertEquals("test", param.getName());
         assertEquals("stuff", param.getValue());
-        
+
         s = "test  = \"stuff\"";
         param = BasicHeaderValueParser.parseNameValuePair(s, null);
         assertEquals("test", param.getName());
         assertEquals("stuff", param.getValue());
-        
+
         s = "test  = \"  stuff\\\"\"";
         param = BasicHeaderValueParser.parseNameValuePair(s, null);
         assertEquals("test", param.getName());
         assertEquals("  stuff\\\"", param.getValue());
-        
+
         s = "  test";
         param = BasicHeaderValueParser.parseNameValuePair(s, null);
         assertEquals("test", param.getName());
@@ -274,13 +274,13 @@ public class TestBasicHeaderValueParser 
 
     public void testNVParseAllWithCursor() {
         HeaderValueParser parser = BasicHeaderValueParser.DEFAULT;
-        
-        String s = 
+
+        String s =
             "test; test1 =  stuff   ; test2 =  \"stuff; stuff\"; test3=\"stuff";
         CharArrayBuffer buffer = new CharArrayBuffer(16);
         buffer.append(s);
         ParserCursor cursor = new ParserCursor(0, s.length());
-        
+
         NameValuePair[] params = parser.parseParameters(buffer, cursor);
         assertEquals("test", params[0].getName());
         assertEquals(null, params[0].getValue());
@@ -293,12 +293,12 @@ public class TestBasicHeaderValueParser 
         assertEquals(s.length(), cursor.getPos());
         assertTrue(cursor.atEnd());
 
-        s = 
+        s =
             "test; test1 =  stuff   ; test2 =  \"stuff; stuff\"; test3=\"stuff\",123";
         buffer = new CharArrayBuffer(16);
         buffer.append(s);
         cursor = new ParserCursor(0, s.length());
-        
+
         params = parser.parseParameters(buffer, cursor);
         assertEquals("test", params[0].getName());
         assertEquals(null, params[0].getValue());
@@ -320,7 +320,7 @@ public class TestBasicHeaderValueParser 
     }
 
     public void testNVParseAll() {
-        String s = 
+        String s =
           "test; test1 =  stuff   ; test2 =  \"stuff; stuff\"; test3=\"stuff";
         NameValuePair[] params =
             BasicHeaderValueParser.parseParameters(s, null);
@@ -339,7 +339,7 @@ public class TestBasicHeaderValueParser 
     }
 
     public void testNVParseEscaped() {
-        String s = 
+        String s =
           "test1 =  \"\\\"stuff\\\"\"; test2= \"\\\\\"; test3 = \"stuff; stuff\"";
         NameValuePair[] params =
             BasicHeaderValueParser.parseParameters(s, null);

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicLineFormatter.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicLineFormatter.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicLineFormatter.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicLineFormatter.java Fri Apr 23 13:44:00 2010
@@ -55,7 +55,7 @@ public class TestBasicLineFormatter exte
             (HttpVersion.HTTP_1_1, null);
         assertEquals("HTTP/1.1", s);
     }
-    
+
     public void testHttpVersionFormattingInvalidInput() throws Exception {
         try {
             BasicLineFormatter.formatProtocolVersion
@@ -79,7 +79,7 @@ public class TestBasicLineFormatter exte
         String s = BasicLineFormatter.formatRequestLine(requestline, null);
         assertEquals("GET /stuff HTTP/1.1", s);
     }
-    
+
     public void testRLFormattingInvalidInput() throws Exception {
         try {
             BasicLineFormatter.formatRequestLine
@@ -98,7 +98,7 @@ public class TestBasicLineFormatter exte
     }
 
 
-    
+
     public void testSLFormatting() throws Exception {
         StatusLine statusline = new BasicStatusLine(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
         String s = BasicLineFormatter.formatStatusLine(statusline, null);
@@ -109,7 +109,7 @@ public class TestBasicLineFormatter exte
         // see "testSLParseSuccess" in TestBasicLineParser:
         // trailing space is correct
     }
-    
+
     public void testSLFormattingInvalidInput() throws Exception {
         try {
             BasicLineFormatter.formatStatusLine
@@ -133,10 +133,10 @@ public class TestBasicLineFormatter exte
         String s = BasicLineFormatter.formatHeader(header1, null);
         assertEquals("name: value", s);
         Header header2 = new BasicHeader("name", null);
-        s = BasicLineFormatter.formatHeader(header2, null); 
+        s = BasicLineFormatter.formatHeader(header2, null);
         assertEquals("name: ", s);
     }
-    
+
     public void testHeaderFormattingInvalidInput() throws Exception {
         try {
             BasicLineFormatter.formatHeader
@@ -153,5 +153,5 @@ public class TestBasicLineFormatter exte
             // expected
         }
     }
-     
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicLineParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicLineParser.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicLineParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicLineParser.java Fri Apr 23 13:44:00 2010
@@ -231,9 +231,9 @@ public class TestBasicLineParser extends
         CharArrayBuffer buffer = new CharArrayBuffer(16);
         buffer.append(s);
         ParserCursor cursor = new ParserCursor(0, s.length());
-        
+
         LineParser parser = BasicLineParser.DEFAULT;
-        
+
         HttpVersion version = (HttpVersion) parser.parseProtocolVersion(buffer, cursor);
         assertEquals("HTTP protocol name", "HTTP", version.getProtocol());
         assertEquals("HTTP major version number", 1, version.getMajor());
@@ -241,12 +241,12 @@ public class TestBasicLineParser extends
         assertEquals("HTTP version number", "HTTP/1.1", version.toString());
         assertEquals(s.length(), cursor.getPos());
         assertTrue(cursor.atEnd());
-        
+
         s = "HTTP/1.123 123";
         buffer = new CharArrayBuffer(16);
         buffer.append(s);
         cursor = new ParserCursor(0, s.length());
-        
+
         version = (HttpVersion) parser.parseProtocolVersion(buffer, cursor);
         assertEquals("HTTP protocol name", "HTTP", version.getProtocol());
         assertEquals("HTTP major version number", 1, version.getMajor());

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicMessages.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicMessages.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicMessages.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestBasicMessages.java Fri Apr 23 13:44:00 2010
@@ -53,7 +53,7 @@ public class TestBasicMessages extends T
         assertNotNull(response.getProtocolVersion());
         assertEquals(HttpVersion.HTTP_1_0, response.getProtocolVersion());
         assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusLine().getStatusCode());
-        
+
         response = new BasicHttpResponse(new BasicStatusLine(
                 HttpVersion.HTTP_1_1, HttpStatus.SC_INTERNAL_SERVER_ERROR, "whatever"));
         assertNotNull(response.getProtocolVersion());
@@ -67,19 +67,19 @@ public class TestBasicMessages extends T
         assertNotNull(response.getProtocolVersion());
         assertNotNull(response.getStatusLine());
         assertEquals(200, response.getStatusLine().getStatusCode());
-        
+
         response = new BasicHttpResponse(HttpVersion.HTTP_1_0, HttpStatus.SC_BAD_REQUEST, "Bad Request");
         assertNotNull(response.getProtocolVersion());
         assertEquals(HttpVersion.HTTP_1_0, response.getProtocolVersion());
         assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusLine().getStatusCode());
-        
+
         response = new BasicHttpResponse(new BasicStatusLine(
                 HttpVersion.HTTP_1_1, HttpStatus.SC_INTERNAL_SERVER_ERROR, "whatever"));
         assertNotNull(response.getProtocolVersion());
         assertEquals(HttpVersion.HTTP_1_1, response.getProtocolVersion());
         assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getStatusLine().getStatusCode());
         assertEquals("whatever", response.getStatusLine().getReasonPhrase());
-        
+
         response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
         try {
             response.setStatusCode(-23);
@@ -102,11 +102,11 @@ public class TestBasicMessages extends T
             // expected
         }
     }
-    
+
     public void testSetResponseEntity() {
         HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
         assertNull(response.getEntity());
-        
+
         HttpEntity entity = new BasicHttpEntity();
         response.setEntity(entity);
         assertTrue(entity == response.getEntity());
@@ -142,7 +142,7 @@ public class TestBasicMessages extends T
             // expected
         }
     }
-    
+
     public void testDefaultEntityEnclosingRequestConstructors() {
         BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("GET", "/");
         assertNotNull(request.getProtocolVersion());
@@ -154,11 +154,11 @@ public class TestBasicMessages extends T
         assertEquals("GET", request.getRequestLine().getMethod());
         assertEquals("/", request.getRequestLine().getUri());
     }
-    
+
     public void testSetRequestEntity() {
         BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("GET", "/");
         assertNull(request.getEntity());
-        
+
         HttpEntity entity = new BasicHttpEntity();
         request.setEntity(entity);
         assertTrue(entity == request.getEntity());
@@ -166,11 +166,11 @@ public class TestBasicMessages extends T
 
     public void testExpectContinue() {
         BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("GET", "/");
-        assertFalse(request.expectContinue()); 
+        assertFalse(request.expectContinue());
         request.getParams().setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, true);
         assertFalse(request.expectContinue());
         request.addHeader("Expect", "100-Continue");
-        assertTrue(request.expectContinue()); 
+        assertTrue(request.expectContinue());
     }
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestHeader.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestHeader.java?rev=937295&r1=937294&r2=937295&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestHeader.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestHeader.java Fri Apr 23 13:44:00 2010
@@ -44,16 +44,16 @@ public class TestHeader extends TestCase
 
     public void testBasicConstructor() {
         Header header = new BasicHeader("name", "value");
-        assertEquals("name", header.getName()); 
-        assertEquals("value", header.getValue()); 
+        assertEquals("name", header.getName());
+        assertEquals("value", header.getValue());
     }
-    
+
     public void testBasicConstructorNullValue() {
         Header header = new BasicHeader("name", null);
-        assertEquals("name", header.getName()); 
-        assertEquals(null, header.getValue()); 
+        assertEquals("name", header.getName());
+        assertEquals(null, header.getValue());
     }
-    
+
     public void testInvalidName() {
         try {
             new BasicHeader(null, null);
@@ -62,31 +62,31 @@ public class TestHeader extends TestCase
             //expected
         }
     }
-    
+
     public void testToString() {
         Header header1 = new BasicHeader("name1", "value1");
         assertEquals("name1: value1", header1.toString());
         Header header2 = new BasicHeader("name2", null);
         assertEquals("name2: ", header2.toString());
     }
-    
+
     public void testHeaderElements() {
         Header header = new BasicHeader("name", "element1 = value1, element2; param1 = value1, element3");
-        HeaderElement[] elements = header.getElements(); 
-        assertNotNull(elements); 
-        assertEquals(3, elements.length); 
-        assertEquals("element1", elements[0].getName()); 
-        assertEquals("value1", elements[0].getValue()); 
-        assertEquals("element2", elements[1].getName()); 
-        assertEquals(null, elements[1].getValue()); 
-        assertEquals("element3", elements[2].getName()); 
-        assertEquals(null, elements[2].getValue()); 
-        assertEquals(1, elements[1].getParameters().length); 
-        
+        HeaderElement[] elements = header.getElements();
+        assertNotNull(elements);
+        assertEquals(3, elements.length);
+        assertEquals("element1", elements[0].getName());
+        assertEquals("value1", elements[0].getValue());
+        assertEquals("element2", elements[1].getName());
+        assertEquals(null, elements[1].getValue());
+        assertEquals("element3", elements[2].getName());
+        assertEquals(null, elements[2].getValue());
+        assertEquals(1, elements[1].getParameters().length);
+
         header = new BasicHeader("name", null);
         elements = header.getElements();
-        assertNotNull(elements); 
-        assertEquals(0, elements.length); 
+        assertNotNull(elements);
+        assertEquals(0, elements.length);
     }
 
     public void testCloning() throws Exception {
@@ -95,6 +95,6 @@ public class TestHeader extends TestCase
         assertEquals(orig.getName(), clone.getName());
         assertEquals(orig.getValue(), clone.getValue());
     }
-    
+
 }
 



Mime
View raw message