Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Tools / February 2004

Tip: Looking for answers? Try searching our database.

JUnit not found...

Thread view: 
rami - 07 Feb 2004 21:42 GMT
Basically, I downloaded a shopping cart from the Internet and trying to make it work after downloading the necessary software.

The build.xml in the Framework\Lab directory (shoppinf cart)uses an external entity to basically import buildCommon.xml that is in the top directory. That file defines where many libraries like Xerces and Xalan should be found. I unzipped Xerces and Xalan to different directories then I either have to move them or modify buildCommon.xml to point to them.

I modified alot of buildCommom.xml to match my files. But there are few sections which I left them as they are maybe you could help me out.

The code below is quiet big. I couldn't reduce it less than that because I thought I would give you a clear picture of what buildCommon.xml includes. I've removed bits which I think are not related to Ant-Junit.

There are bits which are bold either need to be changed but don't know how or don't what they represent(in other words are they important to be there).

Thank you.

<property name="junitRoot" value="C:"/>

<property name="antDir" value="${antRoot}/apache-ant-1.6.0"/>
<property name="junitDir" value="${junitRoot}/apache-ant-1.6.0"/>

<property name="ant" value="${antDir}/lib/ant.jar"/>
<property name="buildDir" value="classes"/>
<property name="docDir" value="doc"/>
<property name="docRoot" value="docroot"/>
<property name="javadocDir" value="${docDir}/api"/>
<property name="junit" value="${junitDir}/lib/ant-junit.jar"/>
[B]<property name="libDir" value="lib"/>[/B]
[B]<property name="srcDir" value="src"/>[/B]
[B]<property name="util" value="Util/classes"/>[/B]

<target name="cleanTestLogs" description="deletes generated JUnit log files">
<delete>
<fileset dir=".">
<include name="TEST-*.txt"/> <!-- generated by the test target -->
</fileset>
</delete>
</target>

<target name="compile" depends="prepare" description="compiles source files">
[B]<javac srcdir="${srcDir}" destdir="${buildDir}"
classpathref="classpath" deprecation="on"/>
</target>[/B]

<target name="compileUtil" unless="utilCompiled"
description="compiles Util source files">
[B]<ant dir="../../Util" target="compile"/>
</target>[/B]

<target name="init" description="performs initialization steps">
<parallel>
[B]<available property="haveJUnit"
classpath="${junit}" classname="junit.framework.TestCase"/>
</parallel>[/B]
</target>

<target name="javadoc" depends="compile"
description="generates javadoc from all .java files">
<delete dir="${javadocDir}"/>
<mkdir dir="${javadocDir}"/>
<javadoc sourcepath="${srcDir}" destdir="${javadocDir}"
packagenames="com.*" classpathref="classpath"/>
</target>

<target name="prepare"
depends="init,verifyant-junit,verifyMySQL,verifyTomcat,verifyXalan,verifyXerces"
description="create output directories">
<parallel>
<mkdir dir="${buildDir}"/>
<mkdir dir="${docDir}"/>
<mkdir dir="${libDir}"/>
<available property="utilCompiled" file="Util/classes"/>
</parallel>
</target>

<target name="run" depends="compile" description="runs main class">
<java classname="${mainClass}" classpathref="classpath" fork="yes"/>
</target>

<target name="test" depends="compile,cleanTestLogs"
description="runs all ant-junit tests">
<ant-junit fork="yes" printsummary="yes">
<classpath refid="classpath"/>
<batchtest>
<fileset dir="${srcDir}">
<include name="**/*Test.java"/>
</fileset>
<formatter type="plain"/>
</batchtest>
</ant-junit>
</target>

<target name="verifyant-junit" unless="haveant-junit">
<fail message="ANT-JUnit not found in Ant's CLASSPATH!"/>
</target>

<target name="zip" description="zips files in this directory">
<zip zipfile="${zipFile}" basedir="."
excludes="${zipFile},${buildDir}/**,${javadocDir}/**"/>
</target
kaspar minosiants - 08 Feb 2004 21:31 GMT
> Basically, I downloaded a shopping cart from the Internet and trying to make it work after downloading the necessary software.
>
[quoted text clipped - 92 lines]
> excludes="${zipFile},${buildDir}/**,${javadocDir}/**"/>
> </target>

Probably you should put junit.jar in ant\lib dir
rami - 09 Feb 2004 21:05 GMT
It's already there that's what confuses me...


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.