TestNG won't build/run tests in a Netbeans Java Modular Project












2














I created a new project in Apache Netbeans 10 using the option "Java Modular Project", created a module, copied existing source packages into the module's "classes" tree, and copied existing test packages (which use the TestNG frameork) 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 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 my 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).



These tests all ran fine in Netbeans 8 using a non-modular Java project, so the problem is not in the tests themselves.



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?



Update: recreating the entire project in Netbeans 10 as a Maven project, the build and test actions do cause the TestNG test classes to compile and execute. So I believe this to be a problem with the Ant build scripts used by Netbeans 10 for modular Java projects.










share|improve this question
























  • And before you ask: I need a modular project because I need to import the new java.net.http module made available in JDK 11.
    – Bobulous
    Nov 12 '18 at 15:10












  • This could be possible because of the test modules build with a modular project. Though the error shared by you merely has some information. Maybe someone from netbeans can pitch in to help.
    – nullpointer
    Nov 13 '18 at 0:52






  • 1




    Yeah, I've posted the same question to the Apache Netbeans Users Mailing List but no reply so far. It's possibly something I was doing wrong, but my suspicion is that the Ant build scripts for modular projects simply don't work for TestNG. I've recreated my projects as Maven builds and the compilation and testing runs without any problems. So I've given up on Ant for now.
    – Bobulous
    Nov 13 '18 at 14:50
















2














I created a new project in Apache Netbeans 10 using the option "Java Modular Project", created a module, copied existing source packages into the module's "classes" tree, and copied existing test packages (which use the TestNG frameork) 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 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 my 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).



These tests all ran fine in Netbeans 8 using a non-modular Java project, so the problem is not in the tests themselves.



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?



Update: recreating the entire project in Netbeans 10 as a Maven project, the build and test actions do cause the TestNG test classes to compile and execute. So I believe this to be a problem with the Ant build scripts used by Netbeans 10 for modular Java projects.










share|improve this question
























  • And before you ask: I need a modular project because I need to import the new java.net.http module made available in JDK 11.
    – Bobulous
    Nov 12 '18 at 15:10












  • This could be possible because of the test modules build with a modular project. Though the error shared by you merely has some information. Maybe someone from netbeans can pitch in to help.
    – nullpointer
    Nov 13 '18 at 0:52






  • 1




    Yeah, I've posted the same question to the Apache Netbeans Users Mailing List but no reply so far. It's possibly something I was doing wrong, but my suspicion is that the Ant build scripts for modular projects simply don't work for TestNG. I've recreated my projects as Maven builds and the compilation and testing runs without any problems. So I've given up on Ant for now.
    – Bobulous
    Nov 13 '18 at 14:50














2












2








2







I created a new project in Apache Netbeans 10 using the option "Java Modular Project", created a module, copied existing source packages into the module's "classes" tree, and copied existing test packages (which use the TestNG frameork) 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 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 my 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).



These tests all ran fine in Netbeans 8 using a non-modular Java project, so the problem is not in the tests themselves.



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?



Update: recreating the entire project in Netbeans 10 as a Maven project, the build and test actions do cause the TestNG test classes to compile and execute. So I believe this to be a problem with the Ant build scripts used by Netbeans 10 for modular Java projects.










share|improve this question















I created a new project in Apache Netbeans 10 using the option "Java Modular Project", created a module, copied existing source packages into the module's "classes" tree, and copied existing test packages (which use the TestNG frameork) 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 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 my 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).



These tests all ran fine in Netbeans 8 using a non-modular Java project, so the problem is not in the tests themselves.



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?



Update: recreating the entire project in Netbeans 10 as a Maven project, the build and test actions do cause the TestNG test classes to compile and execute. So I believe this to be a problem with the Ant build scripts used by Netbeans 10 for modular Java projects.







java netbeans ant testng java-module






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 '18 at 11:31

























asked Nov 12 '18 at 15:09









Bobulous

9,61242649




9,61242649












  • And before you ask: I need a modular project because I need to import the new java.net.http module made available in JDK 11.
    – Bobulous
    Nov 12 '18 at 15:10












  • This could be possible because of the test modules build with a modular project. Though the error shared by you merely has some information. Maybe someone from netbeans can pitch in to help.
    – nullpointer
    Nov 13 '18 at 0:52






  • 1




    Yeah, I've posted the same question to the Apache Netbeans Users Mailing List but no reply so far. It's possibly something I was doing wrong, but my suspicion is that the Ant build scripts for modular projects simply don't work for TestNG. I've recreated my projects as Maven builds and the compilation and testing runs without any problems. So I've given up on Ant for now.
    – Bobulous
    Nov 13 '18 at 14:50


















  • And before you ask: I need a modular project because I need to import the new java.net.http module made available in JDK 11.
    – Bobulous
    Nov 12 '18 at 15:10












  • This could be possible because of the test modules build with a modular project. Though the error shared by you merely has some information. Maybe someone from netbeans can pitch in to help.
    – nullpointer
    Nov 13 '18 at 0:52






  • 1




    Yeah, I've posted the same question to the Apache Netbeans Users Mailing List but no reply so far. It's possibly something I was doing wrong, but my suspicion is that the Ant build scripts for modular projects simply don't work for TestNG. I've recreated my projects as Maven builds and the compilation and testing runs without any problems. So I've given up on Ant for now.
    – Bobulous
    Nov 13 '18 at 14:50
















And before you ask: I need a modular project because I need to import the new java.net.http module made available in JDK 11.
– Bobulous
Nov 12 '18 at 15:10






And before you ask: I need a modular project because I need to import the new java.net.http module made available in JDK 11.
– Bobulous
Nov 12 '18 at 15:10














This could be possible because of the test modules build with a modular project. Though the error shared by you merely has some information. Maybe someone from netbeans can pitch in to help.
– nullpointer
Nov 13 '18 at 0:52




This could be possible because of the test modules build with a modular project. Though the error shared by you merely has some information. Maybe someone from netbeans can pitch in to help.
– nullpointer
Nov 13 '18 at 0:52




1




1




Yeah, I've posted the same question to the Apache Netbeans Users Mailing List but no reply so far. It's possibly something I was doing wrong, but my suspicion is that the Ant build scripts for modular projects simply don't work for TestNG. I've recreated my projects as Maven builds and the compilation and testing runs without any problems. So I've given up on Ant for now.
– Bobulous
Nov 13 '18 at 14:50




Yeah, I've posted the same question to the Apache Netbeans Users Mailing List but no reply so far. It's possibly something I was doing wrong, but my suspicion is that the Ant build scripts for modular projects simply don't work for TestNG. I've recreated my projects as Maven builds and the compilation and testing runs without any problems. So I've given up on Ant for now.
– Bobulous
Nov 13 '18 at 14:50












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53264986%2ftestng-wont-build-run-tests-in-a-netbeans-java-modular-project%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53264986%2ftestng-wont-build-run-tests-in-a-netbeans-java-modular-project%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Hercules Kyvelos

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud