You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Brendan Miller <ca...@catphive.net> on 2014/05/08 02:45:18 UTC

running integration tests with maven

I currently have some testng integration tests in a maven project. This is
causing problems because the tests get picked up and run during the test
phase, rather than the integration-test phase.

How do I cause tests to be run in the integration test phase rather than
test? All of my tests in this particular module should be run during
integration-test.

I don't really see anything in my pom.xml that specifies phase. This is the
only test specific thing I'm seeing:

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
<scope>compile</scope>
</dependency>

That by itself seems to be running the  tests in my class BlahTest.java.
I'm guessing it automatically picks up anything matching Test.java?

Thanks,
Brendan

Re: running integration tests with maven

Posted by Glenn Brown <gh...@gmail.com>.
http://docs.codehaus.org/plugins/servlet/mobile#content/view/63286
 On May 15, 2014 10:14 PM, "Brendan Miller" <ca...@catphive.net> wrote:

> I currently have some testng integration tests in a maven project. This is
> causing problems because the tests get picked up and run during the test
> phase, rather than the integration-test phase.
>
> How do I cause tests to be run in the integration test phase rather than
> test? All of my tests in this particular module should be run during
> integration-test.
>
> I don't really see anything in my pom.xml that specifies phase. This is the
> only test specific thing I'm seeing:
>
> <dependency>
> <groupId>org.testng</groupId>
> <artifactId>testng</artifactId>
> <version>${testng.version}</version>
> <scope>compile</scope>
> </dependency>
>
> That by itself seems to be running the  tests in my class BlahTest.java.
> I'm guessing it automatically picks up anything matching Test.java?
>
> Thanks,
> Brendan
>

Re: running integration tests with maven

Posted by Anders Hammar <an...@hammar.net>.
You need to add/bind the maven-failsafe-plugin to your build:
http://maven.apache.org/surefire/maven-failsafe-plugin/usage.html

You also need to adapt the naming of your test files:
http://maven.apache.org/surefire/maven-failsafe-plugin/examples/inclusion-exclusion.html

/Anders


On Thu, May 8, 2014 at 2:45 AM, Brendan Miller <ca...@catphive.net>wrote:

> I currently have some testng integration tests in a maven project. This is
> causing problems because the tests get picked up and run during the test
> phase, rather than the integration-test phase.
>
> How do I cause tests to be run in the integration test phase rather than
> test? All of my tests in this particular module should be run during
> integration-test.
>
> I don't really see anything in my pom.xml that specifies phase. This is the
> only test specific thing I'm seeing:
>
> <dependency>
> <groupId>org.testng</groupId>
> <artifactId>testng</artifactId>
> <version>${testng.version}</version>
> <scope>compile</scope>
> </dependency>
>
> That by itself seems to be running the  tests in my class BlahTest.java.
> I'm guessing it automatically picks up anything matching Test.java?
>
> Thanks,
> Brendan
>