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

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


            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


public final class ManagementViewParser
{
   public static ProtocolMetaData parse(String archiveName, MBeanServerConnection connection) throws Exception
   {
      ProtocolMetaData metaData = new ProtocolMetaData();
      HTTPContext httpContext = extractHTTPContext(connection);
      metaData.addContext(httpContext);

      // extract deployment content
      scanDeployment(connection, httpContext, archiveName);
View Full Code Here

         String protocol = (String)connection.getAttribute(connector, "protocol");
         if(protocol.contains("HTTP"))
         {
            String address = ((InetAddress)connection.getAttribute(connector, "address")).getHostAddress();
            Integer port = Integer.parseInt(connector.getKeyProperty("port"));
            return new HTTPContext(address, port);
         }
      }
      return null;
   }
View Full Code Here

       return context;
   }
   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

   @Test
   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));
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));
View Full Code Here

   @Test
   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));
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));
View Full Code Here

   @Test(expected = IllegalArgumentException.class)
   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));
View Full Code Here

            if (options.get("tomee.appinfo.output", false)) {
                Info.marshal(appInfo);
            }

            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.HTTPContext

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.