Package org.apache.commons.httpclient.methods

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


                DeleteMethod del = new DeleteMethod(TEST_SERVICES_SERVICE_URL_VALID+"/test_add2");
                del.setDoAuthentication(true);
                client.executeMethod(del);
                int code = del.getStatusCode();
                assertEquals(200,code);
                del.releaseConnection();
            }
            catch (Exception e) {
              e.printStackTrace();
              fail("put failed");
            }
View Full Code Here


            DeleteMethod del = new DeleteMethod(TEST_SERVICES_SERVICE_URL_VALID+"/test999");
            del.setDoAuthentication(true);
            client.executeMethod(del);
            int code = del.getStatusCode();
            assertEquals(404,code);
            del.releaseConnection();
        }
        catch (Exception e) {
          e.printStackTrace();
          fail("put failed");
        }
View Full Code Here

            + WIDGET_ID_VALID
            + "&userid=test&is_public=true&shareddatakey=propstest&propertyname=cat");
    client.executeMethod(delete);
    int code = delete.getStatusCode();
    assertEquals(200, code);
    delete.releaseConnection();
  }

  /**
   * Test removing a non-existing property.
   *
 
View Full Code Here

            + WIDGET_ID_VALID
            + "&userid=test&is_public=true&shareddatakey=propstest&propertyname=bogus");
    client.executeMethod(delete);
    int code = delete.getStatusCode();
    assertEquals(404, code);
    delete.releaseConnection();
  }

  /**
   * Try to set a property without specifying the property name
   *
 
View Full Code Here

    DeleteMethod del = new DeleteMethod(TEST_WARP_SERVICE_URL_VALID + "/" + id);
    del.setDoAuthentication(true);
    client.executeMethod(del);
    int code = del.getStatusCode();
    assertEquals(200, code);
    del.releaseConnection();

    //
    // GET to make sure it was deleted OK
    //
    Element[] policies = getPolicies();
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(401, code);
    post.releaseConnection();
  }

  /**
   * Try to delete a non-existing participant
   *
 
View Full Code Here

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

  /**
   * Try to delete a participant for a non-existing widget instance
   *
 
View Full Code Here

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

}
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

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.