TestNG with test libraries

David DeHaven david.dehaven at oracle.com
Mon Jun 27 21:54:21 UTC 2016

>> We have a directory marked as TestNG tests but some helper classes outside that directory that we would like to use. Since TestNG tests don't use the @test (or can they?) is there a way to tell jtreg/testng to add the library to the classpath when building/running?
>> -DrD-
> Are you using the TEST.properties mechanism to declare a directory full of just TestNG tests?
> Assuming you are following the convention to put a TEST.proiperties file in the root dir of your TestNG hierarchy, with an entry like
>    TestNG.dirs = .
> add another property
>    lib.dirs = <path>
> where <path> is what you might otherwise put in a @library tag, i.e.  a path that does not begin with '/', which with be evaluated relative to the immediately enclosing directory, or a path that does begin with '/', which will be evaluated relative to the root directory of the test suite (i.e. the directory containing the TEST.ROOT file).

Oh, right, I didn't think of that. We're using TEST.properties to set up the addReads arguments...


More information about the jtreg-use mailing list