ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgl...@apache.org
Subject svn commit: r382127 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
Date Wed, 01 Mar 2006 19:13:17 GMT
Author: jglick
Date: Wed Mar  1 11:13:16 2006
New Revision: 382127

URL: http://svn.apache.org/viewcvs?rev=382127&view=rev
Log:
Tweak: in case junit-3.8.1.jar and junit-4.0.jar are on CP but in that
order, and running JDK 1.4-, at least run JUnit 3.x tests.

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java?rev=382127&r1=382126&r2=382127&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
Wed Mar  1 11:13:16 2006
@@ -266,8 +266,12 @@
 
             try {
                 Class junit4TestAdapterClass = null;
-                // Note that checking for JDK 5 directly won't work; under JDK 4, this will
already have failed.
+                // Check for JDK 5 first. Will *not* help on JDK 1.4 if only junit-4.0.jar
in
+                // CP because in that case linkage of whole task will already have
+                // failed! But will help if CP has junit-3.8.1.jar:junit-4.0.jar.
+                // In that case first C.fN will fail with CNFE and we will avoid UnsupportedClassVersionError.
                 try {
+                    Class.forName("java.lang.annotation.Annotation");
                     if (loader == null) {
                         junit4TestAdapterClass = Class.forName("junit.framework.JUnit4TestAdapter");
                     } else {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message