hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r411097 - in /jakarta/httpcomponents/httpcore/trunk/src/test/org/apache/http: TestHeader.java util/TestHeaderUtils.java
Date Fri, 02 Jun 2006 08:58:48 GMT
Author: olegk
Date: Fri Jun  2 01:58:47 2006
New Revision: 411097

URL: http://svn.apache.org/viewvc?rev=411097&view=rev
Log:
Cleaned up test cases for HeaderUtils

Modified:
    jakarta/httpcomponents/httpcore/trunk/src/test/org/apache/http/TestHeader.java
    jakarta/httpcomponents/httpcore/trunk/src/test/org/apache/http/util/TestHeaderUtils.java

Modified: jakarta/httpcomponents/httpcore/trunk/src/test/org/apache/http/TestHeader.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/src/test/org/apache/http/TestHeader.java?rev=411097&r1=411096&r2=411097&view=diff
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/src/test/org/apache/http/TestHeader.java (original)
+++ jakarta/httpcomponents/httpcore/trunk/src/test/org/apache/http/TestHeader.java Fri Jun
 2 01:58:47 2006
@@ -29,6 +29,8 @@
 
 package org.apache.http;
 
+import org.apache.http.io.CharArrayBuffer;
+
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -99,6 +101,30 @@
         assertNotNull(elements); 
         assertEquals(0, elements.length); 
     }    
+ 
+    public void testHeaderFormatting() throws Exception {
+        Header header1 = new Header("name", "value");
+        String s = Header.format(header1); 
+        assertEquals("name: value", s);
+        Header header2 = new Header("name", null);
+        s = Header.format(header2); 
+        assertEquals("name: ", s);
+    }
     
+    public void testHeaderFormattingInvalidInput() throws Exception {
+        try {
+            Header.format(null, new Header("name", "value"));
+            fail("IllegalArgumentException should habe been thrown");
+        } catch (IllegalArgumentException ex) {
+            // expected
+        }
+        try {
+            Header.format(new CharArrayBuffer(10), (Header) null);
+            fail("IllegalArgumentException should habe been thrown");
+        } catch (IllegalArgumentException ex) {
+            // expected
+        }
+    }
+        
 }
 

Modified: jakarta/httpcomponents/httpcore/trunk/src/test/org/apache/http/util/TestHeaderUtils.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/src/test/org/apache/http/util/TestHeaderUtils.java?rev=411097&r1=411096&r2=411097&view=diff
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/src/test/org/apache/http/util/TestHeaderUtils.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/src/test/org/apache/http/util/TestHeaderUtils.java
Fri Jun  2 01:58:47 2006
@@ -33,7 +33,6 @@
 import org.apache.http.HeaderElement;
 import org.apache.http.NameValuePair;
 import org.apache.http.ProtocolException;
-import org.apache.http.io.CharArrayBuffer;
 import org.apache.http.io.HttpDataReceiver;
 import org.apache.http.mockup.HttpDataReceiverMockup;
 
@@ -158,30 +157,6 @@
         assertNotNull(headers);
         assertEquals(0, headers.length);
     }
-    
-    public void testHeaderFormatting() throws Exception {
-        Header header1 = new Header("name", "value");
-        String s = Header.format(header1); 
-        assertEquals("name: value", s);
-        Header header2 = new Header("name", null);
-        s = Header.format(header2); 
-        assertEquals("name: ", s);
-    }
-    
-    public void testHeaderFormattingInvalidInput() throws Exception {
-        try {
-            Header.format(null, new Header("name", "value"));
-            fail("IllegalArgumentException should habe been thrown");
-        } catch (IllegalArgumentException ex) {
-            // expected
-        }
-        try {
-            Header.format(new CharArrayBuffer(10), (Header) null);
-            fail("IllegalArgumentException should habe been thrown");
-        } catch (IllegalArgumentException ex) {
-            // expected
-        }
-    }
-    
+
 }
 



Mime
View raw message