[
https://issues.apache.org/jira/browse/SUREFIRE-845?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tibor Digana closed SUREFIRE-845.
---------------------------------
Resolution: Not A Problem
Works fine:
The point is to run only 2 out of 7 tests in particular suite.xml.
InstallTest
ATest
PASSED: s
PASSED: s
===============================================
a-t1
Tests run: 2, Failures: 0, Skips: 0
===============================================
Results :
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
project configurations:
{code}
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
<configuration>
<suiteXmlFiles>
<file>src/test/resources/suite.xml</file>
</suiteXmlFiles>
<properties>
<property>
<name>testnames</name>
<value>a-t1</value>
</property>
</properties>
</configuration>
</plugin>
{code}
suite.xml:
{code}
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Component Tests" verbose="2" annotations="JDK">
<test name="a-t1" preserve-order="true" >
<classes>
<class name="server.InstallTest" />
<class name="server.ATest" />
</classes>
</test>
<test name="a-t2" preserve-order="true" >
<classes>
<class name="server.SCHTest" />
<class name="server.PRGTest" />
<class name="server.SIBBTest" />
<class name="server.EDNTest" />
<class name="server.PPVTest" />
</classes>
</test>
</suite>
TestNG:
{code}
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.8</version>
<scope>test</scope>
</dependency>
{code}
> Ability to specify TestNG test names in plugin configuration
> ------------------------------------------------------------
>
> Key: SUREFIRE-845
> URL: https://issues.apache.org/jira/browse/SUREFIRE-845
> Project: Maven Surefire
> Issue Type: New Feature
> Components: TestNG support
> Affects Versions: 2.12
> Reporter: Baron Roberts
> Assignee: Tibor Digana
>
> TestNG provides the capability on its command line to specify the name of
> tests to run when using a testng.xml suite file. This is very useful for
> selectively running tests while still using a testng.xml suite file. It would
> be a very useful feature to be able to specify the names of tests to run
> within the surefire plugin configuration. Something like:
> {noformat}
> <configuration>
> <suiteXmlFiles>
> <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
> </suiteXmlFiles>
> <testnames>regularTests,longTests</testnames>
> </configuration>
> {noformat}
> Which would correspond to the testng.xml file:
> {noformat}
> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
> <suite name="TestSuite" verbose="2">
> parameter name="saveBytes" value="false"/>
> <test name="regularTests">
> <groups>
> <run>
> <exclude name="foo"/>
> </run>
> </groups>
> <packages>
> <package name="com.mycompany.joe.*"/>
> </packages>
> </test>
> <test name="longTests">
> <packages>
> <package name="com.mycompany.joe.*"/>
> </packages>
> </test>
> </suite>
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)