I have the following dataSource defined in my spring-beans.xml file which I use in order to connect in my remote database :
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/sample"/>
<property name="username" value="root"/>
<property name="password" value="root"/>
</bean>
I am building a couple of jUnit integration tests that I want to run. Some of the functions that get called from these tests use this datasource in order to access my database. When I deploy my project the dataSource is injected according to beans configuration that I have done.
For these tests that will run independently of the web application how can I inject this dataSource in order to access the database ?
I use the SpringFramework 2.5.6 version and jUnit4 for my tests.