Hello,
Im just trying to setup an
unit testing environment in the project im working atm.
I just evaluated the different approaches of mock objects and the idea behind
JUnit and the in-container approach of Cactus and i still have some questions about it...
If i want to test my DAO classes which retrieve information from a persistent environment (in this case DB) i use a datasource that i lookup through JNDI. JNDI however is a naming service provided by the container. One thing i want to avoid is to create mock objects for all the services, as this would result in lots of mock objects to maintain.
The in-container approach seems to be more logic to me. What do you guys think?
And how can i just test my DAO classes with the JNDI lookup with Cactus?