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 170257 - Exception whenever I place caret to a Unit test
Summary: Exception whenever I place caret to a Unit test
Status: VERIFIED FIXED
Alias: None
Product: installer
Classification: Unclassified
Component: Debian (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Yulia Novozhilova
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-12 10:34 UTC by Petr Dvorak
Modified: 2009-08-18 12:56 UTC (History)
4 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 Petr Dvorak 2009-08-12 10:34:23 UTC
Product Version: NetBeans IDE 6.7.1 (Build 090807)
Java: 1.6.0_0; OpenJDK Client VM 14.0-b16
System: Linux version 2.6.31-3-generic running on i386; UTF-8; en_US (nb)

0. Install NB from Ubuntu 9.10 debs
1. Create a new Java Application
-> main class with main method is created by default

2. Right-click the main class, invoke Tools>Create JUnit Test
3. Leave version 4 checked, click Select, click OK
4. Click anywhere in the generated test source
-> Exception shows up:

SEVERE [org.openide.util.Exceptions]
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for org.hamcrest.Matcher not found

(... that's everything...)
Comment 1 pribyl 2009-08-12 13:47:23 UTC
Yes, this happened to me as well while testing JUnit with the Ubuntu 9.10
I reported this using the Exceptions Reporter - there is already an issue 146026 with the same stacktrace

In my case, the JUnit test was created successfully and was working correctly. However, the red Error icon was still
present and I could not get rid of it. 

As I said - the test was working, but the everlasting Error was really annoying.  
Comment 2 Vitezslav Stejskal 2009-08-12 16:20:51 UTC
Could you please attach here the generated test class?

org.hamcrest.Matcher - belongs to http://code.google.com/p/hamcrest/ project. I'm not sure why Netbeans generated test
class needs it. But maybe there is something broken in the junit or hamcrest packages installed in your Ubuntu. Do the
tests compile and run when you use just commandline and ant?
Comment 3 Yulia Novozhilova 2009-08-12 16:33:16 UTC
Thank you for the report.
The problem is that Ubuntu Karmic contains junit4 version 4.6 whereas NetBeans requires 4.5.
I'll see if I can work it out.
Comment 4 mslama 2009-08-12 16:35:23 UTC
There is libhamcrest-java package in karmic. It looks like they removed hamcrest from junit 4.6 in karmic so it is
necessary to add dependency on libhamcrest-java into platform IMO. NB uses junit 4.5 in nromal build.
Comment 5 Michael Nazarov 2009-08-18 12:49:29 UTC
fixed
Comment 6 Michael Nazarov 2009-08-18 12:56:43 UTC
Build installed Aug 18, 2009 from newly created packages.