Package org.apache.commons.httpclient.methods

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


        httpClient.executeMethod(meth);
       
        Assert.assertEquals(200, meth.getStatusCode());
        Assert.assertEquals("OK", meth.getResponseBodyAsString());
       
        meth.releaseConnection();
       
        server.close();
    }

   
View Full Code Here


    httpClient.executeMethod(meth);
   
    String body = meth.getResponseBodyAsString();
    Assert.assertEquals("Hello", body);
 
    meth.releaseConnection();
    server.close();
  }


 
View Full Code Here

        httpClient.executeMethod(meth);
       
        Assert.assertEquals(200, meth.getStatusCode());
        Assert.assertEquals("OK", meth.getResponseBodyAsString());
       
        meth.releaseConnection();
       
        server.close();
    }

   
View Full Code Here

        try {
            int result = httpclient.executeMethod(post);
            assertEquals(415, result);
        } finally {
            // Release current connection to the connection pool once you are done
            post.releaseConnection();
        }
    }
   
    @Test
    public void testConsumeTypeMismatch() throws Exception {
View Full Code Here

        try {
            int result = httpclient.executeMethod(post);
            assertEquals(415, result);
        } finally {
            // Release current connection to the connection pool once you are done
            post.releaseConnection();
        }
    }
   
    @Test
    public void testBookExists() throws Exception {
View Full Code Here

        try {
            int result = httpclient.executeMethod(post);
            assertEquals(400, result);
        } finally {
            // Release current connection to the connection pool once you are done
            post.releaseConnection();
        }
    }
   
    @Test
    public void testAddBookEmptyContent() throws Exception {
View Full Code Here

           
            assertEquals(stripXmlInstructionIfNeeded(getStringFromInputStream(expected)),
                         stripXmlInstructionIfNeeded(post.getResponseBodyAsString()));
        } finally {
            // Release current connection to the connection pool once you are done
            post.releaseConnection();
        }
    }
   
   
    @Test
View Full Code Here

            int result = httpclient.executeMethod(post);
            assertEquals(200, result);
            assertEquals(post.getResponseBodyAsString(), "12345");
        } finally {
            // Release current connection to the connection pool once you are done
            post.releaseConnection();
       
    }
   
    @Test
    public void testDeleteBook() throws Exception {
View Full Code Here

            // Follow redirects and download page resources if appropriate:
            res = resultProcessing(areFollowingRedirect, frameDepth, res);

            log.debug("End : sample");
            httpMethod.releaseConnection();
            return res;
        } catch (IllegalArgumentException e)// e.g. some kinds of invalid URL
        {
            res.sampleEnd();
            HTTPSampleResult err = errorResult(e, res);
View Full Code Here

            err.setSampleLabel("Error: " + url.toString());
            return err;
        } finally {
            JOrphanUtils.closeQuietly(instream);
            setSavedClient(null);
            httpMethod.releaseConnection();
        }
    }

    @Override
    public URL getUrl() throws MalformedURLException {
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.