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.

Bug 130206 - Test display incorrect when execution of tests is interrupted.
Summary: Test display incorrect when execution of tests is interrupted.
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Marian Petras
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-14 22:58 UTC by _ pcw
Modified: 2008-07-08 04:39 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Snapshot showing misleading text. (111.77 KB, image/png)
2008-03-14 22:59 UTC, _ pcw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ pcw 2008-03-14 22:58:38 UTC
Given a project containing a JUnit based test with one test (assume test passes), run the test via "Run File" on the
test file.

The JUnit output window will appear with a root node that says "The test passed" (text will be different if more than
one test is in the file).

Now put a breakpoint in the test method and debug the test via "Debug File" on the test file.  When the test hits the
breakpoint, detach the debugger via <Finish> and let the test complete.

The JUnit output window will appear, but the text is wrong.  The root node says "No tests executed.", while it has a
child node indicating that a test did run and it did pass.
Comment 1 _ pcw 2008-03-14 22:59:15 UTC
Created attachment 58417 [details]
Snapshot showing misleading text.
Comment 2 Marian Petras 2008-04-02 21:01:28 UTC
Confirmed in build 080402.
Comment 3 Marian Petras 2008-05-27 09:12:18 UTC
It seems that the JUnitOutputReader does not get any more event messages once the debugger is detached.
Comment 4 Marian Petras 2008-05-28 09:53:11 UTC
When the debugger is detached, it kills the JVM that is running the tests. The problem is that the JUnit module is not
able to cope with interruption of tests and displays incorrect results in such case.
Comment 5 Marian Petras 2008-07-07 14:11:14 UTC
Fixed.

Changeset Id:
909640abcdc1
(http://hg.netbeans.org/main/rev/909640abcdc1)

Modified and new files:
    junit/src/org/netbeans/modules/junit/output/Bundle.properties
    junit/src/org/netbeans/modules/junit/output/HtmlMarkupUtils.java   (new file)
    junit/src/org/netbeans/modules/junit/output/JUnitOutputReader.java
    junit/src/org/netbeans/modules/junit/output/RegexpUtils.java
    junit/src/org/netbeans/modules/junit/output/Report.java
    junit/src/org/netbeans/modules/junit/output/RootNode.java
    junit/src/org/netbeans/modules/junit/output/TestMethodNode.java
    junit/src/org/netbeans/modules/junit/output/TestMethodNodeChildren.java
    junit/src/org/netbeans/modules/junit/output/TestsuiteNode.java
    junit/src/org/netbeans/modules/junit/output/XmlOutputParser.java
Comment 6 Quality Engineering 2008-07-08 04:39:55 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #306 build
Changeset: http://hg.netbeans.org/main/rev/909640abcdc1
User: Marian Petras <mpetras@netbeans.org>
Log: fixed bug #130206 - "Test display incorrect when execution of tests is interrupted"