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.
All kinds of tests run with XTest should turn on Java 1.4 assertions, using the -ea switch, to catch any problems encountered in the code that were not specifically tested for. Probably actually -esa (enable system assertions) would be a good idea too. A lot of new code, especially Actions, Nodes, and Looks, uses assertions heavily and so there may be tests passing at the moment which are actually skipping over assertion failures! This is not good.
We probably need -ea for properly testing nodes_eq_35833.
I could easily add this switch to plain jvm launcher. Just wondering what about IDE mode. I noticed '-ea' is always on the command line, so I suppose there is not problem with it in IDE, right?
Probably OK in ide-mode (unless you are testing a release or RC version of the IDE which does not have -ea in ide.cfg).
Just wondering - who is supposed to set this switch - test owner or the person who runs the tests on servers? I suppose the test owner, correct? If so, then I believe I'll need to be able to add the -ea switch also to ide. I hope java woudn't mind if there are two '-ea' switches on the command line. Also is it even correct to run tests on RC or FCS builds with -ea? If so, I'll go ahead.
IMHO it should always be on when testing dev builds. There should be no need for either test owner or test runner to explicitly set it on. If you are running tests, you certainly would want to be checking assertions too, right? No opinion re. FCS/RC builds.
So I I understand it correctly - XTest should start all tests with -ea, no matter what ide.cfg or whatever says. Then there should not be any need to have '-ea' in daily builds, since all tests will be run with it anyway, right?
IMHO -ea should be left in dev builds anyway since people will surely interactively use far more of the code than is actually covered by the standard tests.
IMHO RC/FCS should better be run twice, both with and without -ea Although assertions should be transparent, you can't guarantee they really don't influence data structures/program flow.
Re. -ea possibly influencing program flow - true, but running in XTest also possibly influences program flow! There's no substitute for someone sitting down with the final bits, installing them, and really trying everything as a user would.
Ok - I will implement -ea switch to both JDK and IDE executors (it will be turned on by default) and test runner or user will ability to turn it off (for whatever reason).
Fixed - now all tests by default are running with -ea switch. Assertions can be also disabled by specifying xtest.enable.assertions=false property.