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

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


      Set<String> contextRootDeployments = management.getMatchingDeploymentName("http\\-.*");
      if (contextRootDeployments.size() > 0)
      {
         String deploymentName = contextRootDeployments.iterator().next();
         String expression = ".*\\-.*?(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})-(.*)";
         return new HTTPContext(deploymentName.replaceAll(expression, "$1"), Integer.parseInt(deploymentName
               .replaceAll(expression, "$2")));
      }
      return null;
   }
View Full Code Here


         server.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(), wctx.getContextPath()));
         }

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

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

    public ProtocolMetaData getDeploymentMetaData(String deploymentName) {
        URI webURI = getWebUri();

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

            if (isWebArchive(deploymentName)) {
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

        final org.apache.openejb.server.ServiceManager smp = org.apache.openejb.server.ServiceManager.get();
        if (smp != null && SimpleServiceManager.class.isInstance(smp)) {
            final ServerService[] daemons = SimpleServiceManager.class.cast(smp).getDaemons();
            for (final ServerService ss : daemons) {
                if ("httpejbd".equals(ss.getName())) {
                    final HTTPContext httpContext = new HTTPContext(ss.getIP(), ss.getPort());
                    httpContext.add(new Servlet("ArquillianServletRunner", info.appId));
                    return new ProtocolMetaData().addContext(httpContext);
                }
            }
        }
        return null;
View Full Code Here

        this.modules = protocolMetaData.getContexts(ModuleMetaData.class);
    }

    @Override
    protected HTTPContext locateHTTPContext(Method method) {
        HTTPContext previous = null;
        if (httpContexts != null && httpContexts.size() > 0) {
            previous = super.locateHTTPContext(method);
        }

        final ModuleContext mc = locateModuleContext(method);
        HTTPContext context;
        if (previous == null) {
            context = new HTTPContext(mc.getHost(), mc.getPort());
            addArquillianServlet(context);
        } else {
            context = new HTTPContext(previous.getName(), mc.getHost(), mc.getPort());
            boolean foundArqServlet = false;
            for (Servlet servlet : previous.getServlets()) {
                if (foundArqServlet == false && ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME.equals(servlet.getName())) {
                    foundArqServlet = true;
                }
                context.add(servlet);
            }
            if (foundArqServlet == false) {
                addArquillianServlet(context);
            }
        }
View Full Code Here

         // (StandardContext) tomcat.addWebapp(null, contextPath, baseDir);
         (StandardContext) workAroundTomcat51526(contextPath, baseDir);

         standardContextProducer.set(standardContext);

         final HTTPContext httpContext = new HTTPContext(configuration.getBindAddress(),
               configuration.getBindHttpPort());

         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

      {
         return null;
      }
      if(metaData.hasContext(HTTPContext.class))
      {
         HTTPContext context = metaData.getContext(HTTPContext.class);
         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

    }

    protected ProtocolMetaData getProtocolMetaData(String host, int port, List<ModuleMetaData> modules) {
        final ProtocolMetaData protocolMetaData = new ProtocolMetaData();
        // (@ArquillianResource URL url) support
        protocolMetaData.addContext(new HTTPContext(host, port));
        // modules
        for (ModuleMetaData mmd : modules) {
            protocolMetaData.addContext(mmd);
        }
        return protocolMetaData;
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.