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

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


          archive.as(ZipExporter.class).exportTo(file, true);


            AppContext appContext = container.deploy(name, file);

            HTTPContext httpContext = new HTTPContext("0.0.0.0", configuration.getHttpPort());
            httpContext.add(new Servlet("ArquillianServletRunner", "/" + getArchiveNameWithoutExtension(archive)));
            beanManagerInstance.set(appContext.getBeanManager());
            return new ProtocolMetaData().addContext(httpContext);
        } catch (Exception e) {
            e.printStackTrace();
            throw new DeploymentException("Unable to deploy", e);
View Full Code Here


                if (extracted.exists()) {
                    extracted.deleteOnExit();
                }
            }

            HTTPContext httpContext = new HTTPContext(LOCALHOST, configuration.getHttpPort());
            if (archive instanceof WebArchive) {
              httpContext.add(new Servlet("ArquillianServletRunner", "/" + getArchiveNameWithoutExtension(archive)));
            } else {
              httpContext.add(new Servlet("ArquillianServletRunner", "/arquillian-protocol"));
            }
           
            // we should probably get all servlets and add them to the context
            return new ProtocolMetaData().addContext(httpContext);
        } catch (Exception e) {
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

            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

        }

        try {
            Thread.currentThread().getContextClassLoader().loadClass(REMOTE_INITIAL_CONTEXT_FACTORY);

            final HTTPContext httpContext = metaData.getContexts(HTTPContext.class).iterator().next();
            final Properties props = new Properties();
            props.setProperty(Context.INITIAL_CONTEXT_FACTORY, REMOTE_INITIAL_CONTEXT_FACTORY);
            props.setProperty(Context.PROVIDER_URL, "http://" + httpContext.getHost() + ":" + httpContext.getPort() + "/tomee/ejb");

            Context existing = null;
            try {
                existing = existingContext.get();
            } catch (final Throwable t) {
View Full Code Here

        Method testMethod = event.getTestMethod();

        // Calculate eventUrl
        Collection<HTTPContext> contexts = protocolMetadata.get().getContexts(HTTPContext.class);

        HTTPContext context = locateHTTPContext(testMethod, contexts);
        URI servletURI = locateCommandEventBusURI(context);

        String url = servletURI.toASCIIString() + "?className=" + testClass.getName() + "&methodName=" + testMethod.getName();

        channelUrl = url;
View Full Code Here

    try {
      ctx = archive.as(GwtWebAppContext.class);
      ctx.export(config);
      doStart();
      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);
    } catch (Exception e) {
      throw new DeploymentException("Could not deploy " + archive.getName(), e);
    }
  }
View Full Code Here

        address = AddressProvider.extractAddress(event, pmd);
        if (address != null) {
            return address;
        }

        HTTPContext httpContext = pmd.getContext(HTTPContext.class);
        if (httpContext != null) {
            return httpContext.getHost();
        }

        RMIContext rmiContext = pmd.getContext(RMIContext.class);
        if (rmiContext != null) {
            return rmiContext.getIp();
View Full Code Here

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

        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

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

      // extract server info
      HTTPContext httpContext = extractHTTPContext(management);
      if (httpContext != null)
      {
         metaData.addContext(httpContext);
      }
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.