Package jodd.http

Examples of jodd.http.HttpResponse.bodyText()


    response = HttpRequest.get("localhost:8173/alpha.home.html").send();
    assertEquals("hello", response.bodyText().trim());

    response = HttpRequest.get("localhost:8173/alpha.home2.html").send();
    assertEquals("Hello world", response.bodyText().trim());
  }

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


  public void testRedirectTo() {
    HttpResponse response;
    HttpBrowser browser = new HttpBrowser();

    response = browser.sendRequest(HttpRequest.get("localhost:8173/alpha.red1.html"));
    assertEquals("alpha.jsp", response.bodyText().trim());

    response = browser.sendRequest(HttpRequest.get("localhost:8173/alpha.red2.html"));
    assertEquals("hello", response.bodyText().trim());

    response = browser.sendRequest(HttpRequest.get("localhost:8173/alpha.world.html"));
View Full Code Here

    response = browser.sendRequest(HttpRequest.get("localhost:8173/alpha.red1.html"));
    assertEquals("alpha.jsp", response.bodyText().trim());

    response = browser.sendRequest(HttpRequest.get("localhost:8173/alpha.red2.html"));
    assertEquals("hello", response.bodyText().trim());

    response = browser.sendRequest(HttpRequest.get("localhost:8173/alpha.world.html"));
    assertEquals("Hello world planet Mars and Universe 173", response.bodyText().trim());

    response = browser.sendRequest(HttpRequest.get("localhost:8173/alpha.postme.html"));
View Full Code Here

    response = browser.sendRequest(HttpRequest.get("localhost:8173/alpha.red2.html"));
    assertEquals("hello", response.bodyText().trim());

    response = browser.sendRequest(HttpRequest.get("localhost:8173/alpha.world.html"));
    assertEquals("Hello world planet Mars and Universe 173", response.bodyText().trim());

    response = browser.sendRequest(HttpRequest.get("localhost:8173/alpha.postme.html"));
    assertEquals("alpha.hello.jsp", response.bodyText().trim());
  }
View Full Code Here

    response = browser.sendRequest(HttpRequest.get("localhost:8173/alpha.world.html"));
    assertEquals("Hello world planet Mars and Universe 173", response.bodyText().trim());

    response = browser.sendRequest(HttpRequest.get("localhost:8173/alpha.postme.html"));
    assertEquals("alpha.hello.jsp", response.bodyText().trim());
  }

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

  @Test
  public void testText() {
    HttpResponse response;

    response = HttpRequest.get("localhost:8173/alpha.txt.html").send();
    assertEquals("some text", response.bodyText().trim());
  }

  @Test
  public void testChain() {
    HttpResponse response = HttpRequest.get("localhost:8173/hello.chain.html?chain=7").send();
View Full Code Here

  }

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

  @Test
  public void testNoResult() {
    HttpResponse response = HttpRequest.get("localhost:8173/alpha.noresult.html").send();
View Full Code Here

  }

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

}
View Full Code Here

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

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

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

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

    assertEquals("NewBook: 123:Songs of Distant Earth.", response.bodyText().trim());
  }

  @Test
  public void testBookPut() {
    HttpResponse response;
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.