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 155444 - Commit validation tests should (optionally?) fail if unexpected exception raised
Summary: Commit validation tests should (optionally?) fail if unexpected exception raised
Alias: None
Product: platform
Classification: Unclassified
Component: NB JUnit (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: apireviews
Depends on: 160554
  Show dependency tree
Reported: 2008-12-15 03:43 UTC by _ tboudreau
Modified: 2011-11-04 22:10 UTC (History)
2 users (show)

See Also:
Exception Reporter:

Proposed patch, please review (12.68 KB, patch)
2009-03-12 14:02 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2008-12-15 03:43:45 UTC
See discussion here in issue 152249 - for some time commit validation would present a series of exception dialogs, yet pass.  Probably it should not pass if a 
change causes some code that is run by one of the tests to throw an exception.
Comment 2 Jesse Glick 2008-12-16 14:06:29 UTC
jtulach suggests:

- add NbModuleSuite.Configuration.failOnException(Level.INFORMATIONAL).failOnLogMessage(Level.SEVERE)

- use these methods in ide.kit/**/
Comment 3 Jaroslav Tulach 2009-03-12 14:00:20 UTC
I seem to need this functionality.
Comment 4 Jaroslav Tulach 2009-03-12 14:02:12 UTC
Created attachment 78117 [details]
Proposed patch, please review
Comment 5 _ tboudreau 2009-03-12 17:27:03 UTC
Strongly suggest adding an item to the developer FAQ about how to use this option once it is integrated:
Comment 6 Jesse Glick 2009-03-13 02:21:19 UTC
I guess your patch omits some (hg addrem) The API looks fine to me.
Comment 7 Jaroslav Tulach 2009-03-13 14:08:53 UTC
This is more or less the code that I want to integrate:
Comment 8 Jesse Glick 2009-03-13 15:03:54 UTC
Shouldn't NbEvents read

  logger.log(warn ? Level.WARNING : Level.INFO, text + "\n");


Irritating that Level is not Comparable<Level>. I will file a JRE RFE when I get a chance.
Comment 10 Jesse Glick 2011-11-04 22:10:14 UTC
This does not seem to work very reliably, at least from Maven (if it matters). 7.1 Beta always prints a warning to console even in a plain Platform app:

WARNING [org.netbeans.TopSecurityManager]: use of system property netbeans.home has been obsoleted in favor of InstalledFileLocator at org.netbeans.core.startup.CLIOptions.getUserDir(

(This is since fixed in trunk.) But

return NbModuleSuite.createConfiguration(...).

does not consistently fail; the warning is displayed in test output but the suite passes anyway.

Putting a Thread.sleep(5000) in a test method does not help. Putting Exceptions.printStackTrace(new Exception()) in a test method usually makes it fail, but not consistently. Using gui(true) and doing some operations with jellytools.platform seems to make it fail consistently.

Not sure what the problem is, but I am guessing it has something to do with buffering in TopLogging.