Skip to content

Conversation

@marcphilipp
Copy link
Member

The new testng.listeners configuration parameter now allows to
register custom listeners as a comma-separated list of fully-qualified
class names.

Fixes #5.

@marcphilipp marcphilipp self-assigned this Jul 9, 2021
The new `testng.listeners` configuration parameter now allows to
register custom listeners as a comma-separated list of fully-qualified
class names.

Fixes #5.
@marcphilipp marcphilipp force-pushed the marc/5-custom-listeners branch from 18d9ad1 to fb1a111 Compare July 9, 2021 15:14
@marcphilipp marcphilipp merged commit 23603e6 into main Jul 9, 2021
@marcphilipp marcphilipp deleted the marc/5-custom-listeners branch July 9, 2021 15:21
whether TestNG's default report generating listeners should be used (default: `false`)
+
`testng.listeners` (comma-separated list of fully-qualified class names)::
custom listeners that should be registered when executing tests (default: none)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
custom listeners that should be registered when executing tests (default: none)
custom listeners that should be registered when executing tests (default: "")

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #9.

custom listeners that should be registered when executing tests (default: none)
+
`testng.verbose` (integer)::
TestNG's level of verbosity (default: 0)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TestNG's level of verbosity (default: 0)
TestNG's level of verbosity (default: `0`)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #9.

testNG.setUseDefaultListeners(config.getBoolean("testng.useDefaultListeners").orElse(false));
config.get("testng.outputDirectory").ifPresent(testNG::setOutputDirectory);
config.get("testng.listeners").ifPresent(listeners -> Arrays.stream(listeners.split(",")) //
.map(ReflectionSupport::tryToLoadClass) //
Copy link

@l0rinc l0rinc Jul 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #9, I've delegating the parsing of the parameter to TestNG so I don't think we have to test these cases anymore as it now behaves consistently with how TestNG handles -listener on the command line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for registering custom listeners

4 participants