Examples of HttpState


Examples of org.apache.commons.httpclient.HttpState

      int responseCode = httpConn.executeMethod(indexGet);
      String body = indexGet.getResponseBodyAsString();
      assertTrue("Get OK("+responseCode+")", responseCode == HttpURLConnection.HTTP_OK);
      assertTrue("Redirected to login page", body.indexOf("j_security_check") > 0 );

      HttpState state = httpConn.getState();
      Cookie[] cookies = state.getCookies();
      String sessionID = null;
      for(int c = 0; c < cookies.length; c ++)
      {
         Cookie k = cookies[c];
         if( k.getName().equalsIgnoreCase("JSESSIONID") )
View Full Code Here

Examples of org.apache.commons.httpclient.HttpState

         fail("get of "+indexURI+" redirected to login page");
      return formPost;
   }
   public void doSecureGet(String path) throws Exception
   {
      HttpState state = httpConn.getState();
      Cookie[] cookies = state.getCookies();
      String sessionID = null;
      for(int c = 0; c < cookies.length; c ++)
      {
         Cookie k = cookies[c];
         if( k.getName().equalsIgnoreCase("JSESSIONID") )
View Full Code Here

Examples of org.apache.commons.httpclient.HttpState

      getLog().debug("makeGetWithState(): trying to get from url " +url);
      GetMethod method = new GetMethod(url);
      int responseCode = 0;
      try
      {
         HttpState state = client.getState();
         responseCode = client.executeMethod(method.getHostConfiguration(),
            method, state);
      } catch (IOException e)
      {
         e.printStackTrace();
View Full Code Here

Examples of org.apache.commons.httpclient.HttpState

      int responseCode = httpConn.executeMethod(indexGet);
      String body = indexGet.getResponseBodyAsString();
      assertTrue("Get OK("+responseCode+")", responseCode == HttpURLConnection.HTTP_OK);
      assertTrue("Redirected to login page", body.indexOf("j_security_check") > 0 );

      HttpState state = httpConn.getState();
      Cookie[] cookies = state.getCookies();
      String sessionID = null;
      for(int c = 0; c < cookies.length; c ++)
      {
         Cookie k = cookies[c];
         if( k.getName().equalsIgnoreCase("JSESSIONID") )
View Full Code Here

Examples of org.apache.commons.httpclient.HttpState

      int responseCode = httpConn.executeMethod(indexGet);
      String body = indexGet.getResponseBodyAsString();
      assertTrue("Get OK("+responseCode+")", responseCode == HttpURLConnection.HTTP_OK);
      assertTrue("Redirected to login page", body.indexOf("j_security_check") > 0 );

      HttpState state = httpConn.getState();
      Cookie[] cookies = state.getCookies();
      String sessionID = null;
      for(int c = 0; c < cookies.length; c ++)
      {
         Cookie k = cookies[c];
         if( k.getName().equalsIgnoreCase("JSESSIONID") )
View Full Code Here

Examples of org.apache.commons.httpclient.HttpState

      GetMethod indexGet = new GetMethod(baseURLNoAuth + "custom-principal/");
      int responseCode = httpConn.executeMethod(indexGet);
      String body = indexGet.getResponseBodyAsString();
      assertTrue("Get OK(" + responseCode + ")", responseCode == HttpURLConnection.HTTP_OK);
      assertTrue("Redirected to login page", body.indexOf("j_security_check") > 0);
      HttpState state = httpConn.getState();
      Cookie[] cookies = state.getCookies();
      String sessionID = null;
      for (int c = 0; c < cookies.length; c++)
      {
         Cookie k = cookies[c];
         if (k.getName().equalsIgnoreCase("JSESSIONID"))
View Full Code Here

Examples of org.apache.commons.httpclient.HttpState

     
      // Start by accessing the secured index.html of war1
      HttpClient httpConn = new HttpClient();
      SSOBaseCase.checkAccessDenied(httpConn,  warA1 + "index.html");

      HttpState state = httpConn.getState();
     
      log.debug("Saw JSESSIONID="+SSOBaseCase.getSessionIdValueFromState(state));
     
      // Submit the login form
      SSOBaseCase.executeFormLogin(httpConn, warA1);
View Full Code Here

Examples of org.apache.commons.httpclient.HttpState

      // First create an SSO that we won't use again -- we later test that it
      // gets cleaned up from the cache
      HttpClient httpConn1 = new HttpClient();
      SSOBaseCase.checkAccessDenied(httpConn1, warA3 + "index.jsp");
      SSOBaseCase.executeFormLogin(httpConn1, warA3);
      HttpState state = httpConn1.getState();     
      String sessionID1 = SSOBaseCase.getSessionIdValueFromState(state);
     
      // Now the standard SSO tests
      HttpClient httpConn = new HttpClient();
      SSOBaseCase.checkAccessDenied(httpConn, warA3 + "index.jsp");
View Full Code Here

Examples of org.apache.commons.httpclient.HttpState

   }
  
   public static Cookie getSessionCookie(HttpClient client)
   {
      // Get the state for the JSESSIONID
      HttpState state = client.getState();
      // Get the JSESSIONID so we can reset the host
      Cookie[] cookies = state.getCookies();
      Cookie sessionID = null;
      for(int c = 0; c < cookies.length; c ++)
      {
         Cookie k = cookies[c];
         if(k.getName().equalsIgnoreCase("JSESSIONID"))
View Full Code Here

Examples of org.apache.commons.httpclient.HttpState

     
      String body = makeGet(client, baseURL0_ + protectedUrl_);
      if( body.indexOf("j_security_check") < 0 )
         fail("get of "+protectedUrl_+" not redirected to login page");
     
      HttpState state = client.getState();
      Cookie[] cookies = state.getCookies();
      String sessionID = null;
      for(int c = 0; c < cookies.length; c ++)
      {
         Cookie k = cookies[c];
         if( k.getName().equalsIgnoreCase("JSESSIONID") )
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.