Issue Details (XML | Word | Printable)

Key: SUREFIRE-7
Type: Improvement Improvement
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Jason van Zyl
Reporter: larry
Votes: 2
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Maven Surefire

Targets for unit, integration and functional tests

Created: 18/Oct/05 04:21 AM   Updated: 24/Mar/06 05:23 PM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.5.3 (2.1.3 plugin)

Time Tracking:
Not Specified

Environment: All platforms, Maven 2 beta 3

Complexity: Intermediate


 Description  « Hide
I could not find this functionality by reading the current documentation. I think it would be a good idea to have the following targets added to m2 and the surefire plugin:

test:unit
test:integration
test:functional

Currently I don't know how to separate these tests with Maven 2 beta 3. It is a good idea to separate the tests into different groups. Fast running and simple tests should be run when executing the test:unit target. Longer running should not be executed at every build just before deploy.

Surefire could look for the tests in a default location. For example something like:
src/main/test/java/**/unit/*Test.java
src/main/test/java/**/integration/*Test.java
src/main/test/java/**/functional/*Test.java

These paths could also be specified in the pom.xml.

Another possibility would be the possibility of defining your own groups in the pom. And execute them with for example m2 test:group unit.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
larry added a comment - 19/Oct/05 05:16 AM
I was able to do what I wanted by adding the following to the build section of pom.xml. It would be more than nice though to have it by default.

<profiles>
<profile>
<id>unit-tests</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/unit/*Test.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>integration-tests</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/integration/*Test.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>functional-tests</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/functional/*Test.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>


Jason van Zyl added a comment - 27/Feb/06 07:07 PM
This will be supported by maven's standard build lifecycle and not something to put in surefire itself. Surefire simply runs tests, it doesn't care what flavour.