Bug 27748 - JUnit import fails
Summary: JUnit import fails
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0.2   Edit
Hardware: Sun Solaris
: P3 normal (vote)
Target Milestone: 2.1 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-05 09:14 EST by William Davis CLA
Modified: 2002-12-06 09:16 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description William Davis CLA 2002-12-05 09:14:17 EST
Install eclipse and run it.
Create a source directory to hold project source.
Exit from eclipse.
Add source code under the source directory.
Start Eclipse and use File/Refresh.
Statement flagged as an error:
   import junit.framework.*;
Instructions for adding JUnit indicate that "run>run" should be used but there
is no "run>run" menu item.
I was going to unpack a copy of JUnit under the source directory, but looking in
JUnit properties, I find that JUnit support is already included.  Since it
already has JUnit support built in, it seems inappropriate to add what could be
a different version of JUnit by including it in CLASSPATH or Advanced Libraries.
Comment 1 Olivier Thomann CLA 2002-12-05 09:19:22 EST
You need to refer the JUnit project as a prerequisite of your project. Do so in
the Java build path dialog, otherwise junit packages are not seen from your project.
Could you please specify which build you used in order to reproduce the weird
message you got?
Thanks.
Comment 2 Philipe Mulet CLA 2002-12-06 05:32:37 EST
Eclipse has indeed some built-in JUnit facility, but it is not added to your 
classpath by default. Only java.lang.* is a free import in Java. This is the 
law.

Comment 3 Philipe Mulet CLA 2002-12-06 05:32:51 EST
Closing
Comment 4 William Davis CLA 2002-12-06 09:14:52 EST
Although java.lang.* may be the only default Java import, there are javax.* and 
other items found depending on the compiler installation.  I can see an 
advantage forcing the user to include something in CLASSPATH to specify which 
version of JUnit is being used because a normal compile would already do that. 
I have a version of JUnit that is used during compile outside of Eclipse, but 
my concern was for interactions with a JUnit that already seems to be in 
Eclipse.  As a side note, maybe a bugzilla issue, I received an email from 
Philippe's reply but not for the earlier one.
Comment 5 William Davis CLA 2002-12-06 09:16:50 EST
According to Help/About:
Version 2.0.2
Build ID 200211071448
It was the latest official release for Solaris when I downloaded it earlier 
this week.