Hi All,
As one of eXtreme programming fans, i always try to test my applications. And this comes no difference with hibernate.
Just a while ago i found out that when I run my junit test, hibernate will tries to read from the datasource that I use for my Resin web server.
But unfortunately a data source cannot be run outside a webserver, and thus threw me : "unable to find data source" error.
So my approach in testing is that I will use a DAO that will return me connection from 2 different source. WHen i run my application using REsin my DAO will return me a connection from the datasource and if i am not using Resin e.g. JUnit, it will give me connection through the old good fashioned :
Code:
DriverManager.getConnection("jdbc:postgresql://localhost/blah",
"username", "password");
But I am wondering whether there is an easier way to test Hibernate witohut using these approach.
Regards,
-e-null-