Examples of InvokeGetResponse


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

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

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

   @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

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

         {
            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

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

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

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

   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

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

         return context.responseContext;
      }

      public DriverResponse invoke(TestId testId, DriverCommand driverCommand)
      {
         return new InvokeGetResponse("/portlet-test");
      }
View Full Code Here

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

         }
         if (!webapp.getContextPath().equals("/test-native-skip-with-gateinservlet-app"))
         {
            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(new Failure("Test not expected to reach RequestCount of " + getRequestCount(), FailureType.ERROR));
      }
View Full Code Here

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

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

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

   @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

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

            assertEquals("login", v.value);
            assertTrue(resp.isCommitted());
         }

         String url = resp.renderURL("/", null, null);
         return new InvokeGetResponse(url);
      }
      else if (getRequestCount() == 2)
      {

         // Counter to keep an eye on includes
         final Map<String, String> rets = new HashMap<String, String>();

         // Set some session state in this context
         req.getSession().setAttribute(CROSS_CTX_TEST_ATTR, "1");

         // Set some session state in another context
         ServletContext appContext = testServlet.getServletContext().getContext("/test-spi-app");
         ServletContextDispatcher dispatcher = new ServletContextDispatcher(req, resp, container);

         NormalCallback cb = new NormalCallback(appContext, registry.getWebApp("/test-spi-app").getClassLoader())
         {
            public Object doCallback(ServletContext dispatchedServletContext, HttpServletRequest dispatchedRequest, HttpServletResponse dispatchedResponse, Object handback) throws ServletException, IOException
            {
               dispatchedRequest.getSession().setAttribute(CROSS_CTX_TEST_ATTR, "2");
               rets.put(COUNT_KEY, "1");
               return super.doCallback(dispatchedServletContext, dispatchedRequest, dispatchedResponse, handback);
            }
         };

         DriverResponse response = cb.test(null, dispatcher);
         if (response != null)
            return response;

         // Check that the callback was invoked and the other context really was used with another session
         assertEquals("1", req.getSession().getAttribute(CROSS_CTX_TEST_ATTR));
         assertEquals("1", rets.get(COUNT_KEY));

         String url = resp.renderURL("/", null, null);
         return new InvokeGetResponse(url);
      }
      else if (getRequestCount() == 3)
      {
         // Check that the sessions retained values between requests
         // test-spi-server context
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.