daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Jul 11th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?xml version="1.0"?>
  2. <!-- ********************************************************* -->
  3. <!-- ** Tests                                               ** -->
  4. <!-- **                                                     ** -->
  5. <!-- ** @author Jeff Rafter                                 ** -->
  6. <!-- ** @version 0.1                                        ** -->
  7. <!-- ********************************************************* -->
  8. <project name="sync" default="test">    
  9.   <property name="lib.dir" location="../lib" />
  10.   <property name="build.dir" location="../build" />
  11.   <property name="dist.dir" location="../dist" />
  12.   <property name="test.dir" location="build" />
  13.   <property name="lib-common.dir" location="../lib-common" />
  14.  
  15.   <available file="../lib-common" type="dir" property="lib-common.present"/>
  16.  
  17.   <target name="test-default" unless="lib-common.present">
  18.     <path id="classpath">
  19.       <pathelement location="${test.dir}"/>
  20.       <pathelement location="${build.dir}"/>
  21.       <pathelement location="${dist.dir}"/>
  22.       <fileset dir="${lib.dir}">
  23.         <include name="**/*.jar" />
  24.       </fileset>
  25.     </path>    
  26.   </target>
  27.  
  28.   <target name="test-common" if="lib-common.present">
  29.     <path id="classpath">
  30.       <pathelement location="${test.dir}"/>
  31.       <pathelement location="${build.dir}"/>
  32.       <pathelement location="${dist.dir}"/>
  33.       <fileset dir="${lib.dir}">
  34.         <include name="**/*.jar" />
  35.       </fileset>
  36.       <fileset id="lib-common.files" dir="${lib-common.dir}">
  37.         <include name="**/*.jar" />
  38.       </fileset>
  39.     </path>    
  40.   </target>
  41.  
  42.   <target name="test-clean">
  43.     <!-- Clean out the old test class build area -->
  44.     <delete dir="build" />
  45.   </target>  
  46.  
  47.   <target name="test-build" depends="test-default,test-common" >
  48.     <!-- Setup the new test target -->
  49.     <mkdir dir="build" />
  50.  
  51.     <!-- Copy over the log4j.xml so that it is used -->
  52.         <copy todir="build/">
  53.             <fileset dir="metadata/" includes="**/*" />
  54.         </copy>
  55.  
  56.     <!-- Compile the tests -->
  57.     <javac destdir="build" debug="true" debuglevel="lines,source,vars">
  58.       <classpath refid="classpath" />
  59.       <src path="." />
  60.       <include name="**/*.java" />
  61.     </javac>
  62.   </target>
  63.  
  64.   <target name="test" depends="test-default,test-common,test-clean,test-build" >
  65.     <!-- Run the units -->
  66.     <junit printsummary="true" haltonfailure="false" failureProperty="test.failure">
  67.       <!-- formatter type="plain" usefile="false"/ -->
  68.       <classpath refid="classpath" />
  69.       <!-- ant test -Dtestcase=<fully qualified classname> -->
  70.       <test name="${testcase}" if="testcase"/>
  71.       <batchtest fork="no" unless="testcase">
  72.         <fileset dir="build">
  73.           <include name="**/*Test.class"/>
  74.                 <exclude name="**/*BaseTest*" />
  75.                 <exclude name="**/*TestHelper*" />
  76.         </fileset>
  77.       </batchtest>
  78.     </junit>
  79.    
  80.     <!-- Fail the ant build if a test failed -->
  81.     <fail message="test failed" if="test.failure" />
  82.   </target>
  83. </project>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top