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 202593 - Missing JUnit dependencies even after installing module
Summary: Missing JUnit dependencies even after installing module
Status: RESOLVED DUPLICATE of bug 198739
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.1
Hardware: PC Windows 7
: P2 normal with 1 vote (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-23 21:34 UTC by javydreamercsw
Modified: 2011-09-28 16:36 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Error when trying to fix from context actions (9.02 KB, image/png)
2011-09-23 21:36 UTC, javydreamercsw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description javydreamercsw 2011-09-23 21:34:12 UTC
Product Version = NetBeans IDE 7.1 Beta (Build 201109222201)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.7.0
Runtime = Java HotSpot(TM) Client VM 21.0-b17

I installed the Beta version of 7.1 from a zip distro on a new user dir. I was prompted to download the JUnit module and I did. Opened a NetBeans module with unit tests and is unable to add the dependencies.

I know I've seen this issue before.
Comment 1 javydreamercsw 2011-09-23 21:36:50 UTC
I checked and this also happens on the daily builds.
Comment 2 javydreamercsw 2011-09-23 21:36:56 UTC
Created attachment 111122 [details]
Error when trying to fix from context actions
Comment 3 Tomas Danek 2011-09-26 09:45:13 UTC
We tried to reproduce according your steps on W7:
- unzip beta build
- have empty userdir
- do not import settings from 7.0 at startup
- confirm install of junit on startup
- open (previously created) sample project Anagram game, which has reference to JUnit

---> everything works as supposed, no broken referencies

Could you please describe more detailed step-by-step what actions do you take?
And please attach you messages.log.
Comment 4 javydreamercsw 2011-09-26 11:54:19 UTC
I think the difference is that the Anagram game is a plain Java project, it happened to me in a module project with defined unit tests.

"Opened a NetBeans module with unit tests"
Comment 5 Antonin Nebuzelsky 2011-09-26 12:53:56 UTC
Just guessing - junit libs are installed into userdir and thus the target platform is missing it?

Jesse, is this a bug or does this require a user action to fix the missing dep?
Comment 6 Jesse Glick 2011-09-26 13:19:27 UTC
(In reply to comment #5)
> junit libs are installed into userdir and thus the target
> platform is missing it?

That is the most common explanation; that bug is filed in installer (P3 but should probably be P2), but this user claims to have used a ZIP distro. Of course the same issue could apply in case the ZIP was unpacked as root and the NB user cannot write to the install dir, though I guess that is less likely.

> does this require a user action to fix the missing dep?

The target platform must include the org.netbeans.libs.junit4 module. Installing the JUnit plugin from the IDE's Plugin Manager will have an effect only if the module is using the default platform. Otherwise this step has to be done from the target platform. There is enough information given in the bug description to tell what the actual setup was.
Comment 7 javydreamercsw 2011-09-26 17:49:31 UTC
This is not the case as it is a stand alone module. No special platforms.

JUnit is installed in the user dir under the modules folder (with the JUnit libraries in modules/ext) so everything seems fine from the installation perspective.
Comment 8 mago_ebon 2011-09-26 18:19:31 UTC
Same for me... With Windows 7 Professional, JDK 1.0.6_26-b03.

I reinstalled from a previous nightly build that worked fine.
Comment 9 Jesse Glick 2011-09-26 18:55:53 UTC
(In reply to comment #7)
> This is not the case as it is a stand alone module.

What is not the case?

> No special platforms.

So, using the default platform? Then installing the "JUnit" library from the same IDE's Plugin Manager should suffice. Make sure it is really installed - check Library Manager for the 3.x & 4.x libraries, check the installation dir in the platform and java clusters for the expected files, check the log message for any errors, etc. etc.

> JUnit is installed in the user dir under the modules folder (with the JUnit
> libraries in modules/ext)

Then this is the well-known restriction that you cannot use JUnit for module development unless it is in the installation proper. Perhaps your installation was read-only when you tried to install it.

*** This bug has been marked as a duplicate of bug 198739 ***
Comment 10 javydreamercsw 2011-09-27 19:50:40 UTC
I'm replying to comment 6 where it points out that it can happen if I'm using a custom platform which I'm not.

Yes, it is default platform. It shows fine in the Plugin screen and the files are there in the user dir. No errors found.

Again, I'm using the zip distro, so there's no installation.

So JUnit needs to be installed in the shared directories (i.e. the platform itself)? If that's the case that's an issue since that's not the default and the prompt at IDE start up would use the default.

The installer might force it to be installed in the correct place, but using Plugin window or the prompt at IDE start (when is not installed yet) does not. I disagree this is a duplicate of #19873 unless it also covers zip distro and Plugin screen scenarios.
Comment 11 Jesse Glick 2011-09-28 16:36:09 UTC
(In reply to comment #10)
> the files are there in the user dir

That is the problem. The "JUnit" plugin must be installed in the IDE installation, not the user dir, for it to work with Ant-based NBM development.

> JUnit needs to be installed in the shared directories (i.e. the platform
> itself)?

Correct.

> If that's the case that's an issue

For which see bug #198739. There is a partial workaround in dev builds.

> that's not the default

It is the default, unless you lack write access to the IDE installation dir when installing the plugin. Currently the GUI fails to warn you that it is forced to fall back to the user dir, which is an issue.

> I disagree this is a duplicate of #19873 unless it also covers zip distro

It can, though it seems less likely that someone using the ZIP distro would unpack it into a read-only location, whereas this seems to be a common choice for installer users (esp. on Win 7).

*** This bug has been marked as a duplicate of bug 198739 ***