avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/http JettyTestCase.java
Date Sat, 21 Dec 2002 22:24:07 GMT
hammant     2002/12/21 14:24:07

  Modified:    altrmi/src/test/org/apache/excalibur/altrmi/test/http
                        JettyTestCase.java
  Log:
  Add post test
  
  Revision  Changes    Path
  1.3       +18 -0     jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/http/JettyTestCase.java
  
  Index: JettyTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/altrmi/src/test/org/apache/excalibur/altrmi/test/http/JettyTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JettyTestCase.java	21 Dec 2002 20:57:32 -0000	1.2
  +++ JettyTestCase.java	21 Dec 2002 22:24:07 -0000	1.3
  @@ -10,6 +10,7 @@
   import junit.framework.TestCase;
   import org.apache.commons.httpclient.HttpClient;
   import org.apache.commons.httpclient.methods.GetMethod;
  +import org.apache.commons.httpclient.methods.PostMethod;
   import org.mortbay.http.HttpContext;
   import org.mortbay.http.HttpServer;
   import org.mortbay.http.SocketListener;
  @@ -89,6 +90,23 @@
           // make sure the get is reentrant
           testHttpClientGet();
       }
  +
  +    public void testHttpClientPost() throws Exception {
  +        HttpClient client = new HttpClient();
  +        client.getHostConfiguration().setHost("localhost", HTTP_PORT, "http");
  +        // we shouldn't have to wait if a connection is available
  +        client.setHttpConnectionFactoryTimeout( 10 * 1000 );
  +
  +        PostMethod postMethod = new PostMethod("/test/hi.txt");
  +        client.executeMethod(postMethod);
  +        assertEquals("hi",new String(postMethod.getResponseBody()));
  +    }
  +
  +    public void testHttpClientPost2() throws Exception {
  +        // make sure the get is reentrant
  +        testHttpClientPost();
  +    }
  +
   
       protected void tearDown() throws Exception
       {
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message