hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rola...@apache.org
Subject svn commit: r569639 - /jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/message/TestBasicLineParser.java
Date Sat, 25 Aug 2007 08:02:31 GMT
Author: rolandw
Date: Sat Aug 25 01:02:30 2007
New Revision: 569639

URL: http://svn.apache.org/viewvc?rev=569639&view=rev
Log:
adjusted test cases to expect ParseException instead of ProtocolException

Modified:
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/message/TestBasicLineParser.java

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/message/TestBasicLineParser.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/message/TestBasicLineParser.java?rev=569639&r1=569638&r2=569639&view=diff
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/message/TestBasicLineParser.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/message/TestBasicLineParser.java
Sat Aug 25 01:02:30 2007
@@ -30,9 +30,8 @@
 
 package org.apache.http.message;
 
-import org.apache.http.HttpException;
 import org.apache.http.HttpVersion;
-import org.apache.http.ProtocolException;
+import org.apache.http.ParseException;
 import org.apache.http.RequestLine;
 import org.apache.http.StatusLine;
 import org.apache.http.message.BasicRequestLine;
@@ -96,28 +95,28 @@
         try {
             BasicLineParser.parseRequestLine("    ", null);
             fail();
-        } catch (HttpException e) {
+        } catch (ParseException e) {
             // expected
         }
 
         try {
             BasicLineParser.parseRequestLine("  GET", null);
             fail();
-        } catch (HttpException e) {
+        } catch (ParseException e) {
             // expected
         }
 
         try {
             BasicLineParser.parseRequestLine("GET /stuff", null);
             fail();
-        } catch (HttpException e) {
+        } catch (ParseException e) {
             // expected
         }
 
         try {
             BasicLineParser.parseRequestLine("GET/stuff HTTP/1.1", null);
             fail();
-        } catch (HttpException e) {
+        } catch (ParseException e) {
             // expected
         }
     }
@@ -221,27 +220,27 @@
         try {
             BasicLineParser.parseStatusLine("xxx 200 OK", null);
             fail();
-        } catch (HttpException e) {
+        } catch (ParseException e) {
             // expected
         }
 
         try {
             BasicLineParser.parseStatusLine("HTTP/1.1 xxx OK", null);
             fail();
-        } catch (HttpException e) {
+        } catch (ParseException e) {
             // expected
         }
 
         try {
             BasicLineParser.parseStatusLine("HTTP/1.1    ", null);
             fail();
-        } catch (HttpException e) {
+        } catch (ParseException e) {
             // expected
         }
         try {
             BasicLineParser.parseStatusLine("HTTP/1.1", null);
             fail();
-        } catch (HttpException e) {
+        } catch (ParseException e) {
             // expected
         }
     }
@@ -308,71 +307,71 @@
         try {
             BasicLineParser.parseProtocolVersion
                 ("    ", null);
-            fail("ProtocolException should have been thrown");
-        } catch (ProtocolException e) {
+            fail("ParseException should have been thrown");
+        } catch (ParseException e) {
             //expected
         }
         try {
             BasicLineParser.parseProtocolVersion
                 ("HTT", null);
-            fail("ProtocolException should have been thrown");
-        } catch (ProtocolException e) {
+            fail("ParseException should have been thrown");
+        } catch (ParseException e) {
             //expected
         }
         try {
             BasicLineParser.parseProtocolVersion
                 ("crap", null);
-            fail("ProtocolException should have been thrown");
-        } catch (ProtocolException e) {
+            fail("ParseException should have been thrown");
+        } catch (ParseException e) {
             //expected
         }
         try {
             BasicLineParser.parseProtocolVersion
                 ("HTTP/crap", null);
-            fail("ProtocolException should have been thrown");
-        } catch (ProtocolException e) {
+            fail("ParseException should have been thrown");
+        } catch (ParseException e) {
             //expected
         }
         try {
             BasicLineParser.parseProtocolVersion
                 ("HTTP/1", null);
-            fail("ProtocolException should have been thrown");
-        } catch (ProtocolException e) {
+            fail("ParseException should have been thrown");
+        } catch (ParseException e) {
             //expected
         }
         try {
             BasicLineParser.parseProtocolVersion
                 ("HTTP/1234   ", null);
-            fail("ProtocolException should have been thrown");
-        } catch (ProtocolException e) {
+            fail("ParseException should have been thrown");
+        } catch (ParseException e) {
             //expected
         }
         try {
             BasicLineParser.parseProtocolVersion
                 ("HTTP/1.", null);
-            fail("ProtocolException should have been thrown");
-        } catch (ProtocolException e) {
+            fail("ParseException should have been thrown");
+        } catch (ParseException e) {
             //expected
         }
         try {
             BasicLineParser.parseProtocolVersion
                 ("HTTP/1.1 crap", null);
-            fail("ProtocolException should have been thrown");
-        } catch (ProtocolException e) {
+            fail("ParseException should have been thrown");
+        } catch (ParseException e) {
             //expected
         }
         try {
             BasicLineParser.parseProtocolVersion
                 ("HTTP/whatever.whatever whatever", null);
-            fail("ProtocolException should have been thrown");
-        } catch (ProtocolException e) {
+            fail("ParseException should have been thrown");
+        } catch (ParseException e) {
             //expected
         }
         try {
             BasicLineParser.parseProtocolVersion
                 ("HTTP/1.whatever whatever", null);
-            fail("ProtocolException should have been thrown");
-        } catch (ProtocolException e) {
+            fail("ParseException should have been thrown");
+        } catch (ParseException e) {
             //expected
         }
     }



Mime
View raw message