I'm working on making my Struts and Spring application more testable. As part of that, I've seperated the Spring configuration dealing with each layer of my application into separate files. So, one for the web stuff (Struts action classes, etc), one for a service layer and one for a DAO layer. When I'm testing the struts action classes (with StrutsTestCase), I want to configure Spring to give me an action class with the dependencies null. I need to keep Spring in the mix (although I'd rather not) because of the way I'm integrating Spring and Struts. See http://www-128.ibm.com/developerworks/java/library/j-sr2.html Option #3 for a description of my approach. I know I could put the null in place if I kept a seperate instance of my web config file and used a <null> attribute. However, I don't want to do that. I'd rather replace my regular service config file with a testing one. Maybe I can illustrate:
Here's a snippet from ApplicationContext-web.xml:
Here's the ApplicationContext-service-test.xml:
Normally trees don't drive trucks. Does this tiny ad have a license?