4 Replies Latest reply on Aug 9, 2010 5:49 PM by Dan Allen

    Using web.xml's non-test servlets

    Ales Justin Master

      I have this @Deployment


         public static Archive createTestArchive()
            WebArchive webArchive = ShrinkWrap.create(WebArchive.class, "simple.war");
            webArchive.addPackage(MockComponentsServlet.class.getPackage()); // mock
            URL webXml = GMcTestCase.class.getResource("/components/WEB-INF/web.xml");
            return webArchive;


      where the web.xml looks like


              <servlet-name>MC Servlet</servlet-name>
              <servlet-name>MC Servlet</servlet-name>


      but I cannot get the non-test url to work

      (the /test works, but not the one mapped in web.xml)


      URL url = new URL("http://localhost:8080/test"); // TODO -- real url; /client/mc-initial
      URLConnection conn = url.openConnection();


      What am I missing?