build.xml
<?xml version="1.0" encoding="UTF-8"?>
 
<!-- =================================
 
	 This is a sample ant script that uses the CompareTwoFoldersAsUnitTest class
	 from the PDFC samples to compare the PDF files in two different folders as a JUnit test.
 
	 The folders must be specified via the system properties 'source_dir' and 'reference_dir'. 
	 This can be obtained by using the -D Java parameter ( -Dsource_dir=... -Dreference_dir=... ).
 
	 Furthermore the 'libraries_dir' system property should point to a directory
	 containing all necessary libraries for executing the CompareTwoFoldersAsUnitTest class. 
	 If the 'libraries_dir' property is not set, this ant script will use the current base 
	 directory as the library path.
 
	 The following libraries are required to run the CompareTwoFoldersAsUnitTest class.
		* all libraries in the PDFC.zip archive
		* the JUnit library
		* an archive containing the CompareTwoFoldersAsUnitTest class
 
     ================================= -->
 
<project basedir="." default="compare">
 
	<property environment="env"/>
 
	<!-- set the 'libraries_dir' property -->
	<condition property="libraries_dir" value="env.libraries_dir" else=".">
		<isset property="env.libraries_dir" />
	</condition>
 
	<path id="classpath">
		<fileset dir="${libraries_dir}">
		    <include name="**/*.jar" />
		</fileset>
	</path>
 
 
	<!-- ================================= 
 
          Executes the CompareTwoFoldersAsUnitTest class as a JUnit test and saves the results
          in the 'junit-reports' directory.
 
         ================================= -->
	<target name="compare" description="description">
		<mkdir dir="junit-reports"/>
 
		<junit fork="true" printsummary="yes" showoutput="true">
			<classpath>
				<path refid="classpath" />
			</classpath>
			<formatter type="xml" />
			<sysproperty key="currentFolder" value="${source_dir}" />
			<sysproperty key="referenceFolder" value="${reference_dir}" />
			<test name="samples.junit.CompareTwoFoldersAsUnitTest" todir="junit-reports" />
		</junit>
	</target>
 
</project>
 

© Copyright 1996 - 2012, i-net software; All Rights Reserved.