You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Craig McDaniel <cp...@gmail.com> on 2005/08/23 23:16:23 UTC

m1: changing database config for testing

I have integration tests that use DBUnit for testing our persistence
layer. If a developer runs the tests, I want it to execute against a
certain database (we'll call it "dev"). We also have a continuous
integration build server that we also want to run these tests, but
this time against a separate database (called "test"). As it is, we
have potential for developers to step on each others' toes. We want to
prevent this from causing the automated build to fail.

How can I vary the database config that is used based on where it is
being run. I am already calling a custom maven goal for the automated
build. I should be able to do something there, but I'm looking for
good ideas (ie, best practice).

-- 
Craig McDaniel

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: m1: changing database config for testing

Posted by Brett Porter <br...@gmail.com>.
You can set an env property in the home directory of the user doing
it, or if all you need is the username and host name, you can use
${user.name} and invoke InetAddress to get the hostname. That would
mean putting that knowledge in the build script which might not be as
useful as just setting the environment from ~/build.properties.

- Brett

On 8/24/05, Craig McDaniel <cp...@gmail.com> wrote:
> I have integration tests that use DBUnit for testing our persistence
> layer. If a developer runs the tests, I want it to execute against a
> certain database (we'll call it "dev"). We also have a continuous
> integration build server that we also want to run these tests, but
> this time against a separate database (called "test"). As it is, we
> have potential for developers to step on each others' toes. We want to
> prevent this from causing the automated build to fail.
> 
> How can I vary the database config that is used based on where it is
> being run. I am already calling a custom maven goal for the automated
> build. I should be able to do something there, but I'm looking for
> good ideas (ie, best practice).
> 
> --
> Craig McDaniel
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org