Package jodd.http

Examples of jodd.http.HttpResponse


    MadvocSuite.stopTomcat();
  }

  @Test
  public void testRestAction1() {
    HttpResponse response = HttpRequest.get("localhost:8173/re/view/123").send();
    assertEquals("123", response.bodyText().trim());
  }
View Full Code Here


    JoySuite.stopTomcat();
  }

  @Test
  public void testSimpleJspp() {
    HttpResponse response = HttpRequest.get("http://localhost:8173/hello.html").send();

    assertEquals("Hello world Jupiter! zap!", response.bodyText());

    // send it again

    response = HttpRequest.get("http://localhost:8173/hello.html").send();

    assertEquals("Hello world Jupiter! zap!", response.bodyText());
  }
View Full Code Here

  private static final String TEXT_RESULT = "<input name=\"iname\" type=\"text\" value=\"foo\">";

  @Test
  public void testFormTagTextGet() {
    HttpResponse response = HttpRequest
        .get("localhost:8173/text.jsp")
        .query("iname", "foo")
        .send();

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

    assertEquals(TEXT_RESULT, response.bodyText().trim());
  }

  @Test
  public void testFormTagTextGetWithValue() {
    HttpResponse response = HttpRequest
        .get("localhost:8173/text2.jsp")
        .query("iname", "foo")
        .send();

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

    assertEquals(TEXT_RESULT, response.bodyText().trim());
  }

  @Test
  public void testFormTagTextPost() {
    HttpResponse response = HttpRequest
        .post("localhost:8173/text.jsp")
        .form("iname", "foo")
        .send();

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

    assertEquals(TEXT_RESULT, response.bodyText().trim());
  }

  @Test
  public void testFormTagTextPostMulti() {
    HttpResponse response = HttpRequest
        .post("localhost:8173/text.jsp")
        .form("iname", "foo")
        .multipart(true)
        .send();

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

    MadvocSuite.stopTomcat();
  }

  @Test
  public void testIn1Action() {
    HttpResponse response = HttpRequest.get("localhost:8173/cpt.in1.html?foo=173").send();
    assertEquals("param:  = 173", response.bodyText().trim());
  }
View Full Code Here

    assertEquals("param:  = 173", response.bodyText().trim());
  }

  @Test
  public void testIn2Action() {
    HttpResponse response = HttpRequest.get("localhost:8173/cpt.in2.html?foo=173&foo2=173").send();
    assertEquals("param: 173 = 173", response.bodyText().trim());
  }
View Full Code Here

    assertEquals("param: 173 = 173", response.bodyText().trim());
  }

  @Test
  public void testAppendingAction() {
    HttpResponse response = HttpRequest.get("localhost:8173/cpt.inap.html").send();
    assertEquals("value=appending<jodd>", response.bodyText().trim());
  }
View Full Code Here

    assertEquals("value=appending<jodd>", response.bodyText().trim());
  }

  @Test
  public void testAppending2Action() {
    HttpResponse response = HttpRequest.get("localhost:8173/cpt.inap2.html").send();
    assertEquals("value=appending2<heyp>", 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.