Package org.apache.commons.httpclient.methods

Examples of org.apache.commons.httpclient.methods.PostMethod.releaseConnection()


         Assert.assertEquals(HttpServletResponse.SC_NO_CONTENT, status);

         status = client.executeMethod(get);
         Assert.assertEquals(HttpServletResponse.SC_GONE, status);

         method.releaseConnection();
      }
      // test readAndRemove
      {
         dispatcher.setMaxCacheSize(10);
         latch = new CountDownLatch(1);
View Full Code Here


      {
         PostMethod method = createPostMethod("/storeXML");
         method.setRequestEntity(new StringRequestEntity(XML_CONTENT, "application/xml", null));
         int status = client.executeMethod(method);
         Assert.assertEquals(201, status);
         method.releaseConnection();
      }
      {
         PostMethod method = createPostMethod("/storeXML/abstract");
         method.setRequestEntity(new StringRequestEntity(XML_CONTENT, "application/xml", null));
         int status = client.executeMethod(method);
View Full Code Here

      {
         PostMethod method = createPostMethod("/storeXML/abstract");
         method.setRequestEntity(new StringRequestEntity(XML_CONTENT, "application/xml", null));
         int status = client.executeMethod(method);
         Assert.assertEquals(201, status);
         method.releaseConnection();
      }
   }
}
View Full Code Here

         Assert.assertEquals(HttpServletResponse.SC_NO_CONTENT, status);

         status = client.executeMethod(get);
         Assert.assertEquals(HttpServletResponse.SC_GONE, status);

         method.releaseConnection();
      }

      {
         dispatcher.setMaxCacheSize(1);
         latch = new CountDownLatch(1);
View Full Code Here

         Assert.assertEquals(HttpServletResponse.SC_NO_CONTENT, status);

         status = client.executeMethod(get);
         Assert.assertEquals(HttpServletResponse.SC_GONE, status);

         method.releaseConnection();
      }
      // test readAndRemove
      {
         dispatcher.setMaxCacheSize(10);
         latch = new CountDownLatch(1);
View Full Code Here

      PostMethod post = new PostMethod(generateURL("/inputstream/test/json"));
      ByteArrayRequestEntity entity = new ByteArrayRequestEntity("hello world".getBytes(), null);
      post.setRequestEntity(entity);
      int status = client.executeMethod(post);
      Assert.assertEquals(204, status);
      post.releaseConnection();
   }
}
View Full Code Here

      String contentType = method.getResponseHeader("content-type").getValue();
      Assert.assertEquals("image/png", contentType);

      ByteArrayOutputStream fromServer = new ByteArrayOutputStream();
      writeTo(in, fromServer);
      method.releaseConnection();

      File savedPng = LocateTestData.getTestData("harper.png");
      FileInputStream fis = new FileInputStream(savedPng);

      ByteArrayOutputStream fromTestData = new ByteArrayOutputStream();
View Full Code Here

      PostMethod method = new PostMethod(TEST_URI);
      method.setRequestEntity(new FileRequestEntity(file, "image/jpeg"));
      int status = client.executeMethod(method);
      Assert.assertEquals(HttpServletResponse.SC_OK, status);
      Assert.assertEquals("image/jpeg", method.getResponseBodyAsString());
      method.releaseConnection();
   }

   @Test
   public void testEchoDataSourceBigData() throws Exception
   {
View Full Code Here

            ris.close();
         if (fis != null)
            fis.close();
      }

      method.releaseConnection();
   }

   @Test
   public void testEchoDataSourceSmallData() throws Exception
   {
View Full Code Here

            ris.close();
         if (bis != null)
            bis.close();
      }

      method.releaseConnection();
   }

   @Test
   public void testGetDataSource() throws Exception
   {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.