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 171616 - Module NB JUnit missing from Unit test Libraries
Summary: Module NB JUnit missing from Unit test Libraries
Status: RESOLVED INVALID
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
: 173256 173396 (view as bug list)
Depends on: 173792
Blocks: 121950
  Show dependency tree
 
Reported: 2009-09-07 12:11 UTC by David Strupl
Modified: 2009-10-07 00:14 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Strupl 2009-09-07 12:11:45 UTC
Currently for all our projects the class NbTestCase is missing in our unit test dependencies. The module NB JUnit is not
in our unit test dependencies. This was not the case before. Will the change fixing this be done on apisupport side (to
add the said module automatically) or should all of our projects be updated to explicitly list this dependency?
Comment 1 Antonin Nebuzelsky 2009-09-09 10:28:24 UTC
Richard is on vacation. Jesse, please take this one.
Comment 2 David Strupl 2009-09-14 12:22:20 UTC
Caused by

http://hg.netbeans.org/main-silver/rev/3e27593d8860

Jesse, did you sent out some notification that we should change all our projects? Quoting from the commit log:

"In the meantime, project will likely show error badges on test roots.
Probably the only way module owners will ever be reminded to fix their metadata."

If we are supposed to do something it would be good if we knew about it. Commit log is nice but a more explicit message
explaining how exactly we should change our tests classpath would be nice. By exactly I mean whether it is enough to
just add NB Junit library or some other (e.g. Insane).

If the message went somewhere I apologize for not noticing (but nobody from my team noticed it as well).
Comment 3 Jesse Glick 2009-09-14 14:55:24 UTC
Yes you need to update your libraries. This was actually true in NB 6.5 but enforcement was too weak - the warning in
build log was apparently ignored. For performance reasons relating to classpath scanning it was becoming intolerable to
use the default dependencies for so many modules.

For unit tests, you must add JUnit 4; if you use NB JUnit then you must add that too (add as recursive so INSANE appears
too). For functional tests, the same applies but you will generally need to add also some variant of jellytools, etc.
Noting on nbdev.
Comment 4 David Strupl 2009-09-14 15:09:54 UTC
What exactly "was true in 6.5"? After your commit our unit tests started to appear with wrong error badges which was not
the case before the commit.

I will update our modules ...
Comment 5 Jan Lahoda 2009-09-14 15:17:27 UTC
Could you please elaborate on "For performance reasons relating to classpath scanning it was becoming intolerable to
use the default dependencies for so many modules."? I assume that vast majority of project owner will simply add
dependencies on junit4+nbjunit+insane, because this combination seems to always work. I doubt anyone will invest time
into checking whether a particular dependency is really required, as that would take too long for 50+ modules.
Comment 6 Jesse Glick 2009-09-15 03:52:29 UTC
Your deps were supposed to be updated as of NB 6.5 and that is when the warning appeared during the build. As I said
previously, the simplification in apisupport.project was in 6.8 dev builds, so now the compatibility code exists only in
nbbuild.

Regarding performance - this is significant for functional tests, for which XTest defaulted to adding a bunch of
Jelly-related dependencies which you do not necessarily need. Modules which used defaulted dependencies thus sucked in
an enormous transitive dependency tree (filed separately in java/source) that made classpath scanning unnecessarily
slow, e.g. scanning a large subset of the java cluster when you merely opened a module from platform.

Checking whether NB JUnit is required is essentially free. Just add JUnit 4 as a dep. If error badges disappear, you are
done. If they remain, add NB JUnit (and set recursive) and they should then disappear. Upgrading a module this way takes
a minute at the most.
Comment 7 rmichalsky 2009-09-29 13:10:11 UTC
*** Issue 173256 has been marked as a duplicate of this issue. ***
Comment 8 Jesse Glick 2009-10-05 16:13:21 UTC
*** Issue 173396 has been marked as a duplicate of this issue. ***
Comment 9 Quality Engineering 2009-10-07 00:14:57 UTC
Integrated into 'main-golden', will be available in build *200910061401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/f94515626bf8
User: Jesse Glick <jglick@netbeans.org>
Log: Provide polite UI for adding JUnit 4 (and optionally NB JUnit) test dependencoes. See #171616.