Hello, all.
_Short version:_ is the TestNG build/run process broken in
Netbeans when a Java Modular Project is in use?
_Long version:_
A project was imported into Netbeans 10 from Netbeans 8, and
the version increased from JDK 8 to JDK 11. A
module-info.java file was added into the "Source Packages"
tree and configured so that no errors appear within the
source code. But the "test" tree is full of errors because
its being in a different directory tree, where the "test"
directory is a sibling to "src" rather than a child
directory, causes the modular visibility to be lost.
To avoid breaking my existing project by moving directories
around, I created a new project using the Netbeans option
"Java Modular Project", created a module, copied the source
packages into the module's "classes" tree, and copied the
test classes into the "tests" tree. With the dependencies
configured, and the module-info.java file adjusted suitably,
no errors show, and "Clean and Build Project" reports no errors.
But with this new modular project I cannot get any of my
TestNG tests to execute. Right-clicking on a single test
class and selecting "Test" or "Run" causes nothing to happen
at all. And right-clicking on the master test suite XML file
and selecting "Test" causes the following to appear on the
console (paths contracted for easier reading):
/home/.../ProjectName/nbproject/build-impl.xml:1629: The
following error occurred while executing this line:
/home/.../ProjectName/nbproject/build-impl.xml:557: The
following error occurred while executing this line:
/home/.../ProjectName/nbproject/build-impl.xml:544: The
following error occurred while executing this line:
/home/.../ProjectName/nbproject/build-impl.xml:495:
/home/.../ProjectName/build/test/classes does not exist.
BUILD FAILED (total time: 0 seconds)
Why the build process is referring to build/test/classes I
don't know, because it looks like a Java modular project
uses the path build/test/modules (at least that's what I see
when I use the Files window to check the directory structure).
Is the build/run process for TestNG known to be broken in
Netbeans where modular Java projects are involved, or am I
doing something wrong in the creation and configuration of
this modular project?
--
Bob