Package jodd.http

Examples of jodd.http.HttpResponse


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

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

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


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

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

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

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

  @Test
  public void testBookPartial() {
    HttpResponse response = HttpRequest.put("localhost:8173/bookPartial.hello.html")
        .query("book.iban", "123123123")
        .query("book.foo", "not used")
        .send();

    assertEquals("Hi123123123", response.bodyText().trim());
  }
View Full Code Here

    MadvocSuite.stopTomcat();
  }

  @Test
  public void testRawAction() {
    HttpResponse response = HttpRequest.get("localhost:8173/raw.html").send();
    assertEquals("this is some raw direct result", response.bodyText().trim());
  }
View Full Code Here

    assertEquals("this is some raw direct result", response.bodyText().trim());
  }

  @Test
  public void testRawTextAction() {
    HttpResponse response = HttpRequest.get("localhost:8173/raw.text.html").send();
    assertEquals("some raw txt", response.bodyText().trim());
  }
View Full Code Here

    assertEquals("some raw txt", response.bodyText().trim());
  }

  @Test
  public void testRawDownloadAction() {
    HttpResponse response = HttpRequest.get("localhost:8173/raw.download").send();
    assertEquals("attachment;filename=\"jodd-download.txt\"", response.header("content-disposition"));
    assertEquals("file from jodd.org!", response.bodyText().trim());
  }
View Full Code Here

    MadvocSuite.stopTomcat();
  }

  @Test
  public void testDisableTag() {
    HttpResponse response = HttpRequest
        .get("localhost:8173/tag/disable/123")
        .send();
    assertEquals("disable-Tag{123:jodd}", response.bodyText().trim());
  }
View Full Code Here

    assertEquals("disable-Tag{123:jodd}", response.bodyText().trim());
  }

  @Test
  public void testDeleteTag() {
    HttpResponse response = HttpRequest
        .get("localhost:8173/tag/delete/123")
        .send();
    assertEquals("delete-Tag{123:jodd}", response.bodyText().trim());
  }
View Full Code Here

    assertEquals("delete-Tag{123:jodd}", response.bodyText().trim());
  }

  @Test
  public void testEditTag() {
    HttpResponse response = HttpRequest
        .get("localhost:8173/tag/edit/123")
        .query("tag.name", "ddoj")
        .send();
    assertEquals("edit-Tag{123:ddoj}", response.bodyText().trim());
  }
View Full Code Here

    assertEquals("edit-Tag{123:ddoj}", response.bodyText().trim());
  }

  @Test
  public void testSaveTag() {
    HttpResponse response = HttpRequest
        .get("localhost:8173/tag/save/123")
        .query("tag.name", "JODD")
        .send();
    assertEquals("save-Tag{123:JODD}", response.bodyText().trim());
  }
View Full Code Here

TOP

Related Classes of jodd.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.