Package jodd.http

Examples of jodd.http.HttpBrowser


    MadvocSuite.stopTomcat();
  }

  @Test
  public void testException() {
    HttpBrowser httpBrowser = new HttpBrowser();
    HttpResponse response = httpBrowser.sendRequest(HttpRequest.get("localhost:8173/exc.html"));

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


    assertEquals("500!", response.bodyText().trim());
  }

  @Test
  public void testRedirect500() {
    HttpBrowser httpBrowser = new HttpBrowser();
    HttpResponse response = httpBrowser.sendRequest(HttpRequest.get("localhost:8173/exc.red.html"));

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

  }

  @Test
  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"));
    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

    MadvocSuite.stopTomcat();
  }

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

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

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

  @Test
  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

TOP

Related Classes of jodd.http.HttpBrowser

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.