Examples of HttpMethodBase


Examples of org.apache.commons.httpclient.HttpMethodBase

    */
   public void testAltRequestInfoServlet()
      throws Exception
   {
      URL url = new URL(baseURL+"altdd-test/AltRequestInfoServlet");
      HttpMethodBase request = HttpUtils.accessURL(url);
      Header errors = request.getResponseHeader("X-Exception");
      log.info("X-Exception: "+errors);
      assertTrue("X-Exception("+errors+") is null", errors == null);     
   }
View Full Code Here

Examples of org.apache.commons.httpclient.HttpMethodBase

    */
   public void testAltRequestInfoServlet2()
      throws Exception
   {
      URL url = new URL(baseURL+"altdd-test/AltRequestInfoServlet2");
      HttpMethodBase request = HttpUtils.accessURL(url);
      Header errors = request.getResponseHeader("X-Exception");
      log.info("X-Exception: "+errors);
      assertTrue("X-Exception("+errors+") is null", errors == null);     
   }
View Full Code Here

Examples of org.apache.commons.httpclient.HttpMethodBase

    */
   public void testGetEntitlementsFromServlet() throws Exception
   {
      // call the ACLServlet using the identity "Administrator" as a parameter.
      URL url = new URL(HttpUtils.getBaseURL() + "acl-integration/acl?identity=Administrator");
      HttpMethodBase response = HttpUtils.accessURL(url, "JBoss ACL Test", HttpURLConnection.HTTP_OK);
      // each line of the response has the following format: resource_id:permissions
      List<String> entitlements = this.readEntitlementsFromResponse(response);
      assertEquals("ACLServlet retrieved an invalid number of entitlement entries", 2, entitlements.size());
      // Administrator should have CREATE,READ,UPDATE and DELETE permissions on both resources (id=1 and id=2).
      assertTrue("Invalid entitlement entry found", entitlements.contains("1:CREATE,READ,UPDATE,DELETE"));
View Full Code Here

Examples of org.apache.commons.httpclient.HttpMethodBase

    * classpath. Access the http://{host}/manifest/classpath.jsp
    */
   public void testWarManifest() throws Exception
   {
      URL url = new URL(baseURL+"manifest/classpath.jsp");
      HttpMethodBase request = HttpUtils.accessURL(url);
      Header errors = request.getResponseHeader("X-Exception");
      log.info("X-Exception: "+errors);
      assertTrue("X-Exception("+errors+") is null", errors == null);
   }
View Full Code Here

Examples of org.apache.commons.httpclient.HttpMethodBase

    */
   public void testClassesServlet()
      throws Exception
   {
      URL url = new URL(baseURL+"manifest/ClassesServlet?class=org.jboss.test.web.util2.ClassInUtil2");
      HttpMethodBase request = HttpUtils.accessURL(url);
      Header errors = request.getResponseHeader("X-Exception");
      log.info("X-Exception: "+errors);
      assertTrue("X-Exception("+errors+") is null", errors == null);     
   }
View Full Code Here

Examples of org.apache.commons.httpclient.HttpMethodBase

    */
   public void testLibServlet()
      throws Exception
   {
      URL url = new URL(baseURL+"manifest/LibServlet");
      HttpMethodBase request = HttpUtils.accessURL(url);
      Header errors = request.getResponseHeader("X-Exception");
      log.info("X-Exception: "+errors);
      assertTrue("X-Exception("+errors+") is null", errors == null);     
   }
View Full Code Here

Examples of org.apache.commons.httpclient.HttpMethodBase

      super(name);
   }

   protected String get(String spec) throws IOException
   {
      HttpMethodBase request = new GetMethod(HttpUtils.getBaseURL() + spec);
      client.executeMethod(request);

      String responseBody = request.getResponseBodyAsString();
      request.releaseConnection();
      return responseBody;
   }
View Full Code Here

Examples of org.apache.commons.httpclient.HttpMethodBase

  public void testCookieSetCorrectly() throws Exception
  {
    log.info("testCookieSetCorrectly");
    URL url = new URL(baseURL+"jbosstest-cookie/CookieReadServlet");
    HttpClient httpClient = new HttpClient();       
    HttpMethodBase request = HttpUtils.createMethod(url,HttpUtils.GET);
    //sending a blank request
    httpClient.executeMethod(request);
   
    log.info("sending request with cookie");   
    request = HttpUtils.createMethod(url,HttpUtils.POST);
View Full Code Here

Examples of org.apache.commons.httpclient.HttpMethodBase

 
  public void testCookieRetrievedCorrectly() throws Exception
  {
    URL url = new URL(baseURL+"jbosstest-cookie/CookieServlet");
    HttpClient httpClient = new HttpClient();       
    HttpMethodBase request = HttpUtils.createMethod(url,HttpUtils.GET);      
    int responseCode =httpClient.executeMethod(request);
    //assert that we are able to hit servlet successfully
    assertEquals(HttpURLConnection.HTTP_OK, responseCode);
    request.getResponseHeader("Set-Cookie");
   
    Cookie[] cookies = httpClient.getState().getCookies();       
    //verify that expired cookie is not set by server
    assertTrue("sever did not set expired cookie on client", checkNoExpiredCookie(cookies));
   
View Full Code Here

Examples of org.apache.commons.httpclient.HttpMethodBase

   private String getResponseBody(String warName) throws Exception
   {
      HttpClient client = new HttpClient();
      client.executeMethod(makeRequest(warName));
     
      HttpMethodBase result = makeRequest(warName);

      // need to hit it twice with the same session for test to pass
      client.executeMethod(result);

      String responseBody = result.getResponseBodyAsString();
      if (responseBody == null) {
         throw new Exception("Unable to get response from server.");
      }
     
      return responseBody;
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.