You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2006/05/05 06:26:18 UTC
svn commit: r399951 -
/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java
Author: bodewig
Date: Thu May 4 21:26:17 2006
New Revision: 399951
URL: http://svn.apache.org/viewcvs?rev=399951&view=rev
Log:
whitespace only
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=399951&r1=399950&r2=399951&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 Thu May 4 21:26:17 2006
@@ -283,35 +283,47 @@
// no appropriate suite method found. We don't report any
// error here since it might be perfectly normal.
}
+
if (suiteMethod != null) {
// if there is a suite method available, then try
// to extract the suite from it. If there is an error
// here it will be caught below and reported.
suite = (Test) suiteMethod.invoke(null, new Class[0]);
+
} else {
- Class junit4TestAdapterClass = null;
- // 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 {
- junit4TestAdapterClass = Class.forName("junit.framework.JUnit4TestAdapter", true, loader);
+ Class junit4TestAdapterClass = null;
+
+ // 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 {
+ junit4TestAdapterClass =
+ Class.forName("junit.framework.JUnit4TestAdapter",
+ true, loader);
+ }
+ } catch (ClassNotFoundException e) {
+ // OK, fall back to JUnit 3.
}
- } catch (ClassNotFoundException e) {
- // OK, fall back to JUnit 3.
- }
- junit4 = junit4TestAdapterClass != null;
-
- if (junit4) {
- // Let's use it!
- suite = (Test) junit4TestAdapterClass.getConstructor(new Class[] {Class.class}).
+ junit4 = junit4TestAdapterClass != null;
+
+ if (junit4) {
+ // Let's use it!
+ suite =
+ (Test) junit4TestAdapterClass
+ .getConstructor(new Class[] {Class.class}).
newInstance(new Object[] {testClass});
- } else {
- // Use JUnit 3.
+ } else {
+ // Use JUnit 3.
// try to extract a test suite automatically this
// will generate warnings if the class is no
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org