You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Sidharth Kuruvila <si...@gmail.com> on 2007/06/07 13:28:40 UTC
maven2: How do I run pre and post test initialization and cleanup scripts
I have a few scripts that I would like to run before the unittests.
These are currently shell scripts but I plan on converting them into
jython scripts. How do i set things up so that maven executes them?
Is there general practice for setting up the environment for running
tests.?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: maven2: How do I run pre and post test initialization and cleanup
scripts
Posted by Kenney Westerhof <ke...@apache.org>.
Sidharth Kuruvila wrote:
> I have a few scripts that I would like to run before the unittests.
> These are currently shell scripts but I plan on converting them into
> jython scripts. How do i set things up so that maven executes them?
>
> Is there general practice for setting up the environment for running
> tests.?
Several things can be done, depending on the type of tests.
Normally the env is set up in the unit tests themselves, by using a testsuite,
as maven doesn't have any pre/post test phases. That's fine, because when people
run 'mvn test', there's no phase after test run to tear down the env.
When your scripts just generate files, you can call them in the prepare-test-(re)sources
phase or any *-test-* phase before test itself.
If you're starting up databases or similar, this is more like an integration test.
we're still working on a solid solution for integration testing though, so I cannot give
you the best practise (though you could use maven-it-plugin, but that's still in the sandbox
and requires maven 2.1-snapshot).
So I think you're best of calling those scripts in the unit tests themselves for the time being.
-- Kenney
>
> ---------------------------------------------------------------------
> 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