You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brian Buckley <br...@attbi.com> on 2002/06/24 18:20:37 UTC
MockStrutsTestCase and ServletContextListener
Hello,
I am running some MockStrutsTestCases (StrutsTestCase 1.7.1 from
strutstest-1.1_2.3.zip) and they are working well, but now I need to add a
TestCase which requires a ServletContext listener (Servlet API 2.3) to be
run prior to running my test. The listener initializes several attributes
in the ServletContext that the test uses.
Reading the MockStrutsTestCase documentation, it appears that this
capability is part of the framework but I have not been able to get it
working - the ServletContext attributes that my ServletContextListener is
supposed to setup are not being set.
My setup to attempt to get this working includes putting my web.xml in the
same WEB-INF directory as my struts-config.xml. The web.xml file contains
my listener entry and it works properly when used in a normal webapp war.
My classpath for the test includes the WEB-INF directory and my listener
class.
Has anyone gotten this capability working for them? Any suggestions for me
to get this going?
Thank you.
-Brian
<web-app>
...
<listener>
<listener-class>com.abcco.MyServletContextListener</listener-class>
</listener>
...
</web-app>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>