<dependency>
<groupId>simple-jndi</groupId>
<artifactId>simple-jndi</artifactId>
<version>0.11.1</version>
<scope>test</scope>
</dependency>
src/test/resources.
The file jndi.properties contains the following lines. The properties org.osjava.sj.colon.replace and org.osjava.sj.delimiter are used in this example because the application being tested will run on Tomcat on Windows.
java.naming.factory.initial=org.osjava.sj.SimpleContextFactory org.osjava.sj.root=src/test/resources/simple-jndi org.osjava.sj.colon.replace=-- org.osjava.sj.delimiter=/
/java--comp
/env
default.properties
default.properties contains the following:
myDataSource/type=javax.sql.DataSource myDataSource/driver=<jdbc driver class> myDataSource/url=<jdbc url> myDataSource/user=foo myDataSource/password=bar