Package org.jboss.unit.driver.response

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


      else if (getRequestCount() == 4)
      {
         return new EndTestResponse();
      }

      return new FailureResponse(Failure.createAssertionFailure("End test reached"));
   }
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 application web app
         return new DeployResponse("test-spi-app.war");
      }
      else if (getRequestCount() == 0)
      {
         FailureResponse failureResponse = checkDeployments("/test-spi-app", 1);
         if (failureResponse != null)
         {
            return failureResponse;
         }
         else
         {
            // call service method
            return new InvokeGetResponse("/test-spi-server");
         }
      }
      else
      {
         return new FailureResponse(Failure.createAssertionFailure(""));
      }
   }
View Full Code Here

      diff.removeAll(keys);

      // It should be 1
      if (diff.size() != count)
      {
         return new FailureResponse(Failure.createAssertionFailure("The size of the new web application deployed should be " + count + ", it is " + diff.size() + " instead." +
               "The previous set was " + keys + " and the new set is " + registry.getKeys()));
      }
      if (!diff.contains(appContext))
      {
         return new FailureResponse(Failure.createErrorFailure("Could not find the requested webapp [" + appContext + "] in the list of depoyed webapps."));
      }

      //
      WebApp webApp = registry.getWebApp(appContext);
      if (webApp == null)
      {
         return new FailureResponse(Failure.createAssertionFailure("The web app " + appContext + " was not found"));
      }
      if (!appContext.equals(webApp.getContextPath()))
      {
         return new FailureResponse(Failure.createAssertionFailure("The web app context is not equals to the expected value [" + appContext + "] but has the value " + webApp.getContextPath()));
      }

      return null;
   }
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.