[Httpunit-commit] CVS: httpunit/test/com/meterware/pseudoserver PseudoServerTest.java,1.4,1.5
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2002-09-05 19:29:58
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/pseudoserver
In directory usw-pr-cvs1:/tmp/cvs-serv8075/test/com/meterware/pseudoserver
Modified Files:
PseudoServerTest.java
Log Message:
Improved handling of not found exceptions
Index: PseudoServerTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/pseudoserver/PseudoServerTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PseudoServerTest.java 5 Sep 2002 19:10:44 -0000 1.4
+++ PseudoServerTest.java 5 Sep 2002 19:29:55 -0000 1.5
@@ -19,13 +19,7 @@
* DEALINGS IN THE SOFTWARE.
*
*******************************************************************************************************************/
-import com.meterware.httpunit.WebConversation;
-import com.meterware.httpunit.WebResponse;
-import com.meterware.httpunit.HttpNotFoundException;
-import com.meterware.httpunit.WebRequest;
-import com.meterware.httpunit.GetMethodWebRequest;
-import com.meterware.httpunit.HttpException;
-import com.meterware.httpunit.PostMethodWebRequest;
+import com.meterware.httpunit.*;
import junit.framework.TestCase;
import junit.framework.TestSuite;
@@ -55,7 +49,8 @@
try {
WebResponse response = wc.getResponse( "http://no.such.host" );
- } catch (HttpNotFoundException e) {
+ fail( "Should have rejected the request" );
+ } catch (HttpServerNotFoundException e) {
}
}
@@ -68,6 +63,7 @@
fail( "Should have rejected the request" );
} catch (HttpNotFoundException e) {
assertEquals( "Response code", HttpURLConnection.HTTP_NOT_FOUND, e.getResponseCode() );
+ assertEquals( "Response message", "unable to find /nothing.htm", e.getResponseMessage() );
}
}
|