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
Ron McLeod
Paul Clapham
Tim Cooke
Devaka Cooray
Sheriffs:
Liutauras Vilda
paul wheaton
Rob Spoor
Saloon Keepers:
Tim Moores
Stephan van Hulst
Tim Holloway
Piet Souris
Mikalai Zaikin
Bartenders:
Carey Brown
Roland Mueller
Forum:
Other Build Tools
Problem when including unit test cases in build
Rajesh Khan
Ranch Hand
Posts: 230
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
HI i have the following build.xml
<?xml version="1.0"?> <project name="Ant-Test" default="main" basedir="."> <!-- Sets variables which can later be used. --> <!-- The value of a property is accessed via ${} --> <property name="src.dir" location="" /> <property name="build.dir" location="xbuild" /> <property name="dist.dir" location="xdist" /> <property name="docs.dir" location="xdocs" /> <!-- Variables used for JUnit testin --> <property name="test.dir" location="" /> <property name="test.report.dir" location="xtestreport" /> <!-- Deletes the existing build, docs and dist directory--> <target name="clean"> <delete dir="${build.dir}" /> <delete dir="${docs.dir}" /> <delete dir="${dist.dir}" /> <delete dir="${test.report.dir}" /> </target> <!-- Define the classpath which includes the junit.jar and the classes after compiling--> <path id="junit.class.path"> <pathelement location="junit.jar" /> <!--<pathelement location="lib/junit.jar" />--> <pathelement location="${build.dir}" /> </path> <!-- Creates the build, docs and dist directory--> <target name="makedir"> <mkdir dir="${build.dir}" /> <mkdir dir="${docs.dir}" /> <mkdir dir="${dist.dir}" /> <mkdir dir="${test.report.dir}" /> </target> <!-- Compiles the java code (including the usage of library for JUnit --> <target name="compile" depends="clean, makedir"> <javac srcdir="${src.dir}" destdir="${build.dir}"> <classpath refid="junit.class.path" /> </javac> </target> <!--Creates the deployable jar file --> <target name="jar" depends="compile"> <jar destfile="${dist.dir}\de.vogella.build.test.ant.jar" basedir="${build.dir}"> <manifest> <attribute name="Main-Class" value="test.Main" /> </manifest> </jar> </target> <target name="main" depends="compile, jar"> <description>Main target</description> </target> </project>
any idea where junit.jar should be included
Peter Johnson
author
Posts: 5856
7
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I don't understand the question. You already are including junit.jar in line 25.
What is it that you are doing and what problem are you running into?
JBoss In Action
Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Ant + Junit + Log4J Problem
java.lang.classnotfoundexception in junit report
Ant+JUnit
Howto run specific JUnit tests in ant?
javadoc problem, using ant build file
More...