Examples of DeleteMethod


Examples of org.apache.commons.httpclient.methods.DeleteMethod

    @Test
    public void testDeleteBook() throws Exception {
        String endpointAddress =
            "http://localhost:9080/bookstore/books/123";

        DeleteMethod post = new DeleteMethod(endpointAddress);
        HttpClient httpclient = new HttpClient();
       
        try {
            int result = httpclient.executeMethod(post);
            assertEquals(200, result);
        } finally {
            // Release current connection to the connection pool once you are done
            post.releaseConnection();
       
    }
View Full Code Here

Examples of org.apache.commons.httpclient.methods.DeleteMethod

    @Test
    public void testDeleteBookByQuery() throws Exception {
        String endpointAddress =
            "http://localhost:9080/bookstore/books/id?value=123";

        DeleteMethod post = new DeleteMethod(endpointAddress);
        HttpClient httpclient = new HttpClient();
       
        try {
            int result = httpclient.executeMethod(post);
            assertEquals(200, result);
        } finally {
            // Release current connection to the connection pool once you are done
            post.releaseConnection();
       
    }
View Full Code Here

Examples of org.apache.commons.httpclient.methods.DeleteMethod

    @Test
    public void testDeleteBook() throws Exception {
        String endpointAddress =
            "http://localhost:" + PORT + "/bookstore/books/123";

        DeleteMethod post = new DeleteMethod(endpointAddress);
        HttpClient httpclient = new HttpClient();
       
        try {
            int result = httpclient.executeMethod(post);
            assertEquals(200, result);
        } finally {
            // Release current connection to the connection pool once you are done
            post.releaseConnection();
       
    }
View Full Code Here

Examples of org.apache.commons.httpclient.methods.DeleteMethod

    @Test
    public void testDeleteBookByQuery() throws Exception {
        String endpointAddress =
            "http://localhost:" + PORT + "/bookstore/books/id?value=123";

        DeleteMethod post = new DeleteMethod(endpointAddress);
        HttpClient httpclient = new HttpClient();
       
        try {
            int result = httpclient.executeMethod(post);
            assertEquals(200, result);
        } finally {
            // Release current connection to the connection pool once you are done
            post.releaseConnection();
       
    }
View Full Code Here

Examples of org.apache.commons.httpclient.methods.DeleteMethod

     * @param uri URI to delete
     * @return {@link DeleteMethod} instance.
     */
    private DeleteMethod createDeleteMethod( final String uri )
    {
        return new DeleteMethod( uri );
    }
View Full Code Here

Examples of org.apache.commons.httpclient.methods.DeleteMethod

    /** Delete a file from the Sling repository
     *  @return the HTTP status code
     */
    public int delete(String url) throws IOException {
        final DeleteMethod delete = new DeleteMethod(url);
        return httpClient.executeMethod(delete);
    }
View Full Code Here

Examples of org.apache.commons.httpclient.methods.DeleteMethod

    @Test
    public void testDeleteBook() throws Exception {
        String endpointAddress =
            "http://localhost:" + PORT + "/bookstore/books/123";

        DeleteMethod post = new DeleteMethod(endpointAddress);
        HttpClient httpclient = new HttpClient();
       
        try {
            int result = httpclient.executeMethod(post);
            assertEquals(200, result);
        } finally {
            // Release current connection to the connection pool once you are done
            post.releaseConnection();
       
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.client.methods.DeleteMethod

    /**
     * @see RepositoryService#removeVersion(SessionInfo, NodeId, NodeId)
     */
    public void removeVersion(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId) throws RepositoryException {
        String uri = getItemUri(versionId, sessionInfo);
        DeleteMethod method = new DeleteMethod(uri);
        execute(method, sessionInfo);
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.client.methods.DeleteMethod

            put.setRequestHeader("If", condition);
            status = this.client.executeMethod(put);
            assertEquals("status: " + status, 412, status);
        }
        finally {
            DeleteMethod delete = new DeleteMethod(testuri);
            status = this.client.executeMethod(delete);
            assertTrue("status: " + status, status == 200 || status == 204 || status == 404);
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.client.methods.DeleteMethod

          put.setRequestHeader("If", "</foobar>" + "(<" + locktoken + ">)");
          status = this.client.executeMethod(put);
          assertTrue("status: " + status, status == 404 || status == 412);
      }
      finally {
          DeleteMethod delete = new DeleteMethod(testuri);
          if (locktoken != null) {
              delete.setRequestHeader("If", "(<" + locktoken + ">)");
          }
          status = this.client.executeMethod(delete);
          assertTrue("status: " + status, status == 200 || status == 204 || status == 404);
      }
  }
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.