Package jodd.http

Examples of jodd.http.HttpResponse.bodyText()


  }

  @Test
  public void testUserWithRoute() {
    HttpResponse response = HttpRequest.get("localhost:8173/sys/user/456").send();
    assertEquals("Huh 456.", response.bodyText().trim());
  }

  @Test
  public void testBook() {
    HttpResponse response;
View Full Code Here


  @Test
  public void testBook() {
    HttpResponse response;
    response = HttpRequest.get("localhost:8173/book/123").send();

    assertEquals("MyBook: 123:Songs of Distant Earth.", response.bodyText().trim());
  }
}
View Full Code Here

  }

  @Test
  public void testHelloAction() {
    HttpResponse response = HttpRequest.get("localhost:8173/hello.html").send();
    assertEquals("hello", response.bodyText().trim());
  }

}
View Full Code Here

  public void testUserActionGet() {
    HttpBrowser httpBrowser = new HttpBrowser();
    HttpResponse response = httpBrowser.sendRequest(
        HttpRequest.get("localhost:8173/sys/user/123"));

    assertEquals("Huh 123.", response.bodyText().trim());
  }

  @Test
  public void testUserActionPost() {
    HttpBrowser httpBrowser = new HttpBrowser();
View Full Code Here

  public void testUserActionPost() {
    HttpBrowser httpBrowser = new HttpBrowser();
    HttpResponse response = httpBrowser.sendRequest(
        HttpRequest.post("localhost:8173/sys/user/123"));

    assertEquals("Post 123.", response.bodyText().trim());
  }

}
View Full Code Here

  }

  @Test
  public void testSessionScope() {
    HttpResponse response = HttpRequest.get("localhost:8173/item.html").send();
    String out1 = response.bodyText().trim();

    response = HttpRequest.get("localhost:8173/item.html").send();
    String out2 = response.bodyText().trim();

    assertFalse(out1.equals(out2));
View Full Code Here

  public void testSessionScope() {
    HttpResponse response = HttpRequest.get("localhost:8173/item.html").send();
    String out1 = response.bodyText().trim();

    response = HttpRequest.get("localhost:8173/item.html").send();
    String out2 = response.bodyText().trim();

    assertFalse(out1.equals(out2));

    String jsessionid = out2.substring(out2.indexOf("sid:") + 4);
View Full Code Here

    assertFalse(out1.equals(out2));

    String jsessionid = out2.substring(out2.indexOf("sid:") + 4);

    response = HttpRequest.get("localhost:8173/item.html;jsessionid=" + jsessionid).send();
    String out3 = response.bodyText().trim();

    assertEquals(out2, out3);
  }

  @Test
View Full Code Here

  }

  @Test
  public void testSessionScopeWithScopedProxy() {
    HttpResponse response = HttpRequest.get("localhost:8173/item.global.html").send();
    String out1 = response.bodyText().trim();

    response = HttpRequest.get("localhost:8173/item.global.html").send();
    String out2 = response.bodyText().trim();

    assertFalse(out1.equals(out2));
View Full Code Here

  public void testSessionScopeWithScopedProxy() {
    HttpResponse response = HttpRequest.get("localhost:8173/item.global.html").send();
    String out1 = response.bodyText().trim();

    response = HttpRequest.get("localhost:8173/item.global.html").send();
    String out2 = response.bodyText().trim();

    assertFalse(out1.equals(out2));

    String jsessionid = out2.substring(out2.indexOf("sid:") + 4);
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.