Package org.apache.commons.httpclient.methods

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


    client.executeMethod(delete);
    delete.releaseConnection();           
   
    delete = new DeleteMethod(TEST_WIDGETS_SERVICE_URL_VALID + "/" + WIDGET_ID_LOCALIZED);
    client.executeMethod(delete);
    delete.releaseConnection();
  }
 
  /**
   * Test we can get an instance localized using the locale parameter
   *
 
View Full Code Here


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

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

   */
  public Response delete(Cluster cluster, String path) throws IOException {
    DeleteMethod method = new DeleteMethod();
    int code = execute(cluster, method, null, path);
    Header[] headers = method.getResponseHeaders();
    method.releaseConnection();
    return new Response(code, headers);
  }
}
View Full Code Here

               
        executeMethod(dm);
       
        if (dm.getStatusCode() != HttpStatus.SC_NO_CONTENT) {
            String errorMessage = responseToErrorMessage(dm);
            dm.releaseConnection();
            s_logger.error("Failed to delete object : " + errorMessage);
            throw new NiciraNvpApiException("Failed to delete object : " + errorMessage);
        }
        dm.releaseConnection();
    }
View Full Code Here

            String errorMessage = responseToErrorMessage(dm);
            dm.releaseConnection();
            s_logger.error("Failed to delete object : " + errorMessage);
            throw new NiciraNvpApiException("Failed to delete object : " + errorMessage);
        }
        dm.releaseConnection();
    }
   
    protected <T> T executeRetrieveObject(Type returnObjectType, String uri, Map<String,String> parameters) throws NiciraNvpApiException {
        if (_host == null || _host.isEmpty() ||
            _adminuser == null || _adminuser.isEmpty() ||
View Full Code Here

        executeMethod(dm);

        if (dm.getStatusCode() != HttpStatus.SC_OK) {
            String errorMessage = responseToErrorMessage(dm);
            dm.releaseConnection();
            s_logger.error("Failed to delete object : " + errorMessage);
            throw new BigSwitchVnsApiException("Failed to delete object : " + errorMessage);
        }
        dm.releaseConnection();
    }
View Full Code Here

            String errorMessage = responseToErrorMessage(dm);
            dm.releaseConnection();
            s_logger.error("Failed to delete object : " + errorMessage);
            throw new BigSwitchVnsApiException("Failed to delete object : " + errorMessage);
        }
        dm.releaseConnection();
    }

    @SuppressWarnings("unchecked")
    protected <T> T executeRetrieveObject(Type returnObjectType, String uri, int port, Map<String,String> parameters)
                    throws BigSwitchVnsApiException {
View Full Code Here

        + WIDGET_ID_VALID
        + "&userid=test&shareddatakey=participantstest&participant_id=1");
    client.executeMethod(post);
    int code = post.getStatusCode();
    assertEquals(200, code);
    post.releaseConnection();

    //
    // Now lets GET it to make sure it was deleted
    //
View Full Code Here

    post.setQueryString("api_key=" + API_KEY_INVALID + "&widgetid="
        + WIDGET_ID_VALID + "&userid=test&shareddatakey=participantstest");
    client.executeMethod(post);
    int code = post.getStatusCode();
    assertEquals(403, code);
    post.releaseConnection();
  }

  /**
   * Try to delete a non-existing participant
   *
 
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.