devdaily home | apple | java | perl | unix | directory | blog

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

<project default="test">
  <property name='testclass' value='tests.LocalTests'/>
  
  <path id="classpath">
    <pathelement location="build/delivery/classes"/>
    <pathelement location="build/test/classes"/>
    <pathelement location="build/delivery/files/WEB-INF/classes"/>
    <fileset dir="_ext">
      <include name="**/*.jar"/>
    </fileset>
    <fileset dir="_lib">
      <include name="**/*.jar"/>
    </fileset>
    <pathelement path="${java.class.path}"/>
  </path>

  <target name="init">
    <available property="junit.exists" 
      classname="junit.framework.TestSuite"/>
  </target>

  <target name="test-junit" if="junit.exists">
    <mkdir dir="_ext"/>
    <junit fork="yes" haltonfailure="yes" printsummary="yes" dir="build/test">
      <test name="${testclass}"/>
      <classpath refid="classpath"/>
      <formatter type="plain"/>
    </junit>
  </target>
  
  <target name="complain" unless="junit.exists">
    <echo message="Can not run 'junit' task (tests skipped) please add junit.jar to ANT_HOME/lib"/> 
  </target>

  <target name="test" depends="init,test-junit,complain"/>

</project>




Copyright 1998-2008 Alvin Alexander
All Rights Reserved.
 
devdaily.com is based in louisville, kentucky, and this web site is hosted by godaddy.com