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

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


        final XPath xpath = XPathFactory.newInstance().newXPath();
        return xpath.evaluate("/map/entry[@key = 'message']/@value", new InputSource(new StringReader(xmlResponse)));
    }

    private ProtocolMetaData parseForProtocolMetaData(String xmlResponse) throws XPathExpressionException {
        final ProtocolMetaData protocolMetaData = new ProtocolMetaData();
        final HTTPContext httpContext = new HTTPContext(this.configuration.getRemoteServerAddress(),
                this.configuration.getRemoteServerHttpPort());

        final XPath xpath = XPathFactory.newInstance().newXPath();

        NodeList servlets = (NodeList) xpath.evaluate("/map/entry[@key = 'properties']/map/entry[@value = 'Servlet']",
                new InputSource(new StringReader(xmlResponse)), XPathConstants.NODESET);

        for (int i = 0; i < servlets.getLength(); i++) {
            httpContext.add(new Servlet(servlets.item(i).getAttributes().getNamedItem("key").getNodeValue(), this.deploymentName));
        }

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


public final class ManagementViewParser
{
   public static ProtocolMetaData parse(String archiveName, ProfileService profile)
      throws Exception
   {
      ProtocolMetaData metaData = new ProtocolMetaData();
     
      ManagementView management = profile.getViewManager();
      management.load();

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

         for(ServletHolder servlet : wctx.getServletHandler().getServlets())
         {
            httpContext.add(new Servlet(servlet.getName(), servlet.getContextPath()));
         }
        
         return new ProtocolMetaData()
            .addContext(httpContext);

      }
      catch (Exception e)
      {
View Full Code Here

         {
            httpContext.add(new Servlet(
                  standardContext.findServletMapping(mapping), contextPath));
         }
        
         return new ProtocolMetaData()
            .addContext(httpContext);
      }
      catch (Exception e)
      {
         throw new DeploymentException("Failed to deploy " + archive.getName(), e);
View Full Code Here

*/
public final class ManagementViewParser
{
   public static ProtocolMetaData parse(String archiveName, ProfileService profile) throws Exception
   {
      ProtocolMetaData metaData = new ProtocolMetaData();

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

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

      // extract deployment content
      scanDeployment(management, httpContext, management.getDeployment(archiveName));

View Full Code Here

         for(ServletHolder servlet : wctx.getServletHandler().getServlets())
         {
            httpContext.add(new Servlet(servlet.getName(), servlet.getContextPath()));
         }
        
         return new ProtocolMetaData()
            .addContext(httpContext);

      }
      catch (Exception e)
      {
View Full Code Here

   }

   @Test
   public void shouldBeAbleToInjectBaseContext() throws Exception
   {
      bind(ApplicationScoped.class, ProtocolMetaData.class, new ProtocolMetaData().addContext(new HTTPContext("TEST", 8080)));
      TestEnricher enricher = new ArquillianResourceTestEnricher();
      injector.get().inject(enricher);

      URLBaseContextClass test = new URLBaseContextClass();
      enricher.enrich(test);
View Full Code Here

  
   @Test
   public void shouldBeAbleToInjectServlet() throws Exception
   {
      bind(ApplicationScoped.class, ProtocolMetaData.class,
            new ProtocolMetaData().addContext(new HTTPContext("TEST", 8080)
            .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test"))));
     
      TestEnricher enricher = new ArquillianResourceTestEnricher();
      injector.get().inject(enricher);
View Full Code Here

   {
      ServletProtocolConfiguration config = new ServletProtocolConfiguration();
     
      ServletMethodExecutor executor = protocol.getExecutor(
            config,
            new ProtocolMetaData()
               .addContext(
                     new HTTPContext("127.0.0.1", 8080)
                        .add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, "test"))));
     
      Assert.assertEquals("http://127.0.0.1:8080/test", executor.getBaseURI().toString());
View Full Code Here

     
      ServletProtocol protocol = new ServletProtocol();
     
      ServletMethodExecutor executor = protocol.getExecutor(
            config,
            new ProtocolMetaData()
               .addContext(
                     new HTTPContext("127.0.0.1", 8080)
                        .add(new Servlet(ServletMethodExecutor.ARQUILLIAN_SERVLET_NAME, "test"))));
     
      Assert.assertEquals("http://10.10.10.1:90/test", executor.getBaseURI().toString());
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.spi.client.protocol.metadata.ProtocolMetaData

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.