CVS: junit/build/experimental-use-of-antunit junit-slow.ant, 1.3, 1.4 junit.properties, 1.2, 1.3 macros.ant, 1.2, 1.3 junit.ant, 1.3, 1.4

David Saff <[email protected]> Mon, 02 Jul 2007 11:11:42 -0700
Newsgroups gmane.comp.java.junit.devel
Message-ID <[email protected]>
Update of /cvsroot/junit/junit/build/experimental-use-of-antunit
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27902/build/experimental-use-of-antunit

Modified Files:
	junit-slow.ant junit.properties macros.ant junit.ant 
Log Message:
- The hamcrest-core-1.1 library is now included in the JUnit distribution.  For more hamcrest matchers, see the hamcrest-library jar from http://code.google.com/p/hamcrest
- The Popper Theory runner (http://popper.tigris.org) has been absorbed into the JUnit project, under the package name org.junit.experimental.theories
- Several additional libraries used in the theories tests have been added in a new testlib directory

- New "assertThat" statement to work with hamcrest matchers:

// same as assertEquals(3, x)
assertThat(x, is(3));

// same as assertNull(y)
assertThat(y, nullValue());

- New feature: assumeThat.  A failed assumption will cause the test to pass, without further execution.  (The behavior of assumeThat may change in the future to allow richer reporting of tests that are skipped because of failed assumptions)

// pass on any non-Windows system
@Test public void getRootDrive() {
  assumeThat(getOsString(), is("Windows"));
  getFile("C:\");
  // ...
}

- Convenience assumption functions:

// none of these are null
assumeNotNull(a, b, c);
assumeTrue(everythingOk());

try {
  getDatabaseConnection();
} catch (Exception e) {
  assumeNoException(e);
}

- Documentation fixed for many assertEquals array methods

- Two bugs in numeric equality fixed:

1718905: assertEquals does not compare float correctly
1715326: assertEquals does not compare java.math.BigDecimal properly

- The protocol for overriding JUnit4ClassRunner has changed again.  Please see the source for details.

- Extenders can now extend TestMethod to describe the behavior of running methods that do not have a @Test annotation.

- Adding Annotations to Description caused a binary compatibility problem with clients compiled on previous JUnit versions.  This has been fixed.

Index: junit-slow.ant
===================================================================
RCS file: /cvsroot/junit/junit/build/experimental-use-of-antunit/junit-slow.ant,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- junit-slow.ant	26 Apr 2007 20:21:21 -0000	1.3
+++ junit-slow.ant	2 Jul 2007 18:11:09 -0000	1.4
@@ -28,6 +28,11 @@
 		<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">

Index: junit.properties
===================================================================
RCS file: /cvsroot/junit/junit/build/experimental-use-of-antunit/junit.properties,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- junit.properties	26 Apr 2007 20:21:21 -0000	1.2
+++ junit.properties	2 Jul 2007 18:11:09 -0000	1.3
@@ -5,4 +5,5 @@
 exttestjavadoczip=${junitdir}/${testjavadoczip}
 tempdir=tempdir
 test.jarfile=junit-test.version.jar
-test.srcjarfile=junit-test.version-src.jar
\ No newline at end of file
+test.srcjarfile=junit-test.version-src.jar
+test.hamcrestsrc=${antdist}/temp-hamcrest-for-ant-unit
\ No newline at end of file

Index: macros.ant
===================================================================
RCS file: /cvsroot/junit/junit/build/experimental-use-of-antunit/macros.ant,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- macros.ant	26 Apr 2007 20:21:21 -0000	1.2
+++ macros.ant	2 Jul 2007 18:11:09 -0000	1.3
@@ -14,6 +14,7 @@
 
 	<macrodef name="junitbuild">
 		<attribute name="target" />
+		<attribute name="javadocpackages" default="org.junit"/>
 		<sequential>
 			<ant antfile="build.xml" target="@{target}" dir="${junitdir}">
 				<property name="dist" value="${antdist}" />
@@ -21,9 +22,10 @@
 				          value="${antdist}/ant-unit-java-docs"
 				/>
 				<property name="javadoczip" value="${testjavadoczip}" />
-				<property name="javadocpackages" value="org.junit" />
+				<property name="javadocpackages" value="@{javadocpackages}" />
 				<property name="binjar" value="${test.jarfile}" />
 				<property name="srcjar" value="${test.srcjarfile}" />
+				<property name="hamcrestsrc" value="${test.hamcrestsrc}" />
 			</ant>
 		</sequential>
 	</macrodef>

Index: junit.ant
===================================================================
RCS file: /cvsroot/junit/junit/build/experimental-use-of-antunit/junit.ant,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- junit.ant	26 Apr 2007 20:21:21 -0000	1.3
+++ junit.ant	2 Jul 2007 18:11:09 -0000	1.4
@@ -82,11 +82,6 @@
 		<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" />
@@ -94,16 +89,39 @@
 		<au:assertFileExists file="${antdistdir}/org/junit/samples" />
 		<au:assertFileExists file="${antdistdir}/org/junit/tests" />
 	</target>
+
+	<!-- TODO: shotgun to pass in hamcrestsrc -->
+	<target name="testCharacterize_UnjarHamcrestGeneratesSource">
+		<junitbuild target="unjar.hamcrest" />
+		
+		<!-- TODO: confused about where this directory is -->
+		<au:assertFileExists file="${junitdir}/${test.hamcrestsrc}/org/hamcrest" />
+	</target>
 	
 	<!-- DRIVING TESTS -->
 
-	<target name="testJavaDocZip">
+	<target name="testJavaDocZipCreatesOrgDir">
 		<junitbuild target="javadoczip" />
 		<au:assertFileExists file="${exttestjavadoczip}" />
 		<unzip.exttestjavadoczip />
 		<au:assertFileExists file="${tempdir}/org" />
 	</target>
+	
+	<!-- TODO: what hamcrest packages do I need? -->
 
+	<!-- TODO DUP above -->
+	<target name="testJavaDocZipCreatesHamcrestDir">
+		<junitbuild target="javadoczip" javadocpackages="org.junit, org.hamcrest.core" />
+		<au:assertFileExists file="${exttestjavadoczip}" />
+		<unzip.exttestjavadoczip />
+		<au:assertFileExists file="${tempdir}/org/hamcrest" />
+	</target>
+
+	<target name="testJavaDocHasNoErrors">
+		<junitbuild target="javadoc" />
+		<au:assertLogDoesntContain text="does not exist" />
+	</target>
+	
 	<target name="testJavaDocZipDeletedOnClean">
 		<touch file="${exttestjavadoczip}" />
 		<junitbuild target="clean" />


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/