jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1329809 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelRootFuzzIT.java
Date Tue, 24 Apr 2012 15:53:01 GMT
Author: mduerig
Date: Tue Apr 24 15:53:00 2012
New Revision: 1329809

URL: http://svn.apache.org/viewvc?rev=1329809&view=rev
Log:
make KernelRootFuzzIT run with random seed

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelRootFuzzIT.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelRootFuzzIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelRootFuzzIT.java?rev=1329809&r1=1329808&r2=1329809&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelRootFuzzIT.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelRootFuzzIT.java
Tue Apr 24 15:53:00 2012
@@ -28,15 +28,10 @@ import org.apache.jackrabbit.oak.api.Tre
 import org.apache.jackrabbit.oak.core.CoreValueFactoryImpl;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Arrays;
 import java.util.Iterator;
-import java.util.List;
 import java.util.Random;
 
 import static org.apache.jackrabbit.oak.kernel.KernelRootFuzzIT.Operation.AddNode;
@@ -48,7 +43,10 @@ import static org.apache.jackrabbit.oak.
 import static org.apache.jackrabbit.oak.kernel.KernelRootFuzzIT.Operation.SetProperty;
 import static org.junit.Assert.assertEquals;
 
-@RunWith(Parameterized.class)
+/**
+ * Fuzz test running random sequences of operations on {@link Tree}.
+ * Run with -DKernelRootFuzzIT-seed=42 to set a specific seed (i.e. 42);
+ */
 public class KernelRootFuzzIT {
     static final Logger log = LoggerFactory.getLogger(KernelRootFuzzIT.class);
 
@@ -66,18 +64,9 @@ public class KernelRootFuzzIT {
 
     private CoreValueFactory vf;
 
-    @Parameters
-    public static List<Object[]> seeds() {
-        // todo use random sees, log seed, provide means to start with specific seed
-        return Arrays.asList(new Object[][] {
-                {0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9},
-                {10}, {11}, {12}, {13}, {14}, {15}, {16}, {17}, {18}, {19},
-                {20}, {21}, {22}, {23}, {24}, {25}, {26}, {27}, {28}, {29},
-                {30}, {31}, {32}, {33}, {34}, {35}, {36}, {37}, {38}, {39},
-        });
-    }
-
-    public KernelRootFuzzIT(int seed) {
+    public KernelRootFuzzIT() {
+        int seed = Integer.getInteger(KernelRootFuzzIT.class.getSimpleName() + "-seed",
+                new Random().nextInt());
         log.info("Seed = {}", seed);
         random = new Random(seed);
     }



Mime
View raw message