Hello, i guess you are meaning then 'integration test', as unit tests should not access the database.... for that... well 2 solutions...
@work, we are using jndi via tomcat, but for unit tests we define our own dataSource that uses Spring's DriverManagerDatasource (or something like that) that connects to a dev db @home, i m doing similar, but for tests instead of connecting to a dev db, i create my own in memory database via hsql (tables get created via hibernate.ddl.auto=create) hth marco On Feb 17, 2008 5:08 PM, Wendy Smoak <[EMAIL PROTECTED]> wrote: > On Feb 17, 2008 9:00 AM, Filipe David Manana <[EMAIL PROTECTED]> wrote: > > > I am using Maven 2 as the build tool for my project. > > My application uses a DataSource provided by Tomcat. Is it possible to > write > > unit tests that use this datasource? > > By the way, Tomcat runs on a remote machine, available in a computing > center > > and without X11. > > > > I accept suggestions. > > What are you really trying to test? If you're interested in unit > testing the code you're writing, then you might want to mock the data > source and not worry about connecting to the real one. I always go > back to "JUnit in Action" for this kind of thing. :) > > Or are you more interested in running in-container tests that use a > real database? > > -- > Wendy > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
