Package org.gatein.wci.test

Examples of org.gatein.wci.test.WebAppRegistry


   @Override
   protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
   {
      ServletContainer container = ServletContainerFactory.getServletContainer();
      WebAppRegistry registry = new WebAppRegistry();
      if (container.addWebAppListener(registry))
      {
         try
         {
            WebApp app = registry.getWebApp("/rdapp");
            if (app != null)
            {
               NormalCallback cb1 = new NormalCallback(app.getServletContext(), app.getClassLoader());
               Exception ex = new Exception();
               ExceptionCallback cb2 = new ExceptionCallback(app.getServletContext(), ex, ex);
               Error err = new Error();
               ExceptionCallback cb3 = new ExceptionCallback(app.getServletContext(), err, err);
               RuntimeException rex = new RuntimeException();
               ExceptionCallback cb4 = new ExceptionCallback(app.getServletContext(), rex, rex);
               IOException ioe = new IOException();
               ExceptionCallback cb5 = new ExceptionCallback(app.getServletContext(), ioe, ioe);

               //
               ServletContextDispatcher dispatcher = new ServletContextDispatcher(req, resp, container);
               Throwable response = cb1.test(null, dispatcher);
               response = cb2.test(response, dispatcher);
               response = cb3.test(response, dispatcher);
               response = cb4.test(response, dispatcher);
               response = cb5.test(response, dispatcher);

               //
               if (response != null)
               {
                  throw new ServletException(response);
               }
               else
               {
                  resp.setStatus(200);
               }
            }
            else
            {
               resp.sendError(500, "Could not find application among " + registry.getKeys());
            }
         }
         finally
         {
            container.removeWebAppListener(registry);
View Full Code Here


   @Override
   public void init() throws ServletException
   {
      container = ServletContainerFactory.getServletContainer();
      container.addWebAppListener(registry = new WebAppRegistry());
   }
View Full Code Here

   @Override
   public void init() throws ServletException
   {
      container = ServletContainerFactory.getServletContainer();
      container.addWebAppListener(registry = new WebAppRegistry());
   }
View Full Code Here

   {
      ServletContainer _container = ServletContainerFactory.getServletContainer();
      Assert.assertNotNull(_container);

      //
      WebAppRegistry _registry = new WebAppRegistry();
      _container.addWebAppListener(_registry);
      HashSet<String> _keys = new HashSet<String>(_registry.getKeys());

      //
      registry = _registry;
      keys = _keys;
      container = _container;
View Full Code Here

TOP

Related Classes of org.gatein.wci.test.WebAppRegistry

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.