Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Spring and plugging in null implementations

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 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:

Any ideas?

Normally trees don't drive trucks. Does this tiny ad have a license?
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic