You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Josephson, William (APG)" <Wi...@cengage.com> on 2009/06/25 21:23:22 UTC

Order of Execution For Classes Included In A Surefire Plugin Execution

I am using Maven 2.1.0, and the surefire plugin to run integration tests.

I have the following execution element within my pom:

                    <execution>
                        <id>first</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <includes>
                                <include>**\SAM.java</include>
                                <include>**\QA3.java</include>
                                <include>**\cleanupQA3.java</include>
                            </includes>
                            <skip>false</skip>
                        </configuration>
                    </execution>

I would expect that the tests within class SAM would be executed first, followed by the tests in class QA3 etc.

But instead the tests in class QA3 are performed first.

Shouldn't the tests be performed at least in the order that the classes are declared?

Thanks,

Bill Josephson
Cengage Learning


RE: Order of Execution For Classes Included In A Surefire Plugin Execution

Posted by "Josephson, William (APG)" <Wi...@cengage.com>.

Thanks

I am attempting to avoid any additional Java coding, though a Java test-suite file is fairly simple code and easy to maintain.

I think you are right that surefire runs the test classes in the order it finds them.  In fact failsafe runs the classes in the same order as surefire, not surprising since the failsafe code is a branch off of surefire.

I am puzzled on how surefire/failsafe finds the files to test.  I am running Windows XP and a directory listing from a cmd window shows

06/26/2009  10:15 AM             7,481 cleanupQA3.java
06/24/2009  03:41 PM            35,593 QA3.java
06/24/2009  03:32 PM             8,761 SAM.java

However both surefire and failsafe run the test classes in this order: QA3, cleanupQA3, SAM.  That order is not by date, filename or size
 
Bill Josephson
Cengage Learning

-----Original Message-----
From: Stephen Connolly [mailto:stephen.alan.connolly@gmail.com] 
Sent: Friday, June 26, 2009 1:23 AM
To: Maven Users List
Subject: Re: Order of Execution For Classes Included In A Surefire Plugin Execution

A couple of points:

1. Have you considered using failsafe-maven-plugin to run your
integration tests? That way you can set up your integration test env
using pre-integration-test phase, tear it down in
post-integration-test phase and then check the results in the verify
phase... it might simplify your surefire plugin config as well.

2. I think the philosophy of surefire is that it will run test classes
in the order that it finds them.  If you need to run test classes in a
specific order, you need to create a test suite.

-Stephen

2009/6/25 Josephson, William (APG) <Wi...@cengage.com>:
> I am using Maven 2.1.0, and the surefire plugin to run integration tests.
>
> I have the following execution element within my pom:
>
>                    <execution>
>                        <id>first</id>
>                        <phase>integration-test</phase>
>                        <goals>
>                            <goal>test</goal>
>                        </goals>
>                        <configuration>
>                            <includes>
>                                <include>**\SAM.java</include>
>                                <include>**\QA3.java</include>
>                                <include>**\cleanupQA3.java</include>
>                            </includes>
>                            <skip>false</skip>
>                        </configuration>
>                    </execution>
>
> I would expect that the tests within class SAM would be executed first, followed by the tests in class QA3 etc.
>
> But instead the tests in class QA3 are performed first.
>
> Shouldn't the tests be performed at least in the order that the classes are declared?
>
> Thanks,
>
> Bill Josephson
> Cengage Learning
>
>

---------------------------------------------------------------------
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: Order of Execution For Classes Included In A Surefire Plugin Execution

Posted by Stephen Connolly <st...@gmail.com>.
A couple of points:

1. Have you considered using failsafe-maven-plugin to run your
integration tests? That way you can set up your integration test env
using pre-integration-test phase, tear it down in
post-integration-test phase and then check the results in the verify
phase... it might simplify your surefire plugin config as well.

2. I think the philosophy of surefire is that it will run test classes
in the order that it finds them.  If you need to run test classes in a
specific order, you need to create a test suite.

-Stephen

2009/6/25 Josephson, William (APG) <Wi...@cengage.com>:
> I am using Maven 2.1.0, and the surefire plugin to run integration tests.
>
> I have the following execution element within my pom:
>
>                    <execution>
>                        <id>first</id>
>                        <phase>integration-test</phase>
>                        <goals>
>                            <goal>test</goal>
>                        </goals>
>                        <configuration>
>                            <includes>
>                                <include>**\SAM.java</include>
>                                <include>**\QA3.java</include>
>                                <include>**\cleanupQA3.java</include>
>                            </includes>
>                            <skip>false</skip>
>                        </configuration>
>                    </execution>
>
> I would expect that the tests within class SAM would be executed first, followed by the tests in class QA3 etc.
>
> But instead the tests in class QA3 are performed first.
>
> Shouldn't the tests be performed at least in the order that the classes are declared?
>
> Thanks,
>
> Bill Josephson
> Cengage Learning
>
>

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