apache / apache/netbeans

Running tests with TestNG fails

Open
#6,737 2 comments 1 reaction 0 assignees View on GitHub
Ant kind:bug needs:triage
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 19

### What happened

Attempt to run tests with TestNG installed in the classpath, I get the following error

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:57)
                at org.testng.ITestObjectFactory.newInstance(itestobjectfactory.java:10)

....

### How to reproduce

Install TestNG with required dependencies and run a test.

### Did this work correctly in an earlier version?

No / Don't know

### Operating System

Windows

### JDK

17

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

It works correctly if I run the test via a Test Runner, but if I right click and select run file or test file it throws that error.
I narrowed it down to the TestNGAntTask in the build-impl.XML file where the listeners attribute has the VerboseReporter package listed - if I remove that it works.

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Start with the TestNGAntTask and its listeners attribute in build-impl.XML, then reproduce the failure by running a test file through the right-click action and compare it with the Test Runner. Done means the right-click run path no longer throws the VerboseReporter constructor error while TestNG tests still run.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.