http://infinispan.blogspot.com/2009/06/executing-testng-tests-relying-on....
Max Rydahl Andersen wrote:
or in testng.xml or via your dataproviders as described in TestNG
docs:
http://testng.org/doc/documentation-main.html#parameters
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:
http://maven.apache.org/plugins/maven-surefire-plugin/examples/testng.html
"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:"
/max
Galder Zamarreno wrote:
> Actually, simply passing a system property worked!! I.e.
>
> -Dbasedir=/home/galder/tmp
>
> Galder Zamarreno wrote:
>> According to this message:
>>
http://markmail.org/message/n2gh4tjzzg5vozxy
>>
>> This is not doable :( but wanted to check whether anyone got it to work.
>>
>> Galder Zamarreno wrote:
>>> Hi,
>>>
>>> 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:
>>>
>>> @Parameters({"basedir"})
>>> 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.
>>>
>>> Cheers,
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache