You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "wujek.srujek" <wu...@gmail.com> on 2009/12/16 16:25:28 UTC
[surefire, TestNG] Specify a suite / xml file on command line
Hi.
Is it possible to specify which particular test suite xml file I want to be
used when I invoke mvn test and the tests are using TestNG as the framework?
I have a few suites, and some of them are only valid on the development
server with hudson, and it connects to its local db and so on. I would like
to skip this test suite.
Regards.
--
View this message in context: http://old.nabble.com/-surefire%2C-TestNG--Specify-a-suite---xml-file-on-command-line-tp26812853p26812853.html
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: [surefire, TestNG] Specify a suite / xml file on command line
Posted by "wujek.srujek" <wu...@gmail.com>.
Hi, I noticed this question I posted some time ago and as it doesn't have any
answers and I found a way to do it, I thought I would post it for others:
suppose you have TestNG suite files: all.xml, hsql.xml, oracle.xml
and by default (for example in Hudson) you want all.xml suites to be run,
but locally you want to test only against hsql for a quick test. Define a
setting like this in your pom:
<properties>
<tests>all</tests>
</properties>
and in surefires config include something similar:
<suiteXmlFiles>
<suiteXmlFile>${project.build.testOutputDirectory}/${tests}.xml</suiteXmlFile>
</suiteXmlFiles>
Now, by default all.xml will be run, but it can be overridden on the command
line like this:
mvn -Dtests=hsql test
wujek.srujek wrote:
>
> Hi.
> Is it possible to specify which particular test suite xml file I want to
> be used when I invoke mvn test and the tests are using TestNG as the
> framework? I have a few suites, and some of them are only valid on the
> development server with hudson, and it connects to its local db and so on.
> I would like to skip this test suite.
> Regards.
>
--
View this message in context: http://old.nabble.com/-surefire%2C-TestNG--Specify-a-suite---xml-file-on-command-line-tp26812853p27999961.html
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