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

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


    try {
      ctx = archive.as(GwtWebAppContext.class);
      ctx.export(config);
      doStart((GwtArchive) archive);
      WebAppContext wctx = devMode.getWebAppContext();
      HTTPContext httpContext = new HTTPContext(config.getBindAddress(), config.getPort());
          for(ServletHolder servlet : wctx.getServletHandler().getServlets())
              httpContext.add(new Servlet(servlet.getName(), wctx.getContextPath()));
      return new ProtocolMetaData().addContext(httpContext).addContext(config);
    } catch (Exception e) {
      throw new DeploymentException("Could not deploy " + archive.getName(), e);
    }
  }
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

      {
         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

    Map subComponentsResponce = getClientUtil().GETRequest(path);
        Map<String, String> subComponents = (Map<String, String>) subComponentsResponce.get("properties");

        // Build up the HTTPContext object using the nodeAddress information
        int port = nodeAddress.getHttpPort();
        HTTPContext httpContext = new HTTPContext( nodeAddress.getHost(), port );

        // Add the servlets to the HTTPContext
        String componentName;
        String contextRoot = getApplicationContextRoot(name);

        if ( subComponents != null ) {
            for (Map.Entry subComponent : subComponents.entrySet())
            {
                componentName = subComponent.getKey().toString();
                if ( WEBMODULE.equals(subComponent.getValue()) ) {

                    List<Map> children = (List<Map>) subComponentsResponce.get("children");
                    // Override the application contextRoot by the webmodul's contextRoot
                    contextRoot = resolveWebModuleContextRoot(componentName, children);
                    resolveWebModuleSubComponents(name, componentName, contextRoot, httpContext);

                } else if ( SERVLET.equals(subComponent.getValue()) ) {

                    httpContext.add(new Servlet(componentName, contextRoot));
                }
            }
        }

      return httpContext;
View Full Code Here

         
          deploymentName = createDeploymentName(archiveName);
          addDeployFormFields(deploymentName, form);
         
          // Do Deploy the application on the remote GlassFish
          HTTPContext httpContext = glassFishClient.doDeploy(deploymentName, form);          
          protocolMetaData.addContext(httpContext);
      } catch (GlassFishClientException e) {
          throw new DeploymentException("Could not deploy " + archiveName, e);
      }
      return protocolMetaData;
View Full Code Here

            throw new DeploymentException("Cannot setup GAE Api Environment", e);
        }

        try {
            HTTPContext httpContext = new HTTPContext(containerConfig.getBindAddress(), containerConfig.getBindHttpPort());
            AppContext context = server.getAppContext();
            WebAppContextUtil wctx = new WebAppContextUtil(context.getContainerContext());
            for (WebAppContextUtil.ServletHolder servlet : wctx.getServlets()) {
                httpContext.add(new Servlet(servlet.getName(), wctx.getContextPath()));
            }
            return new ProtocolMetaData().addContext(httpContext);
        } catch (Exception e) {
            teardown();
            shutdownServer();
View Full Code Here

                buildUrl(getAppURI(), contextPath)
            });

        URI contextURI = getAppURI();

        HTTPContext context = new HTTPContext("openshift", contextURI.getHost(), getPort(contextURI));
        Servlet servlet = new Servlet("deployment", contextPath);
        context.add(servlet);

        ProtocolMetaData metaData = new ProtocolMetaData();
        metaData.addContext(context);

        return metaData;
View Full Code Here

    }

    public HTTPContext getHTTPDeploymentMetaData(Server server, String uniqueDeploymentName) {

        URI webURI = getProtocolURI(server, PROTOCOL_HTTP);
        HTTPContext context = new HTTPContext(webURI.getHost(), webURI.getPort());
        try {
            ModelNode deploymentNode = readResource(createHostServerDeploymentAddress(
                    server.getHost(), server.getName(), uniqueDeploymentName), false); // don't include runtime information, workaround for bug in web statistics

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

      this.contexts = contexts;
   }

   public URI locateTestServlet(Method method)
   {
      HTTPContext context = locateHTTPContext(method);
      return ServletUtil.determineBaseURI(
               config,
               context,
               ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME);
   }
View Full Code Here

         final ContextName contextName = getContextName(archive);
         final StandardContext standardContext = (StandardContext) host.findChild(contextName.getName());
         standardContextProducer.set(standardContext);

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

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

         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.