Ryan
Ryan

Reputation: 1557

HttpUnit not honoring load-on-startup in web.xml

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);

Upvotes: 1

Views: 139

Answers (0)

Related Questions