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

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


        
         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


      ManagementView management = profile.getViewManager();
      management.load();

      // extract server info
      HTTPContext httpContext = extractHTTPContext(management);
      if (httpContext != null)
      {
         metaData.addContext(httpContext);
      }
View Full Code Here

         /*
          *  http-localhost%2F127.0.0.1-8080
          *  http-127.0.0.1-8080
          */
         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

      // TODO: can not set contextRoot in config, change to prefixContextRoot
      String contextRoot = null; //protocolConfiguration.getContextRoot();
     
      if( metaData.hasContext(HTTPContext.class))
      {
         HTTPContext context = metaData.getContext(HTTPContext.class);
         Servlet servlet = context.getServletByName(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME);
         if(servlet != null)
         {
            // use the context where the Arquillian servlet is found
            if(address == null)
            {
               address = context.getHost();
            }
            if(port == null)
            {
               port = context.getPort();
            }
            contextRoot = servlet.getContextRoot();
         }
         else
         {
View Full Code Here

     
      ManagementView management = profile.getViewManager();
      management.load();

      // extract server info
      HTTPContext httpContext = extractHTTPContext(management);
      if(httpContext != null)
      {
         metaData.addContext(httpContext);
      }
     
View Full Code Here

      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

         throw new DeploymentException("Could not deploy " + archive.getName(), e);
      }
     
      try
      {
         HTTPContext httpContext = new HTTPContext(
               ADDRESS,
               configuration.getBindHttpPort());
        
         findServlets(httpContext, deploymentName);
        
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

      {
         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

TOP

Related Classes of org.jboss.arquillian.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.