CVS: junit/experimental-use-of-antunit junit.ant, 1.1, 1.2

David Saff <[email protected]>
Newsgroups gmane.comp.java.junit.devel
Message-ID <[email protected]>
Update of /cvsroot/junit/junit/experimental-use-of-antunit
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv851/experimental-use-of-antunit

Modified Files:
	junit.ant 
Log Message:
Added javadoczip target to build.xml, and some better separation in build.xml while I'm at it.

Index: junit.ant
===================================================================
RCS file: /cvsroot/junit/junit/experimental-use-of-antunit/junit.ant,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- junit.ant	21 Feb 2007 18:25:21 -0000	1.1
+++ junit.ant	27 Feb 2007 17:51:30 -0000	1.2
@@ -1,8 +1,11 @@
 <project xmlns:au="antlib:org.apache.ant.antunit">
 	<property name="junitdir" value=".." />
-	<property name="antdist" value="temp-dist-directory-for-ant-unit"></property>
-	<property name="antdistdir" value="${junitdir}/${antdist}"/>
-
+	<property name="antdist" value="temp-dist-directory-for-ant-unit">
+	</property>
+	<property name="antdistdir" value="${junitdir}/${antdist}" />
+	<property name="testjavadoczip" value="new-england-javadoc.zip" />
+	<property name="exttestjavadoczip" value="${junitdir}/${testjavadoczip}" />
+	<property name="tempdir" value="tempdir" />
 	
 	<!-- is called prior to the test -->
 	<target name="setUp">
@@ -11,20 +14,51 @@
 	<!-- is called after the test, even if that caused an error -->
 	<target name="tearDown">
 		<delete dir="${antdistdir}" />
+		<delete dir="${tempdir}" />
+		<delete file="${exttestjavadoczip}" />
 	</target>
 
+	<macrodef name="junitbuild">
+		<attribute name="target" />
+		<sequential>
+			<ant antfile="build.xml" target="@{target}" dir="${junitdir}">
+				<property name="dist" value="${antdist}" />
+				<property name="javadocdir"
+				          value="${antdist}/ant-unit-java-docs"
+				/>
+				<property name="javadoczip" value="${testjavadoczip}" />
+			</ant>
+		</sequential>
+	</macrodef>
+
 	<target name="testTearDown">
-		<mkdir dir="${antdistdir}"/>
+		<mkdir dir="${antdistdir}" />
+		<mkdir dir="${tempdir}" />
+		<touch file="${exttestjavadoczip}" />
+		
 		<antcall target="tearDown" />
+		
 		<au:assertFileDoesntExist file="${antdistdir}" />
+		<au:assertFileDoesntExist file="${tempdir}" />
+		<au:assertFileDoesntExist file="${exttestjavadoczip}" />
 	</target>
 
-	<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>
-
+	<target name="testCharacterize_PopulateDistGeneratesJavadoc">
+		<junitbuild target="populate-dist" />
 		<au:assertFileExists file="${antdistdir}/ant-unit-java-docs" />
 	</target>
+
+	<target name="testJavaDocZip">
+		<junitbuild target="javadoczip" />
+		<au:assertFileExists file="${exttestjavadoczip}" />
+
+		<unzip dest="tempjavadoc" src="${exttestjavadoczip}" />
+		<au:assertFileExists file="tempjavadoc/org" />
+	</target>
+
+	<target name="testJavaDocZipDeletedOnClean">
+		<touch file="${exttestjavadoczip}" />
+		<junitbuild target="clean" />
+		<au:assertFileDoesntExist file="${exttestjavadoczip}" />
+	</target>
 </project>
\ No newline at end of file


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.