Package org.jboss.unit.remote.driver.handler.http.response

Examples of org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse


         // Use mary credentials for next request
         Map<String, String[]> params = new HashMap<String, String[]>();
         params.put("username", new String[]{"mary"});
         params.put("password", new String[]{"maryPassword"});
         String url = resp.renderURL("/", params, null);
         return new InvokeGetResponse(url);
      }
      else if (getRequestCount() == 1)
      {
         // Test that we still have credentials of john
         testCredentials(wciLoginController.getCredentials(req), "john", "johnPassword");
View Full Code Here


   @Override
   public DriverResponse invoke(TestServlet testServlet, DriverCommand driverCommand)
   {
      if (getRequestCount() == -1)
      {
         return new InvokeGetResponse(rewriteURL(testServlet, "/?username=root&password=gtn"));
      }
      else
      {
         return new FailureResponse(Failure.createAssertionFailure(""));
      }
View Full Code Here

         StringBuffer tmp = new StringBuffer(rewriteURL(testServlet, "/"));
         tmp.append('?').append(encoder.encode("a")).append("=").append(encoder.encode("a_value"));
         tmp.append('&').append(encoder.encode("b")).append("=").append(encoder.encode("b_value_1"));
         tmp.append('&').append(encoder.encode("b")).append("=").append(encoder.encode("b_value_2"));
         tmp.append('&').append(encoder.encode("c")).append("=").append(encoder.encode(RANGE_0_255));
         return new InvokeGetResponse(tmp.toString());
      }
      else if (getRequestCount() == 1)
      {
         try
         {
View Full Code Here

   public DriverResponse invoke(TestServlet testServlet, DriverCommand driverCommand)
   {
      if (getRequestCount() == -1)
      {
         return new InvokeGetResponse(rewriteURL(testServlet, "/"));
      }
      else
      {
         return new FailureResponse(Failure.createAssertionFailure(""));
      }
View Full Code Here

         {
         }

         //
         String url = resp.renderURL("/", null, null);
         return new InvokeGetResponse(url);
      }
      else if (getRequestCount() == 1)
      {
         assertEquals("/", req.getWebRequestPath());
         assertEquals(new HashMap<String, String[]>(), req.getQueryParameterMap());

         //
         String url = resp.renderURL("/", new HashMap<String, String[]>(), null);
         return new InvokeGetResponse(url);
      }
      else if (getRequestCount() == 2)
      {
         assertEquals("/", req.getWebRequestPath());
         assertEquals(new HashMap<String, String[]>(), req.getQueryParameterMap());

         //
         Map<String, String[]> parameters = new HashMap<String, String[]>();
         parameters.put("foo", new String[]{"foo_value"});
         parameters.put("bar", new String[]{"bar_value_1", "bar_value_2"});
         parameters.put("juu", new String[0]);
         String url = resp.renderURL("/", parameters, null);
         return new InvokeGetResponse(url);
      }
      else if (getRequestCount() == 3)
      {
         assertEquals("/", req.getWebRequestPath());
         Map<String, String[]> parameters = assertNotNull(req.getQueryParameterMap());
         assertEquals(2, parameters.size());
         assertEquals(Tools.toSet("foo", "bar"), parameters.keySet());
         assertEquals(new String[]{"foo_value"}, parameters.get("foo"));
         assertEquals(new String[]{"bar_value_1","bar_value_2"}, parameters.get("bar"));

         //
         String url = resp.renderURL("/blah", null, null);
         return new InvokeGetResponse(url);
      }
      else if (getRequestCount() == 4)
      {
         assertEquals("/blah", req.getWebRequestPath());
         assertEquals(new HashMap<String, String[]>(), req.getQueryParameterMap());

         //
         String url = resp.renderURL("/blah", new HashMap<String, String[]>(), null);
         return new InvokeGetResponse(url);
      }
      else if (getRequestCount() == 5)
      {
         assertEquals("/blah", req.getWebRequestPath());
         assertEquals(new HashMap<String, String[]>(), req.getQueryParameterMap());

         //
         Map<String, String[]> parameters = new HashMap<String, String[]>();
         parameters.put("foo", new String[]{"foo_value"});
         parameters.put("bar", new String[]{"bar_value_1", "bar_value_2"});
         parameters.put("juu", new String[0]);
         String url = resp.renderURL("/blah", parameters, null);
         return new InvokeGetResponse(url);
      }
      else if (getRequestCount() == 6)
      {
         assertEquals("/blah", req.getWebRequestPath());
         Map<String, String[]> parameters = assertNotNull(req.getQueryParameterMap());
View Full Code Here

   public DriverResponse invoke(TestServlet testServlet, DriverCommand driverCommand)
   {
      if (getRequestCount() == -1)
      {
         return new InvokeGetResponse(rewriteURL(testServlet, ""));
      }
      else
      {
         return new FailureResponse(Failure.createAssertionFailure(""));
      }
View Full Code Here

         //
         Map<String, String[]> params = new HashMap<String, String[]>();
         params.put("initialURI", new String[]{"/bar"});
         String url = resp.renderURL("/", params, null);
         return new InvokeGetResponse(url);
      }
      else if (getRequestCount() == 1)
      {
         assertEquals("/bar", wciController.getInitialURI(req));

         if ("Tomcat/7.x".equals(container.getContainerInfo()) || "JBossas/6.x".equals(container.getContainerInfo()))
         {
            assertEquals("login", v.value);

            container.logout(req, resp);

            assertEquals("logout", v.value);
            assertNull(req.getUserPrincipal());
         }
         else
         {
            // Test logout
            assertNotNull(req.getSession(false));
            assertEquals("login", v.value);
            container.logout(req, resp);
            assertNull(req.getSession(false));

            // Test logout Event
            assertEquals("logout", v.value);
         }
        
         String url = resp.renderURL("/", null, null);
         return new InvokeGetResponse(url);
      }
      else if (getRequestCount() == 2)
      {
         assertEquals(
                 "/home/j_security_check?j_username=foo&j_password=bar",
View Full Code Here

   @Override
   public DriverResponse invoke(TestServlet testServlet, DriverCommand driverCommand)
   {
      if (getRequestCount() == -1)
      {
         return new InvokeGetResponse("/test-spi-server");
      }
      else
      {
         return new FailureResponse(Failure.createAssertionFailure(""));
      }
View Full Code Here

         {
            return new FailureResponse(Failure.createAssertionFailure("The web app context is not equals to the expected value but has the value " + webApp.getContextPath()));
         }

         //
         return new InvokeGetResponse("/test-spi-server");
      }
      else
      {
         return new FailureResponse(Failure.createAssertionFailure(""));
      }
View Full Code Here

      //
      if (getRequestCount() == 0)
      {
         assertEquals("/", req.getWebRequestPath());
         return new InvokeGetResponse(rewriteURL(testServlet, "/"));
      }
      else if (getRequestCount() == 1)
      {
         assertEquals("/", req.getWebRequestPath());
         return new InvokeGetResponse(rewriteURL(testServlet, "/bar"));
      }
      else if (getRequestCount() == 2)
      {
         assertEquals("/bar", req.getWebRequestPath());
         return new EndTestResponse();
View Full Code Here

TOP

Related Classes of org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse

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.