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 73541 - Assertion for some types of XML output
Summary: Assertion for some types of XML output
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker with 1 vote (vote)
Assignee: Marian Petras
URL:
Keywords:
: 77327 77759 80020 80744 84009 (view as bug list)
Depends on: 82201
Blocks:
  Show dependency tree
 
Reported: 2006-03-13 13:20 UTC by Petr Suchomel
Modified: 2006-09-25 13:07 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
source code patch for branch 'release55' (8.35 KB, patch)
2006-09-05 11:10 UTC, Marian Petras
Details | Diff
reduced source code patch for branch 'release55' (3.71 KB, patch)
2006-09-05 11:12 UTC, Marian Petras
Details | Diff
binary patch for branch 'release55' (69.78 KB, application/octet-stream)
2006-09-05 13:40 UTC, Marian Petras
Details
NPE stack trace (1.27 KB, text/plain)
2006-09-05 15:13 UTC, Max Sauer
Details
messages.log (19.04 KB, text/plain)
2006-09-13 14:08 UTC, japod
Details
Zipped log file with the exception (5.79 KB, application/octet-stream)
2006-09-20 10:32 UTC, m_potociar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Suchomel 2006-03-13 13:21:15 UTC
java.lang.AssertionError
	at
org.netbeans.modules.junit.output.RootNodeChildren.displayReport(RootNodeChildren.java:80)
	at org.netbeans.modules.junit.output.RootNode.displayReport(RootNode.java:98)
	at
org.netbeans.modules.junit.output.ResultPanelTree.displayReport(ResultPanelTree.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
[catch] at
org.netbeans.modules.junit.output.ResultDisplayHandler$1.run(ResultDisplayHandler.java:317)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

java.lang.AssertionError
	at
org.netbeans.modules.junit.output.RootNodeChildren.displaySuiteRunning(RootNodeChildren.java:72)
	at org.netbeans.modules.junit.output.RootNode.displaySuiteRunning(RootNode.java:86)
	at
org.netbeans.modules.junit.output.ResultPanelTree.displaySuiteRunning(ResultPanelTree.java:170)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
[catch] at
org.netbeans.modules.junit.output.ResultDisplayHandler$1.run(ResultDisplayHandler.java:317)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Comment 1 Marian Petras 2006-06-12 20:13:04 UTC
I have a fix prepared.
Comment 2 Marian Petras 2006-06-15 12:35:46 UTC
Fixed in the trunk.

The cause was that when XML output to the standard output is used in the <junit>
task, name of the running testsuite is unknown until the testsuite finishes.
This case (the anonymousness of a testsuite) was not handled properly by the
code responsible for updating the results tree.

Modified files:
    junit/src/org/netbeans/modules/junit/output/:
                                           RootNodeChildren.java   (1.3)
                                           ResultDisplayHandler.java   (1.4)
                                           JUnitOutputReader.java   (1.20)
                                           RootNode.java   (1.3)
                                           TestsuiteNode.java   (1.3)
                                           ResultPanelTree.java   (1.8)
                                           Manager.java   (1.11)

Diffs:
http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/RootNodeChildren.java?r1=1.2&r2=1.3&diff_format=u
http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/ResultDisplayHandler.java?r1=1.3&r2=1.4&diff_format=u
http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/JUnitOutputReader.java?r1=1.19&r2=1.20&diff_format=u
http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/RootNode.java?r1=1.2&r2=1.3&diff_format=u
http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/TestsuiteNode.java?r1=1.2&r2=1.3&diff_format=u
http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/ResultPanelTree.java?r1=1.7&r2=1.8&diff_format=u
http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/Manager.java?r1=1.10&r2=1.11&diff_format=u
Comment 3 Marian Petras 2006-07-03 12:26:05 UTC
*** Issue 77327 has been marked as a duplicate of this issue. ***
Comment 4 Marian Petras 2006-07-03 12:28:12 UTC
*** Issue 77759 has been marked as a duplicate of this issue. ***
Comment 5 Marian Petras 2006-07-12 12:36:52 UTC
*** Issue 80020 has been marked as a duplicate of this issue. ***
Comment 6 Max Sauer 2006-07-18 12:41:52 UTC
Verified inside trunk.

---------------
NetBeans IDE Dev (Build 200607171800)
1.6.0-rc; Java HotSpot(TM) Server VM 1.6.0-rc-b90
Linux version 2.6.12-1.1390_FC4smp running on i386
en_US (nb); UTF-8
Comment 7 Marian Petras 2006-07-21 10:31:28 UTC
*** Issue 80744 has been marked as a duplicate of this issue. ***
Comment 8 Max Sauer 2006-09-04 09:42:15 UTC
*** Issue 82201 has been marked as a duplicate of this issue. ***
Comment 9 Marian Petras 2006-09-04 18:22:44 UTC
The committed change of class TestsuiteNode.java contains a bug in a newly
introduced assertion statement. It lead to bug #80461 ("Show All Errors/Show
Failures button breaks Junit results window") which was fixed by fixing the
assertion statement (fixed in rev. 1.5). When porting this bug to another
branch(es), do not forget to commit the additional fix.

Diff:
http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/output/TestsuiteNode.java?r1=1.4&r2=1.5&diff_format=u
Comment 10 Max Sauer 2006-09-05 08:14:40 UTC
Marking as 5.5_candidate, along with issue 80461.
Comment 11 Marian Petras 2006-09-05 10:27:33 UTC
*** Issue 84009 has been marked as a duplicate of this issue. ***
Comment 12 Marian Petras 2006-09-05 11:10:49 UTC
Created attachment 33593 [details]
source code patch for branch 'release55'
Comment 13 Marian Petras 2006-09-05 11:12:34 UTC
Created attachment 33594 [details]
reduced source code patch for branch 'release55'
Comment 14 Marian Petras 2006-09-05 11:16:25 UTC
I have attached a source code patch for branch 'release55'.

Because most of the modifications are made in comments, I also attached a
reduced diff which does not mention changed in comments - it should be used for
review of the planned changes but it should not be applied to the source code!
Comment 15 Marian Petras 2006-09-05 13:40:17 UTC
Created attachment 33600 [details]
binary patch for branch 'release55'
Comment 16 Marian Petras 2006-09-05 13:42:57 UTC
I have attached a binary patch for branch 'release55'. It should be applicable
to the recent builds of NetBeans 5.5. To apply the patch, put the attached .jar
file to subdirectory "ide7/modules/patches/org-netbeans-modules-junit/" of the
NetBeans installation directory and (re)start NetBeans. (Note: Subdirectory
"patches" may not exist - in this case, you will have to create it.)
Comment 17 Max Sauer 2006-09-05 15:12:05 UTC
After applying the binary patch to today 5.5dev build, I'm getting following 
NPE while testing j2se projects: 
 
java.lang.NullPointerException 
	at 
org.netbeans.modules.junit.output.TestsuiteNode.displayReport(TestsuiteNode.java:80) 
	at 
org.netbeans.modules.junit.output.RootNodeChildren.displayReport(RootNodeChildren.java:111) 
	at 
org.netbeans.modules.junit.output.RootNode.displayReport(RootNode.java:110) 
	at 
org.netbeans.modules.junit.output.ResultPanelTree.displayReport(ResultPanelTree.java:191) 
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
... 
(whole stack trace attached) 
 
-- 
Product Version         = NetBeans 5.5 Dev (Build 200609050000) 
Operating System        = Linux version 2.6.12-1.1390_FC4smp running on i386 
Java; VM; Vendor; Home  = 1.5.0_05; Java HotSpot(TM) Server VM 1.5.0_05-b05; 
Sun Microsystems Inc.; /usr/jdk1.5.0_05/jre 
System Locale; Encoding = en_US (nb); UTF-8 
Module patch or custom 
extension: /space/netbeans-5.5dev/ide7/modules/patches/org-netbeans-modules-junit/binary-patch-73541-release55.jar 
Comment 18 Max Sauer 2006-09-05 15:13:19 UTC
Created attachment 33603 [details]
NPE stack trace
Comment 19 japod 2006-09-07 09:31:36 UTC
The same behaviour after installing the patch onto:

Product Version         = NetBeans 5.5 Dev (Build 200609070000)
Operating System        = SunOS version 5.11 running on x86
Java; VM; Vendor; Home  = 1.5.0_08; Java HotSpot(TM) Client VM 1.5.0_08-b03; Sun
Microsystems Inc.; /opt/jdk1.5.0_08/jre

Comment 20 japod 2006-09-11 08:46:36 UTC
Since the bug still occurs in today's nightly build 
(it was promised to be fixed there -- please see bug #84009)
I am reopening the issue.
Comment 21 m_potociar 2006-09-11 13:18:30 UTC
I can confirm that with latest daily build I still experience the bug.
Comment 22 Max Sauer 2006-09-11 16:41:09 UTC
Please proceed with the fix, I have apparently confused this issue with issue
82201. The patch works ok for XML formatter (no assertion).

---
Product Version         = NetBeans 5.5 Dev (Build 200609040000)                
                                                       
Operating System        = SunOS version 5.10 running on sparcv9                
                                                       
Java; VM; Vendor; Home  = 1.5.0_09-ea; Java HotSpot(TM) 64-Bit Server VM
1.5.0_09-ea-b01; Sun Microsystems Inc.; /usr/jdk1.5.0_09/jre  
System Locale; Encoding = en (nb); ISO646-US
binary-patch-73541-release55.jar    
Comment 24 japod 2006-09-13 13:36:50 UTC
Null pointer exception thrown when running junit tests of wsit project
on the latest build (9/12) (please see the bug #84009), thus reopening the issue.
Will also attach my [message.log]
Comment 25 japod 2006-09-13 14:08:48 UTC
Created attachment 33879 [details]
messages.log
Comment 26 m_potociar 2006-09-20 10:31:52 UTC
I still get this NPE exception which makes it impossible to see the full test
report thus the development is significantly hindered (you have to run those
tests manually from CMD line and setup your own external reporting mechanism).
IMHO, this is a P1 issue. Attaching the messages.log file.
Comment 27 m_potociar 2006-09-20 10:32:31 UTC
Created attachment 34220 [details]
Zipped log file with the exception
Comment 28 Marian Petras 2006-09-21 00:13:23 UTC
kaos, I assume you are encountering the bug described in issue #82201 ("Printing
an XML header in a junit test causes an assertion"). Please try to apply the
binary patch for it:

1) Download the binary patch
(http://www.netbeans.org/nonav/issues/showattachment.cgi/34287/binary-patch-82201-release55.jar)
2) Apply the patch - put the downloaded .jar file into subdirectory

    ide7/modules/patches/org-netbeans-modules-junit

of your NetBeans 5.5 installation directory.
(Most probably you will have to create the subdirectory.)
3) (Re)start NetBeans 5.5 and try if you can still reproduce this bug.
Comment 29 japod 2006-09-21 08:35:25 UTC
binary-patch-82201-release55.jar helped! Thanks a lot!
no pop-up window anymore :-) all the tests processed
Is there any chance to have the patch integrated into nightly builds?
Comment 30 Marian Petras 2006-09-21 08:44:29 UTC
There is a chance.
Comment 31 Marian Petras 2006-09-21 09:04:06 UTC
In branch 'release55_dev', the blocking bug #82201 is now fixed - it implies
that this bug is fixed, too. Marking as FIXED. It will be marked as VERIFIED
once it is integrated to and tested in branch 'release55'.
Comment 32 Marian Petras 2006-09-22 11:26:23 UTC
I have committed the patch for bug #82201 to branch 'release55', too. So the
next daily build should have this bug fixed.
Comment 33 japod 2006-09-25 08:48:28 UTC
Great, thanks! It is working fine now (nightly build 5.5dev, 2006/09/25).
Comment 34 Max Sauer 2006-09-25 13:07:03 UTC
Verified.
---
Product Version         = NetBeans 5.5 Dev (Build 200609250000)
Operating System        = SunOS version 5.10 running on sparc
Java; VM; Vendor; Home  = 1.6.0-rc; Java HotSpot(TM) Client VM 1.6.0-rc-b99; Sun
Microsystems Inc.; /usr/jdk1.6.0/jre
System Locale; Encoding = en (nb); ISO646-US