[ 
http://jira.codehaus.org/browse/SUREFIRE-377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=221986#action_221986
 ] 

James Kato edited comment on SUREFIRE-377 at 5/20/10 7:34 PM:
--------------------------------------------------------------

Aleksei's fix works well, but I just had to mess about with the default 
execution, so here is a variation using Aleksei's solution.

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.4.3</version>
        <configuration>           
                <testNGArtifactName>none:none</testNGArtifactName>   
                <excludes>
                        <exclude>**/integration/*.java</exclude>
                </excludes> 
        </configuration>
        <executions>
                <execution>
                        <id>integration-test</id>
                        <goals>
                                <goal>test</goal>
                        </goals>
                        <phase>integration-test</phase>
                        <configuration>
                                <junitArtifactName>none:none</junitArtifactName>
                                
<testNGArtifactName>org.testng:testng</testNGArtifactName>
                                <suiteXmlFiles>
                                        <suiteXmlFile>
                                           src/test/resourcestestng.xml
                                        </suiteXmlFile>
                                </suiteXmlFiles>
                                <excludes>
                                        <exclude>none</exclude>
                                </excludes>
                                <includes>
                                        <include>**/integration/*.java</include>
                                </includes>
                        </configuration>
                </execution>
        </executions>
</plugin>

      was (Author: kato):
    Aleksei's fix works well, but I just had to mess about with the default 
execution, so here is a variation using Aleksei's solution.

<code>
<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.4.3</version>
        <configuration>           
                <testNGArtifactName>none:none</testNGArtifactName>   
                <excludes>
                        <exclude>**/integration/*.java</exclude>
                </excludes> 
        </configuration>
        <executions>
                <execution>
                        <id>integration-test</id>
                        <goals>
                                <goal>test</goal>
                        </goals>
                        <phase>integration-test</phase>
                        <configuration>
                                <junitArtifactName>none:none</junitArtifactName>
                                
<testNGArtifactName>org.testng:testng</testNGArtifactName>
                                <suiteXmlFiles>
                                        <suiteXmlFile>
                                           src/test/resourcestestng.xml
                                        </suiteXmlFile>
                                </suiteXmlFiles>
                                <excludes>
                                        <exclude>none</exclude>
                                </excludes>
                                <includes>
                                        <include>**/integration/*.java</include>
                                </includes>
                        </configuration>
                </execution>
        </executions>
</plugin>
</code>
  
> When JUnit and TestNG tests are in same project, only one set gets run
> ----------------------------------------------------------------------
>
>                 Key: SUREFIRE-377
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-377
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: TestNG support
>    Affects Versions: 2.4
>            Reporter: Dan Fabulich
>             Fix For: 2.4
>
>         Attachments: surefire377.patch, testng-junit-together.zip
>
>
> The attached Maven project has two tests: one JUnit test and one TestNG test. 
>  According to the documentation, in this case TestNG should run both tests.
> Run "mvn test".  Only the TestNG test will run.  If you modify the pom to set 
> the property "junit=true", only the JUnit test will run.
> <plugin>
>   <groupId>org.apache.maven.plugins</groupId>
>   <artifactId>maven-surefire-plugin</artifactId>
>   <version>2.4-SNAPSHOT</version>
>   <configuration>
>     <properties>
>       <property>
>         <name>junit</name>
>         <value>true</value>
>       </property>
>     </properties>
> </plugin>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to