ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hugo Palma <hpa...@digitalis.pt>
Subject Can't test DAO
Date Thu, 06 Jan 2005 11:02:57 GMT
I'm using Spring with iBATIS SqlMap.
I'm trying to test my DAOs with junit and easyMock.
All my DAOs extend 
org.springframework.orm.ibatis.support.SqlMapClientDaoSupport, as such, 
for doing a database operation i invoke method 
What seemed like an obvious way to test the DAO was to create a mock of 
the sqlMapClientTemplate object(using easyMock) so that i could 
configure it's behaviour. But then the problems started. First i 
couldn't get the DAO instance from the spring application context 
without defining the "dataSource" and "configLocation" properties which 
i shouldn't have to define for the test because i'll be using a mock 
template anyway. I defined the properties anyway but then i came to a 
full stop as i realized that class 
org.springframework.orm.ibatis.SqlMapClientTemplate is in fact not an 
interface, this makes it impossible for easyMock to generate a mock 
object for it.

So my question is, is there any easy way i can this tests ?
If you think this is more a spring list question please tell me.



View raw message