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

      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

        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

        }
        explodeIfNeeded(testableArchive, archive, explodedDeploymentDirectory, rebelXmlGenerated);

        eventContext.proceed();

        HTTPContext httpContext = protocolMetaData.get().getContext(HTTPContext.class);
        if (httpContext != null) {
            //noinspection ResultOfMethodCallIgnored
            metaDataFile.getParentFile().mkdirs();
            Serializer.toStream(new SerializableHttpContextData(httpContext, rebelXmlGenerated), metaDataFile);
        }
View Full Code Here

// -------------------------- OTHER METHODS --------------------------

    public HTTPContext toHTTPContext()
    {
        final HTTPContext httpContext = new HTTPContext(name, host, port);
        for (Servlet servlet : getServlets()) {
            httpContext.add(new org.jboss.arquillian.container.spi.client.protocol.metadata.Servlet(servlet.name, servlet.contextRoot));
        }
        return httpContext;
    }
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 (Throwable t) {
View Full Code Here

            if (options.get("tomee.appinfo.output", false)) {
                Info.marshal(appInfo);
            }

            HTTPContext httpContext = new HTTPContext(configuration.getHost(), configuration.getHttpPort());

            String arquillianServlet;
            // Avoids "inconvertible types" error in windows build
            if (archiveName.endsWith(".war") || (archiveName.endsWith(".ear") && appInfo.webApps.size() == 1)) {
                arquillianServlet = "/" + getArchiveNameWithoutExtension(archive);
            } else {
                arquillianServlet = "/arquillian-protocol";
            }
            httpContext.add(new Servlet("ArquillianServletRunner", arquillianServlet));
            addServlets(httpContext, appInfo);

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

            return new ProtocolMetaData().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.