You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by David Siefert <si...@gmail.com> on 2008/02/21 18:26:47 UTC

running a single integration test during integration-test-phase

Hello,

Is there a way to configure a POM to run a single test during the
integration-test-phase via command line?

ie,

mvn verify -Dtest=MyIntegrationTest

That way I can do the necessary build work in pre-integration-test to
prepare to run the integration-test phase.

Thanks,

David

Re: running a single integration test during integration-test-phase

Posted by David Siefert <si...@gmail.com>.
2008/2/22 Jeff MAURY <je...@jeffmaury.com>:

> You need to configure the Maven surefire plugin in your POM and set the
> test
> configuration property for it.
>  Here is a sample:
>
> <project>
>  [...]
>  <build>
>    <plugins>
>      <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>        <artifactId>maven-surefire-plugin</artifactId>
>        <configuration>
>          <test>MyIntegrationTest</test>
>        </configuration>
>      </plugin>
>    </plugins>
>  </build>
>  [...]
> </project>
>
>
> Jeff
>
> On Thu, Feb 21, 2008 at 6:26 PM, David Siefert <
> siefert.david.mailinglist@gmail.com> wrote:
>
> > Hello,
> >
> > Is there a way to configure a POM to run a single test during the
> > integration-test-phase via command line?
> >
> > ie,
> >
> > mvn verify -Dtest=MyIntegrationTest
> >
> > That way I can do the necessary build work in pre-integration-test to
> > prepare to run the integration-test phase.
> >
> > Thanks,
> >
> > David
> >
>
>
>
> --
> La mélancolie c'est communiste
> Tout le monde y a droit de temps en temps
> La mélancolie n'est pas capitaliste
> C'est même gratuit pour les perdants
> La mélancolie c'est pacifiste
> On ne lui rentre jamais dedans
> La mélancolie oh tu sais ça existe
> Elle se prend même avec des gants
> La mélancolie c'est pour les syndicalistes
> Il faut juste sa carte de permanent
>
> Miossec (2006)
>
> http://www.jeffmaury.com
> http://riadiscuss.jeffmaury.com
>

 What system property do I use in <test>${???}</test> to get the test name
that was specified in the -Dtest parameter?

-David

Re: running a single integration test during integration-test-phase

Posted by Jeff MAURY <je...@jeffmaury.com>.
You need to configure the Maven surefire plugin in your POM and set the test
configuration property for it.
 Here is a sample:

<project>
  [...]
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <test>MyIntegrationTest</test>
        </configuration>
      </plugin>
    </plugins>
  </build>
  [...]
</project>


Jeff

On Thu, Feb 21, 2008 at 6:26 PM, David Siefert <
siefert.david.mailinglist@gmail.com> wrote:

> Hello,
>
> Is there a way to configure a POM to run a single test during the
> integration-test-phase via command line?
>
> ie,
>
> mvn verify -Dtest=MyIntegrationTest
>
> That way I can do the necessary build work in pre-integration-test to
> prepare to run the integration-test phase.
>
> Thanks,
>
> David
>



-- 
La mélancolie c'est communiste
Tout le monde y a droit de temps en temps
La mélancolie n'est pas capitaliste
C'est même gratuit pour les perdants
La mélancolie c'est pacifiste
On ne lui rentre jamais dedans
La mélancolie oh tu sais ça existe
Elle se prend même avec des gants
La mélancolie c'est pour les syndicalistes
Il faut juste sa carte de permanent

Miossec (2006)

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com

Re: running a single integration test during integration-test-phase

Posted by David Siefert <si...@gmail.com>.
On Thu, Feb 21, 2008 at 12:26 PM, David Siefert <
siefert.david.mailinglist@gmail.com> wrote:

> Hello,
>
> Is there a way to configure a POM to run a single test during the
> integration-test-phase via command line?
>
> ie,
>
> mvn verify -Dtest=MyIntegrationTest
>
> That way I can do the necessary build work in pre-integration-test to
> prepare to run the integration-test phase.
>
> Thanks,
>
> David
>

Ok, I am going to solve this myself. :)

While trying to solve another problem, I found out there is a property in
the maven-invoker-plugin that will let you run a single test.  Although I am
not using the maven-invoker-plugin to run the build (instead I am just
running the project directly at command line), the property still works.
Here it is:


mvn <phase> -Dinvoker.test=<classname>

-David