I have a class A.java and two test classes, ATest.java and AITests.java. The ITest is for integration. The tests must be performed as:
-
When no Maven profile is selected only the Atest must be tested.
-
When the itests profile is activated the both tests (ATest and AITest) must be tested.
The problems is, when I use the command
mvn -P itests test
then only the ATest is tested, without the AITest. But I have no idea what I am missing here. Any hint?
My pom.xml is:
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version>
<configuration>
<excludes>
<exclude>**/*ITest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>itests</id>
<activation>
<property>
<name>itests</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version>
<configuration>
<includes>
<include>**/*Test.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
...
Aucun commentaire:
Enregistrer un commentaire