[Httpunit-commit] CVS: httpunit/test/com/meterware/httpunit PseudoServerTest.java,1.14,1.15
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2001-07-23 03:05:33
|
Update of /cvsroot/httpunit/httpunit/test/com/meterware/httpunit
In directory usw-pr-cvs1:/tmp/cvs-serv15976/test/com/meterware/httpunit
Modified Files:
PseudoServerTest.java
Log Message:
From David Karr: corrected handling of 3xx responses
Index: PseudoServerTest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/test/com/meterware/httpunit/PseudoServerTest.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- PseudoServerTest.java 2001/07/17 12:50:47 1.14
+++ PseudoServerTest.java 2001/07/23 03:05:30 1.15
@@ -76,7 +76,25 @@
}
- public void notestInternalErrorException() throws Exception {
+ public void testNotModifiedResponse() throws Exception {
+ PseudoServer ps = new PseudoServer();
+ ps.setErrorResource( "error.htm", 304, "Not Modified" );
+ int port = ps.getConnectedPort();
+
+ try {
+ WebConversation wc = new WebConversation();
+ WebRequest request = new GetMethodWebRequest( "http://localhost:" + port + "/error.htm" );
+ WebResponse response = wc.getResponse( request );
+ assertEquals( "Response code", 304, response.getResponseCode() );
+ response.getText();
+ response.getInputStream().read();
+ } finally {
+ ps.shutDown();
+ }
+ }
+
+
+ public void testInternalErrorException() throws Exception {
PseudoServer ps = new PseudoServer();
ps.setErrorResource( "error.htt", 501, "Internal error" );
int port = ps.getConnectedPort();
|