I want to change the ObjectFactory to use for unit testing so (I think) I need 
to be able to override struts.xml config settings.

I'm writing some code to unit test actions with the Interceptor stack.
I followed the links off the Guides page under "Unit Testing (TODO)'... these 
gave me some hints on how to proceed but since they both use Spring (and I 
don't) I could not get either to work.

Anyway... I was able to get a Dispatcher built using a mock ServletContext (not 
Spring's) and I was able to use it to create an ActionProxy.  So I feel I'm 
getting close.
(If anyone knows a better way or where better instructions on how to do this 
are please let me know.)

I'm using Guice for an ObjectFactory, declared using constants in the 
struts.xml file. 

I need to be able to change the ObjectFactory for unit testing. Either turn off 
Guice so the default is used (and I will inject objects after I get the proxy) 
or be able to specify an alternate config (Guice module) for testing. 

How can I override the settings in struts.xml for unit testing when creating 
the Dispatcher ?

Or, if there is a better way any advice would help.

Thanks.





      

Reply via email to