1

I'm still trying to navigate how the httpunit class architecture works, but I've come across an issue where I'm not seeing my "load-on-startup" directives in web.xml being honored when I use ServletRunner. Is there a standard way to make this work, or is this a bug?

Here is some proof-of-concept code I'm using to try to get a working example:

ServletRunner     servletRunner = new ServletRunner(TestVariables.WEB_XML_REL_PATH);
WebConversation   conv          = new WebConversation();
ServletUnitClient client        = servletRunner.newClient();
WebRequest        request       = new PostMethodWebRequest(
        TestVariables.HTTP_UNIT_LOGGER_SERVLET_URL);
InvocationContext iContext      = client.newInvocation(request);
Ryan
  • 1,557
  • 9
  • 11
  • are you using the latest 1.7.2 release? – Wolfgang Fahl Nov 03 '12 at 16:35
  • load-on-startup seems to have not JUnit test in httpunit. I have found only two locations in the Source-Code: WebApplication.java: http://httpunit.svn.sourceforge.net/viewvc/httpunit/trunk/httpunit/src/main/java/com/meterware/servletunit/WebApplication.java?revision=1080&view=markup and webXMLString.java (in the test directory) – Wolfgang Fahl Nov 03 '12 at 17:26
  • I have tried using 1.7.2, but it's having a hard time parsing my web.xml (which is standard), so for now, I am trying to work within 1.7. I also found those 2 places in the source code. I was wondering if I'm missing something in the normal class architecture, because according to the history log of httpunit, the directive has been supported since 1.5.2: http://httpunit.sourceforge.net/doc/release_notes.html. – Ryan Nov 03 '12 at 20:22

0 Answers0