Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-539

Resource injection for Servlet type should inject URL(s) for the servlet instead of baseURL

    Details

    • Type: Enhancement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.0.0.CR2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      As is suggested by the current documentation on Resource Injection the following injects the URL for the context (i.e. the base URL, e.g. "http://localhost:8080/test"):

      @Test
      private void shouldDoX(@ArquillianResource(MyServlet.class) URL baseURL) 
      {
      }
      

      It would seem more intuitive when requesting injection of a URL for the MyServlet.class resource if that URL was for MyServlet, e.g. "http://localhost:8080/test/MyServlet". Since MyServlet.class could be deployed to any url-pattern, e.g. "http://localhost:8080/test/TestServlet", it's not safe for the end user to guess from the baseURL and MyServlet.class name what the servlet's URL might be. Come to think of it the same servlet could be deployed to numerous url-pattern's, so perhaps injection of a Collection<URL> is really what's called for here:

      @Test
      private void shouldDoX(@ArquillianResource(MyServlet.class) Collection<URL> servletURLs) 
      {
      }
      

      That would imply searching for the servlets in the HTTPContext by type rather than by name, however org.jboss.arquillian.container.spi.client.protocol.metadata.Servlet currently only stores the name and context root.

        Gliffy Diagrams

          Activity

          Hide
          ianbrandt Ian Brandt added a comment -

          I misunderstood the purpose of the @ArquillianResource(MyServlet.class) version. I've attempted to clarify the documentation. Resolving as Won't Fix.

          Show
          ianbrandt Ian Brandt added a comment - I misunderstood the purpose of the @ArquillianResource(MyServlet.class) version. I've attempted to clarify the documentation . Resolving as Won't Fix.

            People

            • Assignee:
              ianbrandt Ian Brandt
              Reporter:
              ianbrandt Ian Brandt
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development