Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Other Build Tools
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Other Build Tools
Ant+JUnit
Vladimir Bezugliy
Ranch Hand
Posts: 33
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I have
- jakarta-ant-1.5.1
- junit3.8.1
<project name="Tree" default="init" basedir="."> <property name="root.dir" location="${basedir}" /> <property name="src.dir" location="${root.dir}/src" /> <property name="build.dir" location="build" /> <property name="build.classes.dir" location="${build.dir}/classes" /> <property name="dist.dir" location="dist" /> <property name="src.dir" location="${root.dir}/src" /> <property name="test.dir" location="${build.dir}/test" /> <property name="test.classes.dir" location="${test.dir}/classes" /> <property name="junit.dir" location="${ant.home}/lib" /> <property name="junit.subdir" value="" /> <property name="junit.jar" location="${junit.dir}/${junit.subdir}/junit.jar" /> <path id="compile.classpath"> </path> <path id="test.classpath"> <path refid="compile.classpath" /> <pathelement location="${junit.jar}" /> <pathelement location="${build.classes.dir}" /> <pathelement location="${test.classes.dir}" /> </path> <target name="clean" description="Deletes all previous build artifacts"> <delete dir="${test.classes.dir}" /> <delete dir="${test.dir}" /> <delete dir="${build.classes.dir}" /> <delete dir="${build.dir}" /> <delete dir="${dist.dir}" /> </target> <target name="init"> <tstamp /> <mkdir dir="${build.dir}" /> <mkdir dir="${build.classes.dir}" /> <mkdir dir="${dist.dir}" /> <mkdir dir="${test.src.dir}" /> <mkdir dir="${test.dir}" /> <mkdir dir="${test.classes.dir}" /> </target> <target name="compile" depends="init"> <javac destdir="${build.classes.dir}" includeAntRuntime="yes" srcdir="${src.dir}"> <classpath refid="compile.classpath" /> <include name="**/*.java" /> <exclude name="**/*Test.java" /> <exclude name="**/*Tests.java" /> </javac> </target> <target name="test-compile" depends="compile"> <javac destdir="${test.classes.dir}" includeAntRuntime="yes" srcdir="${test.src.dir}"> <classpath refid="test.classpath" /> <include name="**/*Test.java" /> <include name="**/*Tests.java" /> </javac> </target> <target name="run-tests" depends="test-compile"> <junit printsummary="no"> <classpath refid="test.classpath" /> <batchtest todir="${test.data.dir}" unless="testcase"> <fileset dir="${test.classes.dir}" includes="**/*Test.class" /> </batchtest> </junit> </target> </project>
But wen I try to run target "run-tests" then I get error:
BUILD FAILED: C:\java\eclipse\workspace\Tree\build.xml:68: Could not create task or type of type: junit. Ant could not find the task or a class this task relies upon.
Where is the problem?
Vladimir Bezugliy
Ranch Hand
Posts: 33
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I have found the problem.
I use Eclipse 3.0.
And I run
ant
from Eclipse.
But their junit.jar is not supports <
junit
> task.
How can I say to Eclipse that it should use junit.jar from my installations of junit3.8.1?
Paul Sturrock
Bartender
Posts: 10336
I like...
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Change the runtime properties for Ant, via Preferences>Ant>Runtime.
JavaRanch FAQ
HowToAskQuestionsOnJavaRanch
Vladimir Bezugliy
Ranch Hand
Posts: 33
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Here is the answer on this problem -
Eclipse+Ant+JUnit
Hug your destiny! And hug this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Where is documentation for ant task schemaexport
Problem when including unit test cases in build
Howto run specific JUnit tests in ant?
javadoc problem, using ant build file
how to set a dir with ant
More...