<project xmlns:au="antlib:org.apache.ant.antunit">
	<import file="macros.ant"/>

	<!-- CHARACTERIZATION TESTS -->
	
	<target name="testCharacterize_DistGeneratesJavadoc">
		<ant antfile="build.xml" target="dist" dir="${junitdir}">
			<property name="dist" value="${antdist}" />
			<property name="javadocdir" value="${antdist}/ant-unit-java-docs" />
		</ant>

		<au:assertFileExists file="${antdistdir}/ant-unit-java-docs" />
	</target>
	
	<target name="testCharacterize_DistRunsTests">
		<ant antfile="build.xml" target="dist" dir="${junitdir}">
			<property name="dist" value="${antdist}" />
		</ant>

		<au:assertLogContains text="Time:" />
	</target>
	
	<target name="testCharacterize_PopulateCopiesSamplesAndTests">
		<junitbuild target="populate-dist" />
		<au:assertFileExists file="${antdistdir}/junit/samples" />
		<au:assertFileExists file="${antdistdir}/junit/tests" />
		<au:assertFileExists file="${antdistdir}/org/junit/samples" />
		<au:assertFileExists file="${antdistdir}/org/junit/tests" />
	</target>

	<target name="testCharacterize_PopulateGeneratesSrcJar">
		<junitbuild target="populate-dist" />
		<au:assertFileExists file="${srcjarfile}" />
	</target>

	<!-- DRIVING TESTS -->
	
	<target name="testPopulateDoesntRecursivelyInclude">
		<junitbuild target="populate-dist" />
		<au:assertFileDoesntExist file="${antdistdir}/${antdist}" />
	</target>
	
	<target name="testPopulateDoesntIncludeSamplesInJUnitJar">
		<junitbuild target="populate-dist" />
		<au:assertFalse>
			<available classname="org.junit.tests.AllTests"
			           classpath="${binjarfile}"
			/>
		</au:assertFalse>
	</target>
</project>