Is there a reason why you dont want to use the hostname/server from the
supplied connection string ?
Both MySQL url="jdbc:mysql:127.0.0.1:3306/jsi
and oracle
SERVICE_NAME =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST=127.0.0.1)(PORT=1521))
)
(CONNECT_DATA =
(SERVICE_NAME=SERVICE_NAME)
)
)
have server or host attributes configured in the Connection String which
will work with their TypeIV drivers?
M-
----- Original Message -----
From: "Marco Mistroni" <[EMAIL PROTECTED]>
To: "Maven Users List" <[email protected]>
Sent: Sunday, February 17, 2008 12:48 PM
Subject: Re: Maven2 Unit testing
> 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]
> >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]