Package org.apache.commons.httpclient.methods

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


                }

            } catch (Exception e) {
                msg.setFaultBody(new ServiceRuntimeException(e));
            } finally {
                putMethod.releaseConnection();
            }

            return msg;
        }
    }
View Full Code Here


                }

            } catch (Exception e) {
                msg.setFaultBody(new ServiceRuntimeException(e));
            } finally {
                putMethod.releaseConnection();
            }

            return msg;
        }
    }
View Full Code Here

        put.setRequestEntity(new StringRequestEntity("Test body"));
        try {
            this.client.executeMethod(put);
            assertEquals("Test body", put.getResponseBodyAsString());
        } finally {
            put.releaseConnection();
        }
        assertNotNull(put.getStatusLine());
        assertEquals(HttpStatus.SC_OK, put.getStatusLine().getStatusCode());
        Header auth = put.getRequestHeader("Authorization");
        assertNotNull(auth);
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:9080/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 testUpdateBookWithDom() throws Exception {
View Full Code Here

            InputStream expected = getClass().getResourceAsStream("resources/update_book.txt");
            assertTrue(resp.indexOf(getStringFromInputStream(expected)) >= 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:9080/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

            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

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.