This week's book giveaway is in the
General Computing
forum.
We're giving away four copies of
Arduino in Action
and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See
this thread
for details.
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Engineering
»
Ant, Maven and Other Build Tools
Author
Problem when including unit test cases in build
Rajesh Khan
Ranch Hand
Joined: Oct 16, 2011
Posts: 230
posted
Mar 02, 2012 22:56:22
0
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
Bartender
Joined: May 14, 2008
Posts: 5579
I like...
posted
Mar 03, 2012 19:07:21
0
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
I agree. Here's the link:
http://zeroturnaround.com/jrebel
- it saves me about five hours per week
subject: Problem when including unit test cases in build
Similar Threads
Ant + Junit + Log4J Problem
java.lang.classnotfoundexception in junit report
javadoc problem, using ant build file
Ant+JUnit
Howto run specific JUnit tests in ant?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter