Skip to content

Tests for Ant projects no longer work with bundled TestNG libraries #9561

Description

@gem-bricks

Apache NetBeans version

Apache NetBeans 31

What happened

Using ant test or running individual tests in the IDE yields an error with an Ant project that uses the bundled TestNG libraries (added with Test Dependencies > Add Library...).

Language / Project Type / NetBeans Component

Ant project using TestNG

How to reproduce

  1. Create a new Ant project (New Project... > Java with Ant > Java Application). Keep Create Main Class checked.
  2. In the main class, click on the class name and select Create Test Class [TestNG... in the hints.
  3. Test the testMain method.

Did this work correctly in an earlier version?

Apache NetBeans 30

Operating System

linux 7.1.8.arch1-3

JDK

OpenJDK 26.0.2.u10-1

Apache NetBeans packaging

Community provided installer, Third-party package

Anything else

Example project

It has broken with 31 because TestNG has been bumped up to 7.11. The current build-impl.xml isn't equipped to handle the new major version.

Related to this issue.

Test output:

SLF4J(W): No SLF4J providers were found.
SLF4J(W): Defaulting to no-operation (NOP) logger implementation
SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
Exception in thread "main" org.testng.TestNGException: 
Couldn't find a constructor in class org.testng.reporters.VerboseReporter
	at org.testng.internal.objects.InstanceCreator.newInstance(InstanceCreator.java:59)
	at org.testng.ITestObjectFactory.newInstance(ITestObjectFactory.java:10)
	at org.testng.internal.objects.SimpleObjectDispenser.dispense(SimpleObjectDispenser.java:61)
	at org.testng.internal.objects.GuiceBasedObjectDispenser.dispenseObject(GuiceBasedObjectDispenser.java:41)
	at org.testng.internal.objects.GuiceBasedObjectDispenser.dispense(GuiceBasedObjectDispenser.java:31)
	at org.testng.internal.DefaultListenerFactory.createListener(DefaultListenerFactory.java:29)
	at org.testng.TestNG.setListenerClasses(TestNG.java:698)
	at org.testng.TestNG.configure(TestNG.java:1558)
	at org.testng.TestNG.privateMain(TestNG.java:1421)
	at org.testng.TestNG.main(TestNG.java:1394)

Are you willing to submit a pull request?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ant[ci] enable "build tools" testskind:bugBug report or fixtests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions