I am toying a bit with Spring testing framework, but I have one problem. Normally when application is deployed on Tomcat we have
<Resource
name="jdbc/sqliteDS"
auth="Container"
type="javax.sql.DataSource"
maxActive="4"
maxIdle="2"
username="x"
maxWait="5000"
driverClassName="org.sqlite.JDBC"
password="x"
url="jdbc:sqlite:/home/xxx/db.sqlite"/>
</Context>
in Tomcat context.xml,
<resource-ref>
<description>sqlite DataSource</description>
<res-ref-name>jdbc/sqliteDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
in web.xml and
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:/comp/env/jdbc/sqliteDS" />
</bean>
in data-context.xml for getting data source, but how can I emulate JNDI resource for Spring test framework, because now during the initialization I am getting errors that data source is not found, and he is right.
Also, it would be great if one can do that without writing another .xml file.