You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by lightbulb432 <ve...@hotmail.com> on 2007/11/30 19:57:56 UTC

Conditionally use includes and excludes for tests

I have unit tests and integration tests in /src/test/java (e.g.
Class1UnitTest.java and Class1IntegrationTest.java), and I'd like to have
<includes> and <excludes> cause only unit tests to run during the
development profile, but to cause the unit and integration tests to run
during the integration-testing profile. How can I do this?

Thanks.
-- 
View this message in context: http://www.nabble.com/Conditionally-use-includes-and-excludes-for-tests-tf4923208s177.html#a14088990
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Conditionally use includes and excludes for tests

Posted by Wayne Fay <wa...@gmail.com>.
This Wiki page lists some options for using Maven with Integration Testing:
http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testing

Wayne

On 11/30/07, lightbulb432 <ve...@hotmail.com> wrote:
>
> I have unit tests and integration tests in /src/test/java (e.g.
> Class1UnitTest.java and Class1IntegrationTest.java), and I'd like to have
> <includes> and <excludes> cause only unit tests to run during the
> development profile, but to cause the unit and integration tests to run
> during the integration-testing profile. How can I do this?
>
> Thanks.
> --
> View this message in context: http://www.nabble.com/Conditionally-use-includes-and-excludes-for-tests-tf4923208s177.html#a14088990
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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


Re: Conditionally use includes and excludes for tests

Posted by Kalle Korhonen <ka...@gmail.com>.
<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <executions>
                <execution>
                <id>surefire-it</id>
                <phase>integration-test</phase>
                <configuration>
                        <includes>
                        <include>**/*IntegrationTest.java</include>
                        </includes>
                </configuration>
                <goals>
                        <goal>test</goal>
                </goals>
                </execution>
        </executions>
        <configuration>
                <includes>
                        <include>**/*UnitTest.java</include>
                </includes>
        </configuration>
</plugin>


(An *unmodified* configuration of what I'm using in one project)

Kalle


On Nov 30, 2007 10:57 AM, lightbulb432 <ve...@hotmail.com> wrote:

>
> I have unit tests and integration tests in /src/test/java (e.g.
> Class1UnitTest.java and Class1IntegrationTest.java), and I'd like to have
> <includes> and <excludes> cause only unit tests to run during the
> development profile, but to cause the unit and integration tests to run
> during the integration-testing profile. How can I do this?
>
> Thanks.
> --
> View this message in context:
> http://www.nabble.com/Conditionally-use-includes-and-excludes-for-tests-tf4923208s177.html#a14088990
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>