How to configure TestNG?

Jonathan Gibbons jonathan.gibbons at oracle.com
Thu Sep 11 17:18:45 UTC 2014


On 08/27/2014 12:27 AM, Alex Schenkman wrote:
> Thanks for your answer Mike.
> The point is not the verbose flag in itself, that was just an example.
>
> The use case for passing arguments to TestNG is to being able to fully 
> utilise what TestNG offers:
>     1) specify my own implementation of ITestListener, for logging 
> test life cycle (started, passed, failed)
>     2) specify my own IReporter, for getting the console output of 
> each test, with timestamps.
>     3) specify at very detailed level what tests I want to run, and how.
>
> Yes, I think we should improve further the JTreg/TestNG integration.

Alex,

It is not a goal of the JTreg/TestNG integration to provide support for 
all TestNG features.
There are enough discrepancies between the two systems for this to be 
impractical
to the point of impossibility.

The goal of the integration is to provide "good enough" support for a 
"good enough"
set of the features, so that folk can write "good enough" tests in 
TestNG and have them
be run with jtreg.  Yes, we can discuss the definition of "good enough" 
but there are
some inherent architectural limitations imposed by jtreg.

If you want the full feature set of TestNG, use TestNG.  Depending on 
how/where you
are writing tests, that may be an option. But if you are writing tests 
for OpenJDK
or for use within the existing Oracle infrastructure for building and 
running tests,
you would be faced with the task of extending that infrastructure to "go 
it alone"
with TestNG.

There is a possible interim position.   It is intended that it should be 
easy to develop
TestNG tests within an IDE.  So, while you are developing and debugging 
a test
you may be able to use more of the fancy features, and then remove them when
you have a working test that can be integrated into one of the OpenJDK 
test suites.

-- Jon


More information about the jtreg-use mailing list