Package org.apache.commons.httpclient.methods

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


            int result = httpclient1.executeMethod(put);
            assertEquals(200, result);
        } finally {
            // Release current connection to the connection pool once you are
            // done
            put1.releaseConnection();
        }
    } 
   
    @Test
    public void testUpdateBookWithDom() throws Exception {
View Full Code Here


            //System.out.println(s);           
            assertTrue(resp.indexOf(s) >= 0);
        } finally {
            // Release current connection to the connection pool once you are
            // done
            put.releaseConnection();
        }
    }
   
    @Test
    public void testUpdateBookWithJSON() throws Exception {
View Full Code Here

            int result = httpclient.executeMethod(put);
            assertEquals(200, result);
        } finally {
            // Release current connection to the connection pool once you are
            // done
            put.releaseConnection();
        }

        // Verify result
        endpointAddress = "http://localhost:" + PORT + "/bookstore/books/123";
        URL url = new URL(endpointAddress);
View Full Code Here

            int result = httpclient1.executeMethod(put);
            assertEquals(200, result);
        } finally {
            // Release current connection to the connection pool once you are
            // done
            put1.releaseConnection();
        }
    }
   
    @Test
    public void testUpdateBookFailed() throws Exception {
View Full Code Here

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

        try {
            put.setRequestEntity(new FileRequestEntity(src));
            int statusCode = client.executeMethod(put);
            validatePutStatusCode(dest, statusCode, null);
        } finally {
            put.releaseConnection();
        }
    }

    public URLInfo getURLInfo(URL url) {
        return getURLInfo(url, 0);
View Full Code Here

             * sets a last modified date
             */
            client.executeMethod(putMethod);
            assertEquals(204, putMethod.getStatusCode());
        } finally {
            putMethod.releaseConnection();
        }

        GetMethod getMethod = new GetMethod(getBaseURI() + "/context/request/date");
        getMethod.setRequestHeader("If-Modified-Since", formatter.format(d));
        try {
View Full Code Here

             * sets a last modified date
             */
            client.executeMethod(putMethod);
            assertEquals(204, putMethod.getStatusCode());
        } finally {
            putMethod.releaseConnection();
        }

        GetMethod getMethod = new GetMethod(getBaseURI() + "/context/request/date");
        getMethod.setRequestHeader("If-Unmodified-Since", formatter.format(d));
        try {
View Full Code Here

             * sets an entity tag
             */
            client.executeMethod(putMethod);
            assertEquals(204, putMethod.getStatusCode());
        } finally {
            putMethod.releaseConnection();
        }

        GetMethod getMethod = new GetMethod(getBaseURI() + "/context/request/etag");
        getMethod.setRequestHeader("If-Match", setETag);
        try {
View Full Code Here

             * sets an entity tag
             */
            client.executeMethod(putMethod);
            assertEquals(204, putMethod.getStatusCode());
        } finally {
            putMethod.releaseConnection();
        }

        GetMethod getMethod = new GetMethod(getBaseURI() + "/context/request/etag");
        getMethod.setRequestHeader("If-None-Match", setETag);
        try {
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.