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

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


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 null;
      }
      if(metaData.hasContext(HTTPContext.class))
      {
         HTTPContext context = null;
         if(targets != null)
         {
            context = locateNamedHttpContext(metaData, targets.value());
         }
         else
         {
            context = metaData.getContexts(HTTPContext.class).iterator().next();
         }

         if(resource.value() != null && resource.value() != ArquillianResource.class)
         {
            // TODO: we need to check for class. Not all containers have ServletClass available.
            Servlet servlet = context.getServletByName(resource.value().getSimpleName());
            if( servlet == null)
            {
               servlet = context.getServletByName(resource.value().getName());
               //throw new RuntimeException("No Servlet named " + resource.value().getSimpleName() + " found in metadata");
            }
            if(servlet == null)
            {
               return null;
            }
            return toURL(servlet);
         }
         // TODO: evaluate, if all servlets are in the same context, and only one context exists, we can find the context        
         else if(allInSameContext(context.getServlets()))
         {
            return toURL(context.getServlets().get(0));
         }
         else
         {
            return toURL(context);
         }
View Full Code Here

         ((HandlerCollection) server.getHandler()).addHandler(wctx);
         wctx.start();
         webAppContextProducer.set(wctx);

         HTTPContext httpContext = new HTTPContext(containerConfig.getBindAddress(), containerConfig.getBindHttpPort());
         for(ServletHolder servlet : wctx.getServletHandler().getServlets())
         {
            httpContext.add(new Servlet(servlet.getName(), servlet.getContextPath()));
         }

         return new ProtocolMetaData()
            .addContext(httpContext);
View Full Code Here

            return null;
        }

        Collection<HTTPContext> contexts = protocolMetadata.getContexts(HTTPContext.class);

        HTTPContext context = locateHTTPContext(testMethod, contexts);
        URL servletURL = locateCommandEventBusURI(context);

        return servletURL;
    }
View Full Code Here

    }

    protected URI getBaseURI(Method method) throws Exception {
        ProtocolDefinition definition = registry.get().getProtocol(ProtocolDescription.DEFAULT);
        ModulesProtocolConfiguration configuration = (ModulesProtocolConfiguration) definition.createProtocolConfiguration();
        HTTPContext context = ModulesApi.findHTTPContext(configuration, protocolMetaData, method);
        return context.getServlets().get(0).getBaseURI();
    }
View Full Code Here

         throw new DeploymentException("Could not deploy " + archive.getName(), e);
      }
     
      try
      {
         HTTPContext httpContext = new HTTPContext(
               ADDRESS,
               configuration.getBindHttpPort());
        
         findServlets(httpContext, resolveWebArchiveNames(archive));
        
View Full Code Here

        URI webURI = getSubSystemURI(WEB);
        URI jmxURI = getSubSystemURI(JMX);

        ProtocolMetaData metaData = new ProtocolMetaData();
        metaData.addContext(new JMXContext(jmxURI.getHost(), jmxURI.getPort()));
        HTTPContext context = new HTTPContext(webURI.getHost(), webURI.getPort());
        metaData.addContext(context);
        try {
            ModelNode deploymentNode = readResource(createDeploymentAddress(deploymentName));

            if (isWebArchive(deploymentName)) {
View Full Code Here

    }

    @Override
    protected HTTPContext locateHTTPContext(Method method) {
        final ModuleContext mc = locateModuleContext(method);
        HTTPContext context = new HTTPContext(mc.getHost(), mc.getPort());
        Servlet servlet = new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, "");
        context.add(servlet);
        return context;
    }
View Full Code Here

         standardHost.addChild(standardContext);

         standardContextProducer.set(standardContext);

         String contextPath = standardContext.getPath();
         HTTPContext httpContext = new HTTPContext(bindAddress, bindPort);

         for (String mapping : standardContext.findServletMappings())
         {
            httpContext.add(new Servlet(standardContext.findServletMapping(mapping), contextPath));
         }

         return new ProtocolMetaData().addContext(httpContext);
      }
      catch (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.