Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.Header


      String response = formPost.getStatusText();
      getLog().debug("responseCode="+responseCode+", response="+response);
      assertTrue("Saw HTTP_MOVED_TEMP", responseCode == HttpURLConnection.HTTP_MOVED_TEMP);

      //  Follow the redirect to the SecureServlet
      Header location = formPost.getResponseHeader("Location");
      String indexURI = location.getValue();
      GetMethod war1Index = new GetMethod(indexURI);
      responseCode = httpConn.executeMethod(war1Index.getHostConfiguration(),
         war1Index, state);
      assertTrue("Get OK", responseCode == HttpURLConnection.HTTP_OK);
      body = war1Index.getResponseBodyAsString();
View Full Code Here


      String response = formPost.getStatusText();
      log.debug("responseCode="+responseCode+", response="+response);
      assertTrue("Saw HTTP_MOVED_TEMP", responseCode == HttpURLConnection.HTTP_MOVED_TEMP);

      //  Follow the redirect to the SecureServlet
      Header location = formPost.getResponseHeader("Location");
      String indexURI = location.getValue();
      GetMethod war1Index = new GetMethod(indexURI);
      responseCode = httpConn.executeMethod(war1Index.getHostConfiguration(),
         war1Index, state);
      response = war1Index.getStatusText();
      log.debug("responseCode="+responseCode+", response="+response);
View Full Code Here

      byte[] responseBody = method.getResponseBody();
      /* Validate that the attribute was actually seen. An absence of the
         header is treated as true since there are pages used that done't
         add it.
      */
      Header hdr = method.getResponseHeader("X-SawTestHttpAttribute");
      Boolean sawAttr = hdr != null ? Boolean.valueOf(hdr.getValue()) : Boolean.TRUE;
      String attr = null;
      if( sawAttr.booleanValue() )
         attr = new String(responseBody);
      // Release the connection.
//      method.releaseConnection();
View Full Code Here

      String response = formPost.getStatusText();
      log.debug("responseCode="+responseCode+", response="+response);
      assertTrue("Saw HTTP_MOVED_TEMP", responseCode == HttpURLConnection.HTTP_MOVED_TEMP);

      //  Follow the redirect to the SecureServlet
      Header location = formPost.getResponseHeader("Location");
      String indexURI = location.getValue();
      GetMethod war1Index = new GetMethod(indexURI);
      responseCode = httpConn.executeMethod(war1Index);
      response = war1Index.getStatusText();
      log.debug("responseCode="+responseCode+", response="+response);
      assertTrue("Get OK", responseCode == HttpURLConnection.HTTP_OK);
View Full Code Here

      String response = formPost.getStatusText();
      log.debug("responseCode="+responseCode+", response="+response);
      assertTrue("Saw HTTP_MOVED_TEMP", responseCode == HttpURLConnection.HTTP_MOVED_TEMP);

      //  Follow the redirect to the index.jsp
      Header location = formPost.getResponseHeader("Location");
      String indexURI = location.getValue();
      GetMethod war1Index = new GetMethod(indexURI);
      responseCode = httpConn.executeMethod(war1Index.getHostConfiguration(),
            war1Index, state);
      response = war1Index.getStatusText();
      log.debug("responseCode="+responseCode+", response="+response);
View Full Code Here

    */
   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

   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

   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

         e.printStackTrace();
         fail("HttpClient executeMethod fails." +e.toString());
      }
      assertEquals("Get OK with url: " + url, HttpURLConnection.HTTP_OK, responseCode);
     
      Header header = method.getResponseHeader("X-SessionDeserialized");
      assertNotNull("Test existence of X-SessionDeserialized response header", header);
      Boolean headerValue = Boolean.valueOf(header.getValue());
      assertEquals("Validate X-SessionDeserialized header: " + header.getValue(), expectDeserialized, headerValue.booleanValue());
     
      // Read the response body.
      byte[] responseBody = method.getResponseBody();

      // Release the connection.
View Full Code Here

         fail("HttpClient executeMethod fails." +e.toString());
      }
      assertTrue("Get OK with url: " +url + " responseCode: " +responseCode
        , responseCode == HttpURLConnection.HTTP_OK);

      Header hdr = method.getResponseHeader("X-SessionIsNew");
      assertNotNull("Got X-SessionIsNew header", hdr);
      String value = hdr.getValue();
      assertNotNull("Got non-nullX-SessionIsNew header", value);
     
      return Boolean.valueOf(value).booleanValue();
   }
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.Header

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.