You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by diroussel <na...@diroussel.xsmail.com> on 2006/11/15 13:58:39 UTC

Re: excluding/including tests in surefire-plugin in different phases

Jan, did you find a solution to this?  It looks to me that the exclude
feature doesn't work, which is why others seem to be using more elaborate
techniques to getting integration tests working (separate module, or using
profiles).

I found this comment in SurefirePlugin.java (maven-surefire-plugin-2.2)
 // Have to wrap in an ArrayList as surefire expects an ArrayList instead of
a List for some reason

This wrapping is only done for the detaul includes and excludes, but not for
user supplied values.  Note sure how the excludes setter is called, all this
mojo stuff is just magic to me.

Here is my config, which doesn't exlcude either:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <forkMode>once</forkMode>
            <property>
              <name>java.util.prefs.PreferencesFactory</name>
             
<value>com.euroclear.framework.config.EuroclearPreferencesFactory</value>
            </property>
        </configuration>
        <executions>
          <execution>
            <id>unit-test</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>false</skip>
              <includes>
                <include>**/Test*.java</include>
                <include>**/*Test.java</include>
                <include>**/*TestCase.java</include>
              </includes>
              <excludes>
                <exclude>**/*IntTest.java</exclude>
              </excludes>
            </configuration>
          </execution>
          <execution>
            <id>int-test</id>
            <phase>integration-test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>false</skip>
              <includes>
                <include>**/*IntTest.java</include>
              </includes>
              <excludes>
                <exclude>**/Test*.java</exclude>
                <exclude>**/*Test.java</exclude>
                <exclude>**/*TestCase.java</exclude>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
-- 
View this message in context: http://www.nabble.com/excluding-including-tests-in-surefire-plugin-in-different-phases-tf2534887s177.html#a7357185
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: excluding/including tests in surefire-plugin in different phases

Posted by Yann Le Du <le...@gmail.com>.
diroussel,

Try adding <skip>true</skip> in <plugin><configuration> (not in <execution>)
and please let me know if it works.

I too experienced this behaviour and found it pretty strange.

- Yann

2006/11/15, diroussel <na...@diroussel.xsmail.com>:
>
>
> Jan, did you find a solution to this?  It looks to me that the exclude
> feature doesn't work, which is why others seem to be using more elaborate
> techniques to getting integration tests working (separate module, or using
> profiles).
>
> I found this comment in SurefirePlugin.java (maven-surefire-plugin-2.2)
> // Have to wrap in an ArrayList as surefire expects an ArrayList instead
> of
> a List for some reason
>
> This wrapping is only done for the detaul includes and excludes, but not
> for
> user supplied values.  Note sure how the excludes setter is called, all
> this
> mojo stuff is just magic to me.
>
> Here is my config, which doesn't exlcude either:
>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-surefire-plugin</artifactId>
>         <configuration>
>           <forkMode>once</forkMode>
>             <property>
>               <name>java.util.prefs.PreferencesFactory</name>
>
> <value>com.euroclear.framework.config.EuroclearPreferencesFactory</value>
>             </property>
>         </configuration>
>         <executions>
>           <execution>
>             <id>unit-test</id>
>             <phase>test</phase>
>             <goals>
>               <goal>test</goal>
>             </goals>
>             <configuration>
>               <skip>false</skip>
>               <includes>
>                 <include>**/Test*.java</include>
>                 <include>**/*Test.java</include>
>                 <include>**/*TestCase.java</include>
>               </includes>
>               <excludes>
>                 <exclude>**/*IntTest.java</exclude>
>               </excludes>
>             </configuration>
>           </execution>
>           <execution>
>             <id>int-test</id>
>             <phase>integration-test</phase>
>             <goals>
>               <goal>test</goal>
>             </goals>
>             <configuration>
>               <skip>false</skip>
>               <includes>
>                 <include>**/*IntTest.java</include>
>               </includes>
>               <excludes>
>                 <exclude>**/Test*.java</exclude>
>                 <exclude>**/*Test.java</exclude>
>                 <exclude>**/*TestCase.java</exclude>
>               </excludes>
>             </configuration>
>           </execution>
>         </executions>
>       </plugin>
> --
> View this message in context:
> http://www.nabble.com/excluding-including-tests-in-surefire-plugin-in-different-phases-tf2534887s177.html#a7357185
> 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
>
>