incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1075401 - /sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/testtools/SlingTestBase.java
Date Mon, 28 Feb 2011 16:09:43 GMT
Author: bdelacretaz
Date: Mon Feb 28 16:09:43 2011
New Revision: 1075401

URL: http://svn.apache.org/viewvc?rev=1075401&view=rev
Log:
SLING-2002 - sort the list of additional bundles for predictable installation order

Modified:
    sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/testtools/SlingTestBase.java

Modified: sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/testtools/SlingTestBase.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/testtools/SlingTestBase.java?rev=1075401&r1=1075400&r2=1075401&view=diff
==============================================================================
--- sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/testtools/SlingTestBase.java
(original)
+++ sling/trunk/testing/samples/integration-tests/src/test/java/org/apache/sling/testing/samples/testtools/SlingTestBase.java
Mon Feb 28 16:09:43 2011
@@ -20,6 +20,8 @@ import static org.junit.Assert.fail;
 
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.List;
 import java.util.TreeSet;
 
@@ -186,17 +188,25 @@ public class SlingTestBase {
         }
         
         int count = 0;
+        final List<File> bundlesToInstall = new ArrayList<File>();
         final String [] files = dir.list();
         if(files != null) {
             for(String file : files) {
                 if(file.endsWith(".jar")) {
                     File f = new File(dir, file);
-                    installBundle(f);
+                    bundlesToInstall.add(f);
                     count++;
                 }
             }
         }
         
+        // Install bundles in a predictable order, to
+        // be as deterministic as possible
+        Collections.sort(bundlesToInstall);
+        for(File f : bundlesToInstall) {
+            installBundle(f);
+        }
+        
         log.info("{} additional bundles installed from {}", count, dir.getAbsolutePath());
     }
  



Mime
View raw message