package junit.framework does not exist [message #169583] |
Tue, 05 September 2006 14:43 |
Eclipse User |
|
|
|
Originally posted by: Robert.cross.ngc.com
Hello
Just started using Eclipse recently. Installed version 3.1.1, Windows
environment.
I'm trying to generate some Junit test cases by running Ant on a build
xml file in the eclipse IDE. All is well if I don't try to generate the
junit test cases in the build.xml file code. As soon as I want to generate
junit test cases, I recieve the following error:
package junit.framework does not exist
Any help here would appreciated.
Thanks
Bob
|
|
|
Re: package junit.framework does not exist [message #169717 is a reply to message #169583] |
Wed, 06 September 2006 06:37 |
Eclipse User |
|
|
|
Originally posted by: joensson.gmail.com
Robert.cross@ngc.com (Robert Cross) wrote in
news:8f7ba351b19f71a2435dd81b054d6c1a$1@www.eclipse.org:
> package junit.framework does not exist
>
> Any help here would appreciated.
In order for code completion in eclipse to function you must make sure that
junit.jar is on your build classpath. You should be able to find a
junit.jar in the eclipse/plugins/org.junit_<version> folder - or you can
download it from junit.org.
The build classpath in Eclipse and the classpaths in your ant build.xml
file are not synchronized. Therefore you also have to include junit.jar on
your classpath in your ant scripts. The simplest solution is to copy
junit.jar to your $ANT_HOME/lib folder (ant-junit.jar must also exist in
the lib folder). This will ensure that the junit tasks can run smoothly.
You could also do something like
<path id="classpath.compile">
<fileset dir="thirdparty/lib/" includes="*.jar" />
<!-- junit.jar could be located in here -->
...
</path>
When you use the javac task - just insert a nested classpath and use the
above id as refid attribute value.
<javac debug="true" debuglevel="lines,vars,source" srcdir="${test.src.dir}"
destdir="${test.build.dir}">
<classpath refid="classpath.compile" />
</javac>
|
|
|
Powered by
FUDForum. Page generated in 0.03444 seconds