sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1690064 - in /sling/whiteboard/bdelacretaz/startup-stuff/it-startup/src/test/java/org/apache/sling/launchpad/it/startup: AsyncInstaller.java SlowActivator.java WaitFor.java
Date Thu, 09 Jul 2015 11:20:27 GMT
Author: bdelacretaz
Date: Thu Jul  9 11:20:27 2015
New Revision: 1690064

URL: http://svn.apache.org/r1690064
Log:
SLING-4851 - more randomness

Modified:
    sling/whiteboard/bdelacretaz/startup-stuff/it-startup/src/test/java/org/apache/sling/launchpad/it/startup/AsyncInstaller.java
    sling/whiteboard/bdelacretaz/startup-stuff/it-startup/src/test/java/org/apache/sling/launchpad/it/startup/SlowActivator.java
    sling/whiteboard/bdelacretaz/startup-stuff/it-startup/src/test/java/org/apache/sling/launchpad/it/startup/WaitFor.java

Modified: sling/whiteboard/bdelacretaz/startup-stuff/it-startup/src/test/java/org/apache/sling/launchpad/it/startup/AsyncInstaller.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/startup-stuff/it-startup/src/test/java/org/apache/sling/launchpad/it/startup/AsyncInstaller.java?rev=1690064&r1=1690063&r2=1690064&view=diff
==============================================================================
--- sling/whiteboard/bdelacretaz/startup-stuff/it-startup/src/test/java/org/apache/sling/launchpad/it/startup/AsyncInstaller.java
(original)
+++ sling/whiteboard/bdelacretaz/startup-stuff/it-startup/src/test/java/org/apache/sling/launchpad/it/startup/AsyncInstaller.java
Thu Jul  9 11:20:27 2015
@@ -29,7 +29,6 @@ import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
-import java.util.Random;
 import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
@@ -63,7 +62,6 @@ class AsyncInstaller implements Framewor
     private final Set<String> installedBundles = new HashSet<String>();
     private final List<InstallableResource> resources = new ArrayList<InstallableResource>();
     private final String bundleNamePrefix = "AsyncInstaller-" + UUID.randomUUID().toString()
+ ".";
-    private final Random random = new Random(42);
     private final AtomicInteger counter = new AtomicInteger();
     private int lastStartLevel = -1;
     private final List<ServiceRegistration> toCleanup = new ArrayList<ServiceRegistration>();
@@ -156,7 +154,7 @@ class AsyncInstaller implements Framewor
         List<InstallableResource> res = resourceMap.get(startLevel);
         if(res == null) {
             try {
-                final int n = (int)(random.nextFloat() * P.MAX_BUNDLES_PER_LEVEL) + 1;
+                final int n = (int)(WaitFor.randomLong(P.MAX_BUNDLES_PER_LEVEL) + 1);
                 log.info("Preparing {} InstallableResources for start level {}", n, startLevel);
                 res = new ArrayList<InstallableResource>();
                 resourceMap.put(startLevel, res);

Modified: sling/whiteboard/bdelacretaz/startup-stuff/it-startup/src/test/java/org/apache/sling/launchpad/it/startup/SlowActivator.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/startup-stuff/it-startup/src/test/java/org/apache/sling/launchpad/it/startup/SlowActivator.java?rev=1690064&r1=1690063&r2=1690064&view=diff
==============================================================================
--- sling/whiteboard/bdelacretaz/startup-stuff/it-startup/src/test/java/org/apache/sling/launchpad/it/startup/SlowActivator.java
(original)
+++ sling/whiteboard/bdelacretaz/startup-stuff/it-startup/src/test/java/org/apache/sling/launchpad/it/startup/SlowActivator.java
Thu Jul  9 11:20:27 2015
@@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory;
 public class SlowActivator implements BundleActivator {
 
     private final Logger log = LoggerFactory.getLogger(getClass());
-    public static final int MAX_WAIT_MSEC = 23;
+    public static final int MAX_WAIT_MSEC = 73;
     
     @Override
     public void start(BundleContext context) throws Exception {

Modified: sling/whiteboard/bdelacretaz/startup-stuff/it-startup/src/test/java/org/apache/sling/launchpad/it/startup/WaitFor.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/startup-stuff/it-startup/src/test/java/org/apache/sling/launchpad/it/startup/WaitFor.java?rev=1690064&r1=1690063&r2=1690064&view=diff
==============================================================================
--- sling/whiteboard/bdelacretaz/startup-stuff/it-startup/src/test/java/org/apache/sling/launchpad/it/startup/WaitFor.java
(original)
+++ sling/whiteboard/bdelacretaz/startup-stuff/it-startup/src/test/java/org/apache/sling/launchpad/it/startup/WaitFor.java
Thu Jul  9 11:20:27 2015
@@ -26,7 +26,7 @@ public abstract class WaitFor {
     
     private String info = "NO INFO??";
     
-    private static final Random random = new Random(42);
+    private static final Random random = new Random();
     
     public WaitFor(int timeoutSeconds) {
         final long endtime = System.currentTimeMillis() + timeoutSeconds * 1000L;



Mime
View raw message