Package org.jboss.arquillian.container.spi.client.protocol.metadata

Examples of org.jboss.arquillian.container.spi.client.protocol.metadata.Servlet


            this.container.deploy(name, file);
            final AppInfo info = this.container.getInfo(name);
            final String context = this.getArchiveNameWithoutExtension(archive);

            final HTTPContext httpContext = new HTTPContext(this.configuration.getHost(), this.configuration.getHttpPort());
            httpContext.add(new Servlet("ArquillianServletRunner", "/" + context));
            this.addServlets(httpContext, info);

            startCdiContexts(name); // ensure tests can use request/session scopes even if we don't have a request

            classLoader.set(SystemInstance.get().getComponent(ContainerSystem.class).getAppContext(info.appId).getClassLoader());
View Full Code Here


         Set<ObjectName> servletObjects = connection.queryNames(new ObjectName(
               "*:*,J2EEApplication=none,J2EEServer=none,j2eeType=Servlet,name=" + servletName), null);
         for (ObjectName servletObject : servletObjects)
         {
            String contextRoot = servletObject.getKeyProperty("WebModule").replaceAll(".*\\/(.*)", "$1");
            httpContext.add(new Servlet(servletName, contextRoot));
         }
      }
   }
View Full Code Here

   }
   protected HTTPContext createContext()
   {
      URI baseURI = createBaseURL();
      HTTPContext context = new HTTPContext(baseURI.getHost(), baseURI.getPort());
      context.add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, baseURI.getPath()));
      return context;
   }
View Full Code Here

   public void shouldFindTestServletInMetadata() throws Exception
   {
      ServletProtocolConfiguration config = new ServletProtocolConfiguration();

      HTTPContext testContext = new HTTPContext("127.0.0.1", 8080)
         .add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, "test"));
     
      Method testMethod = getTestMethod("testNoAnnotations");
     
      ServletURIHandler handler = new ServletURIHandler(config, to(testContext));
      URI result = handler.locateTestServlet(testMethod);
View Full Code Here

      ServletProtocolConfiguration config = new ServletProtocolConfiguration();
      config.setHost("10.10.10.1");
      config.setPort(90);
     
      HTTPContext testContext = new HTTPContext("127.0.0.1", 8080)
      .add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, "test"));
  
      Method testMethod = getTestMethod("testNoAnnotations");
     
      ServletURIHandler handler = new ServletURIHandler(config, to(testContext));
      URI result = handler.locateTestServlet(testMethod);
View Full Code Here

   public void shouldMatchNamedTargetedContext() throws Exception
   {
      ServletProtocolConfiguration config = new ServletProtocolConfiguration();

      HTTPContext testContextOne = new HTTPContext("Y", "127.0.0.1", 8080)
         .add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, "test"));

      HTTPContext testContextTwo = new HTTPContext("X", "127.0.0.1", 8081)
         .add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, "test"));
     
      Method testMethod = getTestMethod("testTargeted");
     
      ServletURIHandler handler = new ServletURIHandler(config, to(testContextOne, testContextTwo));
      URI result = handler.locateTestServlet(testMethod);
View Full Code Here

      ServletProtocolConfiguration config = new ServletProtocolConfiguration();
      config.setHost("10.10.10.1");
      config.setPort(90);
     
      HTTPContext testContextOne = new HTTPContext("Y", "127.0.0.1", 8080)
         .add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, "testY"));

      HTTPContext testContextTwo = new HTTPContext("X", "127.0.0.1", 8081)
         .add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, "testX"));
  
      Method testMethod = getTestMethod("testTargeted");
     
      ServletURIHandler handler = new ServletURIHandler(config, to(testContextOne, testContextTwo));
      URI result = handler.locateTestServlet(testMethod);
View Full Code Here

   public void shouldThrowExceptionOnMissingNamedTargetedContext() throws Exception
   {
      ServletProtocolConfiguration config = new ServletProtocolConfiguration();

      HTTPContext testContextOne = new HTTPContext("Y", "127.0.0.1", 8080)
         .add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, "test"));
     
      Method testMethod = getTestMethod("testTargeted");
     
      ServletURIHandler handler = new ServletURIHandler(config, to(testContextOne));
      handler.locateTestServlet(testMethod);
View Full Code Here

                    if (clazz == null) {
                        continue;
                    }
                }

                httpContext.add(new Servlet(clazz, webApps.contextRoot));
                /*
                for (String mapping : servlet.mappings) {
                    httpContext.add(new Servlet(servlet.servletClass, startWithSlash(uniqueSlash(webApps.contextRoot, mapping))));

                }
View Full Code Here

            final HTTPContext httpContext = new HTTPContext(configuration.getHost(), configuration.getHttpPort());

            // Avoids "inconvertible types" error in windows build
            if (archiveName.endsWith(".war")) {
                httpContext.add(new Servlet("ArquillianServletRunner", "/" + getArchiveNameWithoutExtension(archive)));
            } else if (archiveName.endsWith(".ear") && appInfo.webApps.size() > 0) {
                final String contextRoot = System.getProperty("tomee.arquillian.ear.context", configuration.getWebContextToUseWithEars());
                if (contextRoot != null) {
                    httpContext.add(new Servlet("ArquillianServletRunner", ("/" + contextRoot).replace("//", "/")));
                } else {
                    for (final WebAppInfo web : appInfo.webApps) { // normally a single webapp is supported cause of arquillian resolution
                        httpContext.add(new Servlet("ArquillianServletRunner", ("/" + web.contextRoot).replace("//", "/")));
                    }
                }
            } else {
                httpContext.add(new Servlet("ArquillianServletRunner", "/arquillian-protocol")); // needs another jar to add the fake webapp
            }
            addServlets(httpContext, appInfo);

            return new ProtocolMetaData().addContext(httpContext);
        } catch (final Exception e) {
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.container.spi.client.protocol.metadata.Servlet

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.