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 37291 - All tests should run with -ea
Summary: All tests should run with -ea
Alias: None
Product: obsolete
Classification: Unclassified
Component: xtest (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@obsolete
Depends on:
Blocks: 35833
  Show dependency tree
Reported: 2003-11-18 09:57 UTC by Jesse Glick
Modified: 2004-02-12 10:32 UTC (History)
1 user (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2003-11-18 09:57:14 UTC
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.
Comment 1 Jesse Glick 2003-11-18 09:57:54 UTC
We probably need -ea for properly testing nodes_eq_35833.
Comment 2 Martin Brehovsky 2003-11-25 13:48:35 UTC
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?
Comment 3 Jesse Glick 2003-11-25 16:55:35 UTC
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).
Comment 4 Martin Brehovsky 2003-11-26 09:50:29 UTC
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,

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.
Comment 5 Jesse Glick 2003-11-26 15:43:55 UTC
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.
Comment 6 Martin Brehovsky 2003-11-26 16:36:12 UTC
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?
Comment 7 Jesse Glick 2003-11-26 17:50:19 UTC
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.
Comment 8 Petr Nejedly 2003-11-27 08:12:25 UTC
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.
Comment 9 Jesse Glick 2003-11-27 12:47:52 UTC
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.
Comment 10 Martin Brehovsky 2003-11-27 12:57:44 UTC
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).
Comment 11 Martin Brehovsky 2004-02-12 10:32:21 UTC
Fixed - now all tests by default are running with -ea switch.
Assertions can be also disabled by specifying
xtest.enable.assertions=false property.