jtreg FAQ updates

Jonathan Gibbons jonathan.gibbons at oracle.com
Thu Aug 16 16:01:00 UTC 2018



On 8/16/18 8:18 AM, Martin Buchholz wrote:
>
>
> On Thu, Aug 16, 2018 at 4:30 AM, Chris Hegarty 
> <chris.hegarty at oracle.com <mailto:chris.hegarty at oracle.com>> wrote:
>
>     Jon,
>
>     Thanks for this. A question on testng.
>
>     > On 16 Aug 2018, at 00:46, Jonathan Gibbons
>     <jonathan.gibbons at oracle.com <mailto:jonathan.gibbons at oracle.com>>
>     wrote:
>     > ...
>     > 5.6  Can I put more than one test in a file?
>
>     I think that you can put several jtreg-invoked testng tests in a
>     single
>     file. 
>
The ability to put more than one test in a file is independent of the 
actions of the test.
It's always been undocumented but possible to put multiple tests in a 
file; it was
undocumented (until a while back) because the ability to name the 
individual tests
was imperfect.

>     At least it works for me. For example:
>
>        /*
>         * @test
>         * @run testng/othervm Test
>         */
>        /*
>         * @test
>         * @run testng/othervm Test
>         */
>
>       , but it is not all that useful.
>
I agree that putting multiple tests with the same set of actions is not 
useful. You would normally want to
have different actions in the individual tests, such as with different 
arguments in some manner.
>
> I was confused by this as well, but for junit.  The existing 
> JSR166TestCase successfully and usefully defines multiple @run junit 
> tests.
Yes, JSR166TestCase provides a number of different tests in that one 
source file.
>
> I think the confusion has to do with """jtreg supports TestNG tests in 
> two ways."""
I'm confused by your confusion. Can you say more, so that I can try and 
improve the text in this area?

-- Jon



More information about the jdk-dev mailing list