Package com.scooterframework.common.http

Examples of com.scooterframework.common.http.HTTPResponse


   * Test <tt>index()</tt> method.
   */
  @Test
  public void test_index() {
    String uri = "/entries";
    HTTPResponse response = fireHttpGetRequest(uri);
    assertSuccess(response);
  }
View Full Code Here


   * Test <tt>crud()</tt> method.
   */
  @Test
  public void test_crud() {
    try {
      HTTPResponse response = null;

      String id = "100";
      Map data = new HashMap();
      data.put("id", id);

      String addURI = "/entries/add";
      response = fireHttpGetRequest(addURI);
      assertSuccess(response);
      log.debug("add response: " + response.getContentAsString());

      String createURI = "/entries";
      response = fireHttpPostRequest(createURI, data);
      assertRedirectSuccess(response);
      log.debug("create response: " + response.getContentAsString());
   
      String showURI = "/entries/" +id;
      response = fireHttpGetRequest(showURI);
      assertSuccess(response);
      log.debug("show response: " + response.getContentAsString());

      String editURI = "/entries/" +id + "/edit";
      response = fireHttpGetRequest(editURI);
      assertSuccess(response);
      log.debug("edit response: " + response.getContentAsString());

      String updateURI = "/entries/" +id;
      response = fireHttpPutRequest(updateURI, data);
      assertRedirectSuccess(response);
      log.debug("update response: " + response.getContentAsString());

      String deleteURI = "/entries/" +id;
      response = fireHttpDeleteRequest(deleteURI);
      assertRedirectSuccess(response);
      log.debug("delete response: " + response.getContentAsString());

    } catch(Exception ex) {
      ex.printStackTrace();
    }
  }
View Full Code Here

   * Test <tt>index()</tt> method.
   */
  @Test
  public void test_index() {
    String uri = "/entries";
    HTTPResponse response = fireHttpGetRequest(uri);
    assertSuccess(response);
  }
View Full Code Here

   * Test <tt>crud()</tt> method.
   */
  @Test
  public void test_crud() {
    try {
      HTTPResponse response = null;

      String id = "100";
      Map data = new HashMap();
      data.put("id", id);

      String addURI = "/entries/add";
      response = fireHttpGetRequest(addURI);
      assertSuccess(response);
      log.debug("add response: " + response.getContentAsString());

      String createURI = "/entries";
      response = fireHttpPostRequest(createURI, data);
      assertRedirectSuccess(response);
      log.debug("create response: " + response.getContentAsString());
   
      String showURI = "/entries/" +id;
      response = fireHttpGetRequest(showURI);
      assertSuccess(response);
      log.debug("show response: " + response.getContentAsString());

      String editURI = "/entries/" +id + "/edit";
      response = fireHttpGetRequest(editURI);
      assertSuccess(response);
      log.debug("edit response: " + response.getContentAsString());

      String updateURI = "/entries/" +id;
      response = fireHttpPutRequest(updateURI, data);
      assertRedirectSuccess(response);
      log.debug("update response: " + response.getContentAsString());

      String deleteURI = "/entries/" +id;
      response = fireHttpDeleteRequest(deleteURI);
      assertRedirectSuccess(response);
      log.debug("delete response: " + response.getContentAsString());

    } catch(Exception ex) {
      ex.printStackTrace();
    }
  }
View Full Code Here

   * Test followings_tweets() method
   */
  @Test
  public void test_followings_tweets() {
    String uri = "/tweets/followings_tweets";
    HTTPResponse response = fireHttpGetRequest(uri);
    assertSuccess(response);
  }
View Full Code Here

   * Test <tt>index()</tt> method.
   */
  @Test
  public void test_index() {
    String uri = "/vets";
    HTTPResponse response = fireHttpGetRequest(uri);
    assertSuccess(response);
  }
View Full Code Here

   * Test <tt>crud()</tt> method.
   */
  @Test
  public void test_crud() {
    try {
      HTTPResponse response = null;

      String id = "100";
      Map data = new HashMap();
      data.put("id", id);

      String addURI = "/vets/add";
      response = fireHttpGetRequest(addURI);
      assertSuccess(response);
      log.debug("add response: " + response.getContentAsString());

      String createURI = "/vets";
      response = fireHttpPostRequest(createURI, data);
      assertRedirectSuccess(response);
      log.debug("create response: " + response.getContentAsString());
   
      String showURI = "/vets/" +id;
      response = fireHttpGetRequest(showURI);
      assertSuccess(response);
      log.debug("show response: " + response.getContentAsString());

      String editURI = "/vets/" +id + "/edit";
      response = fireHttpGetRequest(editURI);
      assertSuccess(response);
      log.debug("edit response: " + response.getContentAsString());

      String updateURI = "/vets/" +id;
      response = fireHttpPutRequest(updateURI, data);
      assertRedirectSuccess(response);
      log.debug("update response: " + response.getContentAsString());

      String deleteURI = "/vets/" +id;
      response = fireHttpDeleteRequest(deleteURI);
      assertRedirectSuccess(response);
      log.debug("delete response: " + response.getContentAsString());

    } catch(Exception ex) {
      ex.printStackTrace();
    }
  }
View Full Code Here

   * Test sayit() method
   */
  @Test
  public void test_sayit() {
    String uri = "/welcome/sayit";
    HTTPResponse response = fireHttpGetRequest(uri);
    assertSuccess(response);
  }
View Full Code Here

   * Test index() method
   */
  @Test
  public void test_index() {
    String uri = "/files/index";
    HTTPResponse response = fireHttpGetRequest(uri);
    assertSuccess(response);
  }
View Full Code Here

   * Test upload() method
   */
  @Test
  public void test_upload() {
    String uri = "/files/upload";
    HTTPResponse response = fireHttpGetRequest(uri);
    assertSuccess(response);
  }
View Full Code Here

TOP

Related Classes of com.scooterframework.common.http.HTTPResponse

Copyright © 2018 www.massapicom. 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.