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.
Summary: | JUnit Shows "No Tests Executed" when tests have been executed | ||
---|---|---|---|
Product: | java | Reporter: | mjr_1974 <mjr_1974> |
Component: | JUnit | Assignee: | Marian Petras <mpetras> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | Keywords: | I18N |
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Logs |
Description
mjr_1974
2008-05-21 20:39:59 UTC
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' |