ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gscok...@apache.org
Subject svn commit: r736745 - /ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AntUnit.java
Date Thu, 22 Jan 2009 19:06:02 GMT
Author: gscokart
Date: Thu Jan 22 11:06:02 2009
New Revision: 736745

URL: http://svn.apache.org/viewvc?rev=736745&view=rev
Log:
separate test target identification from test target execution (prepare further refactoring
to extract part reusable in junit adapter)

Modified:
    ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AntUnit.java

Modified: ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AntUnit.java
URL: http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AntUnit.java?rev=736745&r1=736744&r2=736745&view=diff
==============================================================================
--- ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AntUnit.java (original)
+++ ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AntUnit.java Thu Jan 22 11:06:02
2009
@@ -24,6 +24,8 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
 import java.util.Map;
 import java.util.Vector;
 
@@ -238,6 +240,14 @@
         boolean tearDown = targets.containsKey(TEARDOWN);
         boolean suiteSetUp = targets.containsKey(SUITESETUP);
         boolean suiteTearDown = targets.containsKey(SUITETEARDOWN);
+        List testTargets = new LinkedList();
+        Iterator it = targets.keySet().iterator();
+        while (it.hasNext()) {
+            String name = (String) it.next();
+            if (name.startsWith(TEST) && !name.equals(TEST)) {
+                testTargets.add(name);
+            }
+        }
 
         // start test
         newProject.fireBuildStarted();
@@ -260,10 +270,9 @@
                     return;
                 }
             }
-            Iterator iter = targets.keySet().iterator();
+            Iterator iter = testTargets.iterator();
             while (iter.hasNext()) {
                 String name = (String) iter.next();
-                if (name.startsWith(TEST) && !name.equals(TEST)) {
                     Vector v = new Vector();
                     if (setUp) {
                         v.add(SETUP);
@@ -299,7 +308,6 @@
                             newProject = createProjectForFile(f);
                         }
                     }
-                }
             }
         } catch (Throwable e) {
             caught = e;



Mime
View raw message