[Prev] Thread [Next]  |  [Prev] Date [Next]

[jboss-dev] Re: [jbosstools-dev] Re: Pass @Parameter value to a TestNG test from Eclipse? Galder Zamarreno Thu Jun 18 08:00:27 2009


Max Rydahl Andersen wrote:
or in testng.xml or via your dataproviders as described in TestNG docs:


Yeah, but you're not gonna start configuring a file to run a test from an IDE! That'd be a PITA

Funny enough the system properties trick does not seem to be documented ;)

Indeed, I couldn't find the trick anywhere. The clue came from:

"Your TestNG test can accept parameters with the @Parameters annotation. You can also pass parameters from Maven into your TestNG test, by specifying them as system properties, like this:"


Galder Zamarreno wrote:
Actually, simply passing a system property worked!! I.e.


Galder Zamarreno wrote:
According to this message:

This is not doable :( but wanted to check whether anyone got it to work.

Galder Zamarreno wrote:

I've got a question regarding TestNG and Eclipse. Does anyone know how to pass the value of a @Parameter to a test from Eclipse? I've got a test that has:

protected void setUpTempDir(String basedir) {

But I can't execute it from Eclipse cos it didn't get the basedir parameter. So, I was wondering if there's any way to pass such parameter from Eclipse.


Galder ZamarreƱo
Sr. Software Engineer
Infinispan, JBoss Cache
jboss-development mailing list