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 87142 - IAE when running test (progress bar)
Summary: IAE when running test (progress bar)
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 6.x
Hardware: PC All
: P3 blocker (vote)
Assignee: Marian Petras
URL:
Keywords:
: 89342 91648 96921 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-13 18:34 UTC by cezariusz
Modified: 2015-04-28 15:56 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages.log (24.51 KB, text/plain)
2006-10-13 18:34 UTC, cezariusz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cezariusz 2006-10-13 18:34:00 UTC
NetBeans IDE Dev (Build 200610051800)
1.6.0-rc; Java HotSpot(TM) Client VM 1.6.0-rc-b89
Windows XP version 5.1 running on x86
pl_PL (nb); Cp1250


Ater running some tests, which have thrown RuntimeExceptions, each subsequent 
run of test throws the following exception:


java.lang.IllegalArgumentException
	at org.netbeans.progress.spi.InternalHandle.progress
(InternalHandle.java:227)
	at org.netbeans.api.progress.ProgressHandle.progress
(ProgressHandle.java:132)
	at org.netbeans.modules.junit.output.JUnitOutputReader.suiteStarted
(JUnitOutputReader.java:675)
	at org.netbeans.modules.junit.output.JUnitOutputReader.messageLogged
(JUnitOutputReader.java:334)
	at org.netbeans.modules.junit.output.JUnitAntLogger.messageLogged
(JUnitAntLogger.java:151)
	at org.apache.tools.ant.module.bridge.impl.NbBuildLogger.messageLogged
(NbBuildLogger.java:511)
	at org.apache.tools.ant.Project.fireMessageLoggedEvent
(Project.java:2009)
	at org.apache.tools.ant.Project.fireMessageLogged(Project.java:2058)
	at org.apache.tools.ant.Project.log(Project.java:367)
	at org.apache.tools.ant.Task.log(Task.java:346)
	at org.apache.tools.ant.taskdefs.LogOutputStream.processLine
(LogOutputStream.java:129)
	at org.apache.tools.ant.taskdefs.LogOutputStream.processLine
(LogOutputStream.java:120)
	at org.apache.tools.ant.taskdefs.LogOutputStream.processBuffer
(LogOutputStream.java:110)
	at org.apache.tools.ant.taskdefs.LogOutputStream.write
(LogOutputStream.java:88)
	at org.apache.tools.ant.taskdefs.LogOutputStream.write
(LogOutputStream.java:172)
	at org.apache.tools.ant.taskdefs.StreamPumper.run(StreamPumper.java:91)
[catch] at java.lang.Thread.run(Thread.java:619)
Comment 1 cezariusz 2006-10-13 18:34:42 UTC
Created attachment 35198 [details]
messages.log
Comment 2 tkellerer 2006-10-21 14:27:13 UTC
I get this even when my tests do not throw any exception.
And I get it everytime when testing the complete project (Run -> Test "Projectname")
Comment 3 cezariusz 2006-10-21 18:28:21 UTC
In that case I suggest raising the priority to P2.
Comment 4 Max Sauer 2006-12-07 12:23:20 UTC
*** Issue 89342 has been marked as a duplicate of this issue. ***
Comment 5 Marian Petras 2007-01-16 16:00:54 UTC
I cannot reproduce this bug.

Could anyone attached a (packed) simple project on which to reproduce this bug?

I tried to reproduce this bug on the following systems:

   Linux (Fedora Core 4) running on single-core single-processor + JDK 1.5.0_10
   Windows 2003 running on dual-processor machine + JDK 1.5.0_11
   Windows 2003 running on dual-processor machine + JDK 1.6.0 (64bit Server VM)
Comment 6 Marian Petras 2007-03-19 09:17:20 UTC
I have seen this error.
Comment 7 Marian Petras 2007-03-19 10:03:16 UTC
Sorry, I have not seen this error, I have encountered bug #98175
(NullPointerException when running test).
Comment 8 Marian Petras 2007-03-19 10:04:37 UTC
*** Issue 91648 has been marked as a duplicate of this issue. ***
Comment 9 Marian Petras 2007-03-19 10:04:50 UTC
*** Issue 96921 has been marked as a duplicate of this issue. ***
Comment 10 Marian Petras 2007-03-19 11:58:37 UTC
Tim, I tried to reproduce it, using the NetBeans version and test project you
mentioned in bug #91648 (i.e. NetBeans build 061221, test project "xml2"). It
worked for me. I tried it also with newer builds and I only encountered bug
#98175 which I already fixed.

Do you still encounter the bug with newer builds? If so, I need to know the
NetBeans build number, the platform and the JDK used in order to reproduce it
and fix it.
Comment 11 Marian Petras 2007-07-23 17:45:13 UTC
Priority lowered to P3 until somebody provides instructions on how to reproduce this bug.
Comment 12 _ tboudreau 2007-07-23 18:54:23 UTC
Haven't seen it in some time
Comment 13 rebeccah 2008-09-03 20:28:03 UTC
I'm seeing it consistently in NB 6.0.1

Product Version: NetBeans IDE 6.0.1 (Build 200801291616)
Java: 1.6.0_05; Java HotSpot(TM) Client VM 10.0-b19
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)

I'm currently trying to test a parameterized junit test.  I get the exception once per iteration through the test, with 
a different workunit no. for each iteration. (BTW it sure would be useful if that messages log had a timestamp on the 
messages rather than only at startup).

INFO [org.netbeans.progress.spi.InternalHandle]: Cannot process more work than scheduled. Progress handle with 
name "Running JUnit tests..." has requested progress to workunit no.32700 but the total number of workunits is 0. That 
means the progress bar UI will not display real progress and will stay at 100%.
java.lang.IllegalArgumentException
	at org.netbeans.progress.spi.InternalHandle.progress(InternalHandle.java:261)
	at org.netbeans.api.progress.ProgressHandle.progress(ProgressHandle.java:171)
	at org.netbeans.api.progress.ProgressHandle.progress(ProgressHandle.java:153)
	at org.netbeans.modules.junit.output.JUnitOutputReader.updateProgress(JUnitOutputReader.java:800)
	at org.netbeans.modules.junit.output.JUnitOutputReader.updateProgress(JUnitOutputReader.java:774)
	at org.netbeans.modules.junit.output.JUnitOutputReader.verboseMessageLogged(JUnitOutputReader.java:274)
	at org.netbeans.modules.junit.output.JUnitAntLogger.messageLogged(JUnitAntLogger.java:184)
	at org.apache.tools.ant.module.bridge.impl.NbBuildLogger.messageLogged(NbBuildLogger.java:585)
	at org.apache.tools.ant.Project.fireMessageLoggedEvent(Project.java:2171)
	at org.apache.tools.ant.Project.fireMessageLogged(Project.java:2271)
	at org.apache.tools.ant.Project.log(Project.java:449)
	at org.apache.tools.ant.Task.log(Task.java:294)
	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask$JUnitLogOutputStream.processLine(JUnitTask.java:1769)
	at org.apache.tools.ant.taskdefs.LogOutputStream.processLine(LogOutputStream.java:80)
	at org.apache.tools.ant.util.LineOrientedOutputStream.processBuffer(LineOrientedOutputStream.java:82)
	at org.apache.tools.ant.taskdefs.LogOutputStream.processBuffer(LogOutputStream.java:67)
	at org.apache.tools.ant.util.LineOrientedOutputStream.write(LineOrientedOutputStream.java:57)
	at org.apache.tools.ant.util.LineOrientedOutputStream.write(LineOrientedOutputStream.java:132)
	at org.apache.tools.ant.taskdefs.StreamPumper.run(StreamPumper.java:93)
	at java.lang.Thread.run(Thread.java:619)

Comment 14 Peter Pis 2008-09-12 09:11:12 UTC
Could you please try latest build of NB. Can't reproduce. Thanks.
Comment 15 Marian Petras 2008-10-21 17:05:28 UTC
I got a detailed log of the process of running JUnit tests in the case this bug appears - thanks, ppis.

It happens when the JUnit module fails to count the test classes included in the test run. Then I simulated this
condition on my computer and fixed the bug. The immediate cause of the bug was that method
JUnitOutputReader.updateProgress(String) assumed that a determinate progress bar is used, i.e. that the number of test
suites is known (non-zero). A trivial modification of this method fixed the symptom - the exceptions being thrown.

Changeset Id:
1d8637788dc0
(http://hg.netbeans.org/main/rev/1d8637788dc0)

I will yet have to find why counting of test classes fails (randomly, it seems).
Comment 16 Quality Engineering 2008-10-24 04:16:15 UTC
Integrated into 'main-golden', will be available in build *200810240201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/1d8637788dc0
User: Marian Petras <mpetras@netbeans.org>
Log: partially fixed bug #87142 - "IAE when running test (progress bar)"
Comment 17 Marian Petras 2008-11-25 16:20:52 UTC
This exception is no longer thrown so I mark this bug as fixed, again.

To track the problem caused by failures to count test classes, I filed a separate issue #153872 ("Indeterminate progress
bar displayed instead of determinate one").
Comment 18 cezariusz 2015-04-28 15:56:12 UTC
Verified with 8.0.2.