Package org.apache.commons.httpclient.methods

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


            assertEquals(stripXmlInstructionIfNeeded(getStringFromInputStream(expected)),
                         stripXmlInstructionIfNeeded(getStringFromInputStream(put.getResponseBodyAsStream())));
        } finally {
            // Release current connection to the connection pool once you are
            // done
            put.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

            firePutCompleted( resource, source );
        }
        finally
        {
            putMethod.releaseConnection();
        }
    }

    protected void mkdirs( String dirname )
        throws IOException
View Full Code Here

            statusDetails = e.toString();
        } catch (RuntimeException re) {
            logger.warn("ping: got RuntimeException: " + re, re);
            statusDetails = re.toString();
        } finally {
            method.releaseConnection();
            lastInheritedAnnouncement = resultingAnnouncement;
            lastPingedAt = System.currentTimeMillis();
        }
    }
View Full Code Here

            }
        } catch (Exception ex) {
            throw new MojoExecutionException("Installation on " + targetURL
                + " failed, cause: " + ex.getMessage(), ex);
        } finally {
            filePut.releaseConnection();
        }
    }

    /**
     * Add configurations to a running OSGi instance for initial content.
View Full Code Here

            firePutCompleted( resource, source );
        }
        finally
        {
            putMethod.releaseConnection();
        }
    }

    protected String calculateRelocatedUrl( EntityEnclosingMethod method )
    {
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:" + 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 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

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.