Author Login
Post Reply
I am using Spring to create Struts 2 actions and populate the dependent
objects. This works fine when I am running my application. I am using
Struts 2.0.11.
I want to unit test my Struts 2 actions in isolation by populating the
dependencies manually using JMock objects. It seems that Struts 2
insists on autowiring actions (either by name or by type) and loading
actions with unfulfilled dependencies in my unit tests causes a "Cannot
resolve reference to bean" error.
From looking at the Struts 2 code and documentation I can't see any way
to disable this behaviour. I have tried setting default-autowire="no" in
my Spring application context configs and autowire="no" for the
individual actions in the Spring file but these settings have no effect.
Is there any way to test Struts 2 actions in isolation by populating
dependencies using JMock objects, or am I stuck with Struts' insistence
on autowiring everything?
Cheers
Peter
_______________________________________________________________________
The information contained in this e-mail is confidential and may be privileged. It is intended for the addressee only. If you are not the intended recipient, please delete this e-mail immediately. The contents of this e-mail must not be disclosed or copied without the sender's consent. The statements and opinions expressed in this message are those of the author and do not necessarily reflect those of the company. The company does not take any responsibility for the views of the author.
Registered Office: IT-Freedom Limited, 9 Minster Court, Tuscam Way, Camberley, Surrey GU15 3YY
Registered in England, Number: 04500346
_______________________________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)