[pkg-java] r10195 - trunk/junit4/debian

Damien Raude-Morvan drazzib-guest at alioth.debian.org
Mon Aug 24 21:38:41 UTC 2009


Author: drazzib-guest
Date: 2009-08-24 21:38:41 +0000 (Mon, 24 Aug 2009)
New Revision: 10195

Added:
   trunk/junit4/debian/NEWS
   trunk/junit4/debian/README.Debian
Modified:
   trunk/junit4/debian/changelog
Log:
[junit4]

 * NEWS.Debian and README.Debian: explain usage of JUnit4 with Ant.
   Thanks for Antti-Juhani Kaijanaho <ajk at debian.org> for spotting this
   (Closes: #543327).



Added: trunk/junit4/debian/NEWS
===================================================================
--- trunk/junit4/debian/NEWS	                        (rev 0)
+++ trunk/junit4/debian/NEWS	2009-08-24 21:38:41 UTC (rev 10195)
@@ -0,0 +1,9 @@
+junit4 (4.7-2) unstable; urgency=low
+
+   Revert change done in 4.6-1 : don't install a symlink in ANT_HOME/lib directory
+    - This can cause unexpected behavior for people using both JUnit 3.x and JUnit 4.x
+    - This is not recommended by upstream
+
+   For usage of JUnit4 with ant, you should have a look at README.Debian.
+
+ -- Damien Raude-Morvan <drazzib at drazzib.com>  Mon, 24 Aug 2009 23:31:40 +0200

Added: trunk/junit4/debian/README.Debian
===================================================================
--- trunk/junit4/debian/README.Debian	                        (rev 0)
+++ trunk/junit4/debian/README.Debian	2009-08-24 21:38:41 UTC (rev 10195)
@@ -0,0 +1,56 @@
+Using JUnit4 with Ant
+=====================
+One of the common use case for JUnit is using it with Ant build system,
+as part of the build process of your source code.
+
+ Explanation
+ ------------
+To launch some JUnit4 TestCase from Ant, you need "ant" and "junit4" packages.
+
+You also need to add junit4.jar in nested <classpath> of your <junit> targets.
+There is no need to add it in CLASSPATH or to ANT_HOME/lib [1].
+
+  [1]
+  <URL:http://ant.apache.org/faq.html#delegating-classloader>
+  "As of Ant 1.7 <junit> no longer requires you to have junit.jar in Ant's
+   start-up classpath"
+
+  <URL:http://ant.apache.org/manual/install.html#librarydependencies>
+  "For example, as of Ant 1.7.0 you can run the <junit>  task without junit.jar
+   in Ant's own classpath, so long as it is included (along with your program
+   and tests) in the classpath passed when running the task.
+   Where possible, this option is generally to be preferred, as the Ant script
+   itself can determine the best path to load the library from"
+
+This strategy also prevent unwanted clash with junit 3.x : you can launch
+multiple junit target, each with it own classpath.
+
+For detailled history, you could see #512530 and #543327 in Debian BTS.
+
+
+ Sample
+ ------
+Here is a Ant snippet for JUnit4 usage :
+----------------------------------------------------------------
+<property name="main.classes" value="target/classes"/>
+<property name="test.classes" value="target/test-classes"/>
+<property name="lib.dir" value="/usr/share/java"/>
+
+<target name="test" depends="init, compile, compile-test">
+
+  <junit printsummary="yes" haltonfailure="yes" haltonerror="yes">
+
+    <classpath location="${main.classes}"/>
+    <classpath location="${test.classes}"/>
+    <classpath location="${lib.dir}/junit4.jar"/>
+
+    <formatter type="plain" />
+
+    <batchtest>
+      <fileset dir="${test.classes}" includes="**/*TestCase"/>
+    </batchtest>
+
+  </junit>
+
+</target>
+----------------------------------------------------------------

Modified: trunk/junit4/debian/changelog
===================================================================
--- trunk/junit4/debian/changelog	2009-08-24 17:10:44 UTC (rev 10194)
+++ trunk/junit4/debian/changelog	2009-08-24 21:38:41 UTC (rev 10195)
@@ -1,3 +1,11 @@
+junit4 (4.7-2) unstable; urgency=low
+
+  * NEWS.Debian and README.Debian: explain usage of JUnit4 with Ant.
+    Thanks for Antti-Juhani Kaijanaho <ajk at debian.org> for spotting this
+    (Closes: #543327).
+
+ -- Damien Raude-Morvan <drazzib at drazzib.com>  Mon, 24 Aug 2009 23:32:31 +0200
+
 junit4 (4.7-1) unstable; urgency=low
 
   * New upstream release.




More information about the pkg-java-commits mailing list