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: | Commit validation tests should (optionally?) fail if unexpected exception raised | ||
---|---|---|---|
Product: | platform | Reporter: | _ tboudreau <tboudreau> |
Component: | NB JUnit | Assignee: | apireviews <apireviews> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | jglick, jtulach |
Priority: | P3 | Keywords: | API_REVIEW_FAST |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | 160554 | ||
Bug Blocks: | |||
Attachments: | Proposed patch, please review |
Description
_ tboudreau
2008-12-15 03:43:45 UTC
Just for an inspiration. XTest used to have XTestIDEHandler. http://hg.netbeans.org/main/file/016515477cc0/xtest/plugins_src/ide/src/org/netbeans/xtest/plugin/ide/XTestIDEHandler.java http://hg.netbeans.org/main/file/016515477cc0/xtest/plugins_src/ide/src/org/netbeans/xtest/plugin/ide/MainWithExec.java http://hg.netbeans.org/main/file/016515477cc0/xtest/plugins_src/ide/test/unit/src/org/netbeans/xtest/plugin/ide/test/XTestIDEHandlerTest.java jtulach suggests: - add NbModuleSuite.Configuration.failOnException(Level.INFORMATIONAL).failOnLogMessage(Level.SEVERE) - use these methods in ide.kit/**/IDEValidation.java I seem to need this functionality. Created attachment 78117 [details]
Proposed patch, please review
Strongly suggest adding an item to the developer FAQ about how to use this option once it is integrated: http://wiki.netbeans.org/NetBeansDeveloperFAQ I guess your patch omits some NbModuleLogHandler.java? (hg addrem) The API looks fine to me. This is more or less the code that I want to integrate: http://hg.netbeans.org/ergonomics/rev/4d394a5c7c7a 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. 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(CLIOptions.java:294) (This is since fixed in trunk.) But return NbModuleSuite.createConfiguration(...). gui(false). failOnMessage(Level.WARNING). failOnException(Level.INFO). suite(); 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. |