jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1151415 - /jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/DataStoreTest.java
Date Wed, 27 Jul 2011 10:13:15 GMT
Author: thomasm
Date: Wed Jul 27 10:13:14 2011
New Revision: 1151415

URL: http://svn.apache.org/viewvc?rev=1151415&view=rev
Log:
Improved data store test.

Modified:
    jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/DataStoreTest.java

Modified: jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/DataStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/DataStoreTest.java?rev=1151415&r1=1151414&r2=1151415&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/DataStoreTest.java
(original)
+++ jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/DataStoreTest.java
Wed Jul 27 10:13:14 2011
@@ -27,8 +27,8 @@ import org.apache.jackrabbit.mk.util.Mic
  */
 public class DataStoreTest extends TestCase {
 
-    private static final String URL = "fs:{homeDir};clean";
-    // private static final String URL = "mem:";
+    // private static final String URL = "fs:{homeDir};clean";
+    private static final String URL = "mem:";
 
     private MicroKernel mk;
 
@@ -41,24 +41,28 @@ public class DataStoreTest extends TestC
     }
 
     public void testSmall() {
-        doTest(100, 1000);
+        doTest(10, 10);
+    }
+
+    public void testMedium() {
+        doTest(1000, 10);
     }
 
     public void testLarge() {
-        doTest(100000, 10);
+        doTest(100000, 1);
     }
 
     private void doTest(int maxLength, int count) {
-        String[] s = new String[count];
+        String[] s = new String[count * 2];
         Random r = new Random(0);
-        for (int i = 0; i < count;) {
+        for (int i = 0; i < s.length;) {
             byte[] data = new byte[r.nextInt(maxLength)];
             r.nextBytes(data);
             s[i++] = mk.write(new ByteArrayInputStream(data));
             s[i++] = mk.write(new ByteArrayInputStream(data));
         }
         r.setSeed(0);
-        for (int i = 0; i < count;) {
+        for (int i = 0; i < s.length;) {
             int expectedLen = r.nextInt(maxLength);
             byte[] expectedData = new byte[expectedLen];
             r.nextBytes(expectedData);



Mime
View raw message