From: David S. <ds...@us...> - 2007-03-27 19:00:55
|
Update of /cvsroot/junit/junit/build/experimental-use-of-antunit In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27118/build/experimental-use-of-antunit Modified Files: Tag: Version431 macros.ant junit.properties junit-slow.ant junit.ant Log Message: [Junit-trackers] [ junit-Bugs-1686931 ] JUnit 4.3 contains samples and tests in junit-4.3[-src].jar Index: macros.ant =================================================================== RCS file: /cvsroot/junit/junit/build/experimental-use-of-antunit/macros.ant,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -d -r1.1 -r1.1.2.1 --- macros.ant 20 Mar 2007 14:12:23 -0000 1.1 +++ macros.ant 27 Mar 2007 19:00:43 -0000 1.1.2.1 @@ -22,6 +22,8 @@ /> <property name="javadoczip" value="${testjavadoczip}" /> <property name="javadocpackages" value="org.junit" /> + <property name="binjar" value="${test.jarfile}" /> + <property name="srcjar" value="${test.srcjarfile}" /> </ant> </sequential> </macrodef> Index: junit.properties =================================================================== RCS file: /cvsroot/junit/junit/build/experimental-use-of-antunit/junit.properties,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -d -r1.1 -r1.1.2.1 --- junit.properties 10 Mar 2007 07:10:32 -0000 1.1 +++ junit.properties 27 Mar 2007 19:00:43 -0000 1.1.2.1 @@ -3,4 +3,6 @@ antdistdir=${junitdir}/${antdist} testjavadoczip=new-england-javadoc.zip exttestjavadoczip=${junitdir}/${testjavadoczip} -tempdir=tempdir \ No newline at end of file +tempdir=tempdir +test.jarfile=junit-test.version.jar +test.srcjarfile=junit-test.version-src.jar \ No newline at end of file Index: junit-slow.ant =================================================================== RCS file: /cvsroot/junit/junit/build/experimental-use-of-antunit/junit-slow.ant,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- junit-slow.ant 20 Mar 2007 14:12:23 -0000 1.2 +++ junit-slow.ant 27 Mar 2007 19:00:43 -0000 1.2.2.1 @@ -1,12 +1,8 @@ <project xmlns:au="antlib:org.apache.ant.antunit"> <import file="macros.ant"/> - <target name="testTearDown"> - <mkdir dir="${antdistdir}"/> - <antcall target="tearDown" /> - <au:assertFileDoesntExist file="${antdistdir}" /> - </target> - + <!-- CHARACTERIZATION TESTS --> + <target name="testCharacterize_DistGeneratesJavadoc"> <ant antfile="build.xml" target="dist" dir="${junitdir}"> <property name="dist" value="${antdist}" /> @@ -23,4 +19,28 @@ <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> + + <!-- 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> \ No newline at end of file Index: junit.ant =================================================================== RCS file: /cvsroot/junit/junit/build/experimental-use-of-antunit/junit.ant,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- junit.ant 20 Mar 2007 14:12:23 -0000 1.2 +++ junit.ant 27 Mar 2007 19:00:43 -0000 1.2.2.1 @@ -1,6 +1,11 @@ <project xmlns:au="antlib:org.apache.ant.antunit"> - <import file="macros.ant"/> + <import file="macros.ant" /> + <property name="binjarfile" value="${antdistdir}/${test.jarfile}" /> + <property name="srcjarfile" value="${antdistdir}/${test.srcjarfile}" /> + + <!-- MACROS --> + <macrodef name="sizeOfDir"> <attribute name="property.name" /> <sequential> @@ -26,6 +31,14 @@ </sequential> </macrodef> + <macrodef name="unzip.exttestjavadoczip"> + <sequential> + <unzip dest="${tempdir}" src="${exttestjavadoczip}" /> + </sequential> + </macrodef> + + <!-- TEST FIXTURE TESTS --> + <target name="testTearDown"> <mkdir dir="${antdistdir}" /> <mkdir dir="${tempdir}" /> @@ -38,23 +51,18 @@ <au:assertFileDoesntExist file="${exttestjavadoczip}" /> </target> - <target name="testCharacterize_JavadocGeneratesJavadoc"> - <junitbuild target="javadoc" /> - <au:assertFileExists file="${antdistdir}/ant-unit-java-docs" /> - </target> - - <target name="testJavaDocZip"> - <junitbuild target="javadoczip" /> - <au:assertFileExists file="${exttestjavadoczip}" /> - - <antcall target="unzip.exttestjavadoczip" /> - <au:assertFileExists file="${tempdir}/org" /> + <target name="testCharacterize_DirSizeChanges"> + <dirSizeChanges property.name="changed"> + <mkdir dir="${tempdir}" /> + <echo message="h" file="${tempdir}/whatever.txt" /> + </dirSizeChanges> + <au:assertPropertySet name="changed" /> </target> - + <target name="testUnzipOnlyCreatesDirectoryCleanedByTeardown"> <dirSizeChanges property.name="changed"> <junitbuild target="javadoczip" /> - <antcall target="unzip.exttestjavadoczip" /> + <unzip.exttestjavadoczip /> <antcall target="tearDown" /> </dirSizeChanges> <au:assertFalse> @@ -62,16 +70,38 @@ </au:assertFalse> </target> - <target name="testCharacterize_DirSizeChanges"> - <dirSizeChanges property.name="changed"> - <mkdir dir="${tempdir}" /> - <echo message="h" file="${tempdir}/whatever.txt" /> - </dirSizeChanges> - <au:assertPropertySet name="changed" /> + <!-- CHARACTERIZATION TESTS DURING REFACTORING --> + + <target name="testCharacterize_JavadocGeneratesJavadoc"> + <junitbuild target="javadoc" /> + <au:assertFileExists file="${antdistdir}/ant-unit-java-docs" /> </target> - <target name="unzip.exttestjavadoczip"> - <unzip dest="${tempdir}" src="${exttestjavadoczip}" /> + <target name="testCharacterize_PopulateGeneratesJUnitJar"> + <junitbuild target="populate-dist" /> + <au:assertFileExists file="${binjarfile}" /> + </target> + + <target name="testCharacterize_PopulateGeneratesSrcJar"> + <junitbuild target="populate-dist" /> + <au:assertFileExists file="${srcjarfile}" /> + </target> + + <target name="testCharacterize_PopulateCopiesSamplesAndTests"> + <junitbuild target="samples-and-tests" /> + <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> + + <!-- DRIVING TESTS --> + + <target name="testJavaDocZip"> + <junitbuild target="javadoczip" /> + <au:assertFileExists file="${exttestjavadoczip}" /> + <unzip.exttestjavadoczip /> + <au:assertFileExists file="${tempdir}/org" /> </target> <target name="testJavaDocZipDeletedOnClean"> @@ -79,4 +109,14 @@ <junitbuild target="clean" /> <au:assertFileDoesntExist file="${exttestjavadoczip}" /> </target> + + <!-- [Junit-trackers] [ junit-Bugs-1686931 ] JUnit 4.3 contains samples and tests in junit-4.3[-src].jar --> + <target name="testJarsDoesntIncludeSamplesInJUnitJar"> + <junitbuild target="jars" /> + <au:assertFalse> + <available classname="org.junit.tests.AllTests" + classpath="${binjarfile}" + /> + </au:assertFalse> + </target> </project> \ No newline at end of file |