This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The JUnit Test Results window shows "No Tests Executed" (in the summary line, where it usually displays the amount of tests run/failed/with error) after running them. Underneath the "No Test Executed" leyend, you the name of the test class can be seen with the status "passed" (on the right side). If I try to open the tree node, it doesn't show what tests were executed (the tree is empty). The Output window shows all the logging from the tests, but no summary of how many tests were run/failed/caused errors. There are several things I noticed that might be useful: - This happens for some test classes of the project. Others seem to run perfectly fine. - After those classes that make JUnit fail, I noticed a delay from the moment the tests finished until the "No Test Executed" leyend shows up. - The classes that make JUnit fail produce a high amount of logging that's also shown in the JUnit output window. The delay mentioned in the previous point occurs before all the log information is shown in the output window, and then almost at the same time the leyend "No Tests Executed" followed by the rest of the logs are displayed. - If I cancel logging setting the level to Level.OFF the problem doesn't show up, but all my tests that verify logging obviously fail. Please let me know if I can help you in any way... For now I'm sutting down logging to keep working, but I don't feel really confortable by doing that.
I tried to reproduce this bug with a simple test producing a million lines and then failing. It worked! I used the following source code: public class SomeJUnitTest extends TestCase { public SomeJUnitTest(String testName) { super(testName); } public void testWithLotsOfLogging() { for (int i = 0; i < 1000000; i++) { System.out.println("This is some text - just to produce something " + i); } fail("I wanted it to fail."); } } Could you run the above test? I suggest that you start with a lower number than million at first, e.g. with 100000. How many lines of output does your test in question produce (approximately)?
Did you debug the tests? In this case, it might be the same issue as issue #130206 ("Test display incorrect when debugging tests").
Can you verify that the JVM running the tests finishes regularly (i.e. is not interrupted and does not crash during execution)?
If you think the JVM running the tests finishes regularly, could you please run NetBeans with the following extra argument? -J-Dorg.netbeans.modules.junit.output.JUnitOutputReader.level=300 Either pass it as an argument for "netbeans.exe" (or "nb.exe") when running NetBeans, or make it permanent by adding it to file "etc/netbeans.conf" in your NetBeans installation directory. Then (re)start NetBeans and try to reproduce the bug. The JUnitOutputReader class should produce a detailed log to the NetBeans' log file (<NB-user-dir>\var\log\messages.log). Please attach the log file to this issue or send it directly to me. Thank you.
Created attachment 62128 [details] Logs
I think that I found the cause - it is the thousands-separator used in the statistics line of the output: Tests run: 5, Failures: 5, Errors: 0, Time elapsed: 18,557 sec The JUnit module has a hard-coded expression for matching float-numbers FLOAT_NUMBER_REGEX = "[0-9]*(?:\\.[0-9]+)?" which accepts "18.557" but not "18,557".
Fixed. Modified files: junit/src/org/netbeans/modules/junit/output/JUnitOutputReader.java junit/src/org/netbeans/modules/junit/output/RegexpUtils.java Changeset Id: b56ac1907fc7 (http://hg.netbeans.org/main/rev/b56ac1907fc7)
Integrated into 'main-golden', available in NB_Trunk_Production #324 build Changeset: http://hg.netbeans.org/main/rev/b56ac1907fc7 User: Marian Petras <mpetras@netbeans.org> Log: fixed bug #135553 - 'JUnit Shows "No Tests Executed" when tests have been executed'