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 195192 - Existing Java EE projects with no tests suddenly need Junit libraries
Summary: Existing Java EE projects with no tests suddenly need Junit libraries
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 7.0
Hardware: PC Windows XP
: P2 normal (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-08 18:55 UTC by chaase3
Modified: 2011-02-10 18:00 UTC (History)
1 user (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 chaase3 2011-02-08 18:55:44 UTC
The Java EE tutorial NetBeans projects use no tests. Suddenly in the current NetBeans nightly (netbeans-dev-201102080000 on Solaris SPARC and Windows), when I open a project, I get a Reference Problems complaint about missing junit and junit_4 libraries. 

Our projects do not need these libraries. I think there have been references to junit and junit_4 in the project.properties files all along, but NetBeans never complained about unresolved references until just now.

This is extremely annoying behavior. Can it please be reverted?

You can check out the projects by clicking the Subversion link at http://java.net/projects/javaeetutorial/pages/JavaEETutorialHome.
Comment 1 Jiri Rechtacek 2011-02-09 07:54:43 UTC
Jesse, another duplicate of issue 195123?
Comment 2 Jesse Glick 2011-02-09 14:09:52 UTC
NB 7.0 B2 does not bundle JUnit. If your projects have no tests, simply remove references to JUnit libraries from Test Dependencies (and delete any test source root).
Comment 3 chaase3 2011-02-09 14:54:40 UTC
Let me get this straight.

In order to "remove references to JUnit libraries from Test Dependencies (and delete any test source root)" I have to:

1. Right-click the project and choose Properties.
2. On the Sources page, select "test" under Test Package Folders and click Remove.
3. On the Libraries page, click the Compile Tests tab, select each of the two Junit libraries and click Remove.
4. Click OK.

Is that correct? I don't see any menu item for "Test Dependencies" anywhere.

Thank you.
Comment 4 Jesse Glick 2011-02-09 15:38:38 UTC
(In reply to comment #3)
> 1. Right-click the project and choose Properties.
> 2. On the Sources page, select "test" under Test Package Folders and click
> Remove.
> 3. On the Libraries page, click the Compile Tests tab, select each of the two
> Junit libraries and click Remove.
> 4. Click OK.

Correct. You probably also want to physically delete the (presumably empty) test subdir in the Files tab after unregistering it in Test Package Folders.

> I don't see any menu item for "Test Dependencies" anywhere.

There should be a node by that name in the Projects view; you can also right-click that to jump to the right panel for #3.
Comment 5 chaase3 2011-02-09 18:25:40 UTC
In the 2/3 build (I reverted to it to make these fixes), the nodes in a project that has a test directory are Test Packages and Test Libraries, not Test Dependencies. Has that changed?
Comment 6 Jesse Glick 2011-02-09 18:43:52 UTC
Sorry, Test Libraries then.
Comment 7 Jesse Glick 2011-02-10 18:00:22 UTC
By the way for newly created projects see bug #195254.