struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stanl...@gmail.com
Subject BaseStrutsTestCase
Date Thu, 18 Jun 2009 19:53:46 GMT
For those of you who are using
this<http://depressedprogrammer.wordpress.com/2007/06/18/unit-testing-struts-2-actions-spring-junit/>base
class to unit test your Struts 2 apps, have you encountered this
requirement?

I have a web.xml listener placing an object in application scope using
servletContext.setAttribute(foo,engine) and an interceptor expecting to
locate it using actionInvocation.getStack().findValue("#attr.foo").

In my unit test which subclasses BaseStrutsTestCase I am putting the engine
in scope using proxy.getInvocation().getStack().set("foo", engine), however
my interceptor is finding a null when it attempts to fetch it from the
stack.  Is there something weird concerning the OgnlValueStack in this
context?

Peace,
Scott

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message