6 Replies Latest reply on Apr 7, 2011 10:09 AM by Ondrej Zizka

    Implementing DeploymentContainer - What to put to ProtocolMetaData?

    Ondrej Zizka Master

      Hi,

       

       

      What's to be filled into ProtocolMetadata? Any doc/wiki on this?

       

      I've this Tomcat's output from /manager/list

       

      OK - Listed applications for virtual host localhost
      /:running:0:ROOT
      /manager:running:1:manager
      /docs:running:0:docs
      /examples:running:0:examples
      /host-manager:running:0:host-manager
      

       

       

      So I parsed it as follows

       

          private ProtocolMetaData parseForProtocolMetaData(String textResponse) {
              final ProtocolMetaData protocolMetaData = new ProtocolMetaData();
              final HTTPContext httpContext = new HTTPContext(this.conf.getHost(), this.conf.getHttpPort());
      
              String[] lines = textResponse.split("\\n");
              for (int i = 1; i < lines.length; i++) {
                  String line = lines[i];
                  String[] parts = line.split(":");
                  if( parts.length < 4 ) continue;
                  httpContext.add(new Servlet(parts[0], parts[3]));
              }
      
              protocolMetaData.addContext(httpContext);
              return protocolMetaData;
          }
      

       

      Is that correct?

      I'm getting this (in a test I stolen from the tomcat embedded impl ;-)

       

      shouldBeAbleToInjectMembersIntoTestClass(org.jboss.arquillian.container.tomcat.remote_6.TomcatRemoteInContainerTestCase)  Time elapsed: 0.006 sec  <<< ERROR!
      java.lang.IllegalArgumentException: ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.
          at org.jboss.arquillian.protocol.servlet.ServletUtil.determineBaseURI(ServletUtil.java:63)
          at org.jboss.arquillian.protocol.servlet.BaseServletProtocol.getExecutor(BaseServletProtocol.java:56)
          at org.jboss.arquillian.protocol.servlet.BaseServletProtocol.getExecutor(BaseServletProtocol.java:30)
          at org.jboss.arquillian.impl.execution.RemoteTestExecuter.getContainerMethodExecutor(RemoteTestExecuter.java:105)
          at org.jboss.arquillian.impl.execution.RemoteTestExecuter.execute(RemoteTestExecuter.java:96)
      

       

      Which seems like I should pack something into the archive.

      Thanks for hints.