Regarding TestNG test case with @run tag.
Jonathan Gibbons
jonathan.gibbons at oracle.com
Mon Oct 3 16:55:46 UTC 2016
On 10/03/2016 03:10 AM, Rachna Goel wrote:
> Hi,
>
> I am working on a fix in which TestNG test case, is to be added at
> /test/java/time/test/java/time.
>
> I have to specify system property for this fix as :
>
> @run testng/othervm -Djava.locale.providers=JRE
> TestNarrowMonthNamesAndDayNames
>
> However, upon executing with jtreg this test gives me following error.
>
> "error=Explicit action tag not allowed"
>
> One obvious reason to me for this error is :
>
> There is TEST.properties file /test/java/time which has set "
> TestNG.dirs = . ". Having the TEST.properties set TestNG.dirs causes
> it to ignore or error if an individual test includes @run, so we can
> not have any testcase specifying jtreg action tags such as @run,
> @compile in current dir.
Yes, this is the specified behavior.
>
> To confirm cause, I added same test case to
> test/sun/util/resources/TimeZone which makes it pass successfully.
>
> please suggest on how to override default behavior of TEST.properties
> file /test/java/time.
> or is there any other way I could add this test to mentioned path.
> PFA test case for your kind reference.
You cannot override the behavior within a directory specified by
TestNG.dirs. To give a test specific properties, you need to place it
outside any such directory.
>
> Thanks,
> Rachna
>
>
>
More information about the code-tools-dev
mailing list