Package org.jboss.unit.driver.response

Examples of org.jboss.unit.driver.response.FailureResponse


                  //
                  response = ((PortletEventTestAction)action).execute(this, req, resp, ctx);
               }
               else if (action == null)
               {
                  response = new FailureResponse(Failure.createAssertionFailure("Action for " + ctx.getRequestCount() +
                     " " + NodeId.locate() + " " + actionJoinPoint + " is null"));
               }
               else
               {
                  response = new FailureResponse(Failure.createAssertionFailure("Action for " + ctx.getRequestCount() +
                     " " + NodeId.locate() + " " + actionJoinPoint + " does not have the right type but has the type " +
                     action.getClass().getName()));
               }

               //
View Full Code Here


            //
            response = ((PortletRenderTestAction)action).execute(this, req, resp, ctx);
         }
         else if (action == null)
         {
            response = new FailureResponse(Failure.createAssertionFailure("Action for " + ctx.getRequestCount() +
            " " + NodeId.locate() + " " + resourceJoinPoint + " is null"));
         }
         else
         {
            response = new FailureResponse(Failure.createAssertionFailure("Action for " + ctx.getRequestCount() +
            " " + NodeId.locate() + " " + resourceJoinPoint + " does not have the right type but has the type " +
            action.getClass().getName()));
         }

         // If we have one result it is meant to be returned to the client
View Full Code Here

         // Get the result that must exist since it is the only joinpoint invoked during this request
         response = ((PortletResourceTestAction)action).execute(this, req, resp, ctx);
      }
      else if (action == null)
      {
         response = new FailureResponse(Failure.createAssertionFailure("Action for " + ctx.getRequestCount() +
            " " + NodeId.locate() + " " + resourceJoinPoint + " is null"));
      }
      else
      {
         response = new FailureResponse(Failure.createAssertionFailure("Action for " + ctx.getRequestCount() +
            " " + NodeId.locate() + " " + resourceJoinPoint + " does not have the right type but has the type " +
            action.getClass().getName()));
      }

      //
View Full Code Here

      //
      String actorId = context.getActorId(JoinPointType.PORTLET_ACTION);

      //
      DriverResponse response = new FailureResponse(Failure.createErrorFailure(""));

      //
      if (actorId != null)
      {
         JoinPoint tmp = new JoinPoint(actorId, JoinPointType.PORTLET_ACTION);

         //
         if (tmp.equals(actionJoinPoint))
         {
            try
            {
               response = doProcessAction(req, resp, context);
            }
            catch (AssertionError e)
            {
               response = new FailureResponse(Failure.createFailure(e));
            }
         }
      }

      //
View Full Code Here

               super.render(req, resp);
               response = postRender(req, resp, context);
            }
            catch (AssertionError e)
            {
               response = new FailureResponse(Failure.createFailure(e));
            }

            //
            if (response != null)
            {
View Full Code Here

      {
         return new EndTestResponse();
      }
      else
      {
         return new FailureResponse(Failure.createAssertionFailure("Test not expected to reach RequestCount of " + getRequestCount()))
      }
   }
View Full Code Here

      if (getRequestCount() == -1)
      {
         container = DefaultServletContainerFactory.getInstance().getServletContainer();
         if (container == null)
         {
            return new FailureResponse(Failure.createAssertionFailure("No servlet container present"));
         }

         // Register and save the deployed web apps
         registry = new WebAppRegistry();
         container.addWebAppListener(registry);
         keys = new HashSet<String>(registry.getKeys());
        
         // Deploy the web app with init param of gatein.wci.native.DisableRegistration set to true
         return new DeployResponse("test-native-skip-app.war");
      }
      else if (getRequestCount() == 0)
      {
         //make sure the test-native-skip-app.war is actually skipped
         if (registry.getWebApp("/test-native-skip-app") != null)
         {
            return new FailureResponse(Failure.createAssertionFailure("The test-native-skip-app.war should not be seen by the native implemetentation."));
         }
        
         // Compute the difference with the previous deployed web apps
         Set diff = new HashSet<String>(registry.getKeys());
         diff.removeAll(keys);
        
         // It should be 0, since the test-native-skip-app.war should not get registered by the native implementation
         if (diff.size() != 0)
         {
            return new FailureResponse(Failure.createAssertionFailure("The size of the new web application deployed should be 0, it is " + diff.size() + " instead." +
            "The previous set was " + keys + " and the new set is " + registry.getKeys()));
         }
        
         return new DeployResponse("test-native-skip-with-gateinservlet-app.war");
      }
      else if (getRequestCount() == 1)
      {
         // Compute the difference with the previous deployed web apps
         Set diff = new HashSet<String>(registry.getKeys());
         diff.removeAll(keys);

         // It should be 1
         if (diff.size() != 1)
         {
            return new FailureResponse(Failure.createAssertionFailure("The size of the new web application deployed should be 1, it is " + diff.size() + " instead." +
            "The previous set was " + keys + " and the new set is " + registry.getKeys()));
         }
        
         WebApp webapp = registry.getWebApp("/test-native-skip-with-gateinservlet-app");
         //make sure the test-native-skip-with-gateinservlet-app.war is picked up
         if (webapp== null)
         {
            return new FailureResponse(Failure.createAssertionFailure("The test-native-skip-with-gateinservler-app.war should be seen."));
         }
         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

      catch (AssertionError t)
      {
         getLogger().error("The test case failed", t);

         //
         return new FailureResponse(Failure.createFailure(t));
      }
   }
View Full Code Here

      catch (AssertionError t)
      {
         getLogger().error("The test case failed", t);

         //
         return new FailureResponse(Failure.createFailure(t));
      }
   }
View Full Code Here

      {
         return run(servlet, request, response, context);
      }
      catch (Throwable t)
      {
         return new FailureResponse(Failure.createFailure(t));
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.unit.driver.response.FailureResponse

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.