jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1329757 - in /jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk: ConcurrentWriteIT.java json/JsopStreamTest.java json/JsopTest.java json/fast/JsopObjectTest.java
Date Tue, 24 Apr 2012 14:50:59 GMT
Author: stefan
Date: Tue Apr 24 14:50:59 2012
New Revision: 1329757

URL: http://svn.apache.org/viewvc?rev=1329757&view=rev
Log:
 cleanup: remove System.out statements in test cases

Modified:
    jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/ConcurrentWriteIT.java
    jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopStreamTest.java
    jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopTest.java
    jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/fast/JsopObjectTest.java

Modified: jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/ConcurrentWriteIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/ConcurrentWriteIT.java?rev=1329757&r1=1329756&r2=1329757&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/ConcurrentWriteIT.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/ConcurrentWriteIT.java
Tue Apr 24 14:50:59 2012
@@ -28,17 +28,13 @@ public class ConcurrentWriteIT extends T
     private static final int NUM_THREADS = 20;
     private static final int NUM_CHILDNODES = 1000;
 
-    MicroKernel mk;
+    final MicroKernel mk = new MicroKernelImpl();
 
     public void setUp() throws Exception {
-        String homeDir = System.getProperty("homeDir", "target");
-        mk = new MicroKernelImpl(homeDir);
-        mk.commit("/", "+ \"" + TEST_PATH.substring(1) + "\": {\"jcr:primaryType\":\"nt:unstructured\"}",
mk.getHeadRevision(), null);
+        mk.commit("/", "+ \"" + TEST_PATH.substring(1) + "\": {\"jcr:primaryType\":\"nt:unstructured\"}",
null, null);
     }
 
     public void tearDown() throws InterruptedException {
-        String head = mk.commit("/", "- \"" + TEST_PATH.substring(1) + "\"", mk.getHeadRevision(),
null);
-        mk.dispose();
     }
 
     /**
@@ -48,29 +44,29 @@ public class ConcurrentWriteIT extends T
 
         String oldHead = mk.getHeadRevision();
 
-        long t0 = System.currentTimeMillis();
-
         TestThread[] threads = new TestThread[NUM_THREADS];
         for (int i = 0; i < threads.length; i++) {
             TestThread thread = new TestThread(oldHead, "t" + i);
-            thread.start();
             threads[i] = thread;
+
+            assertFalse(mk.nodeExists(TEST_PATH + "/" + thread.getName(), null));
         }
 
+        long t0 = System.currentTimeMillis();
+
         for (TestThread t : threads) {
             if (t != null) {
+                t.start();
                 t.join();
             }
         }
 
         long t1 = System.currentTimeMillis();
+        // System.out.println("duration: " + (t1 - t0) + "ms");
 
-        String head = mk.getHeadRevision();
-        mk.getNodes("/", head, Integer.MAX_VALUE, 0, -1, null);
-
-        String history = mk.getRevisionHistory(t0, -1);
-
-        mk.getJournal(oldHead, head, null);
+        for (Thread t : threads) {
+            assertTrue(mk.nodeExists(TEST_PATH + "/" + t.getName(), null));
+        }
     }
 
     class TestThread extends Thread {

Modified: jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopStreamTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopStreamTest.java?rev=1329757&r1=1329756&r2=1329757&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopStreamTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopStreamTest.java
Tue Apr 24 14:50:59 2012
@@ -34,7 +34,7 @@ public class JsopStreamTest extends Test
                     w.resetWriter();
                 }
             }
-            System.out.println(w.getClass() + ": " + timer.seconds());
+            // System.out.println(w.getClass() + ": " + timer.seconds());
         }
         // JsopStream: 20
         // JsopBuilder: 1150

Modified: jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopTest.java?rev=1329757&r1=1329756&r2=1329757&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/JsopTest.java
Tue Apr 24 14:50:59 2012
@@ -35,7 +35,7 @@ public class JsopTest extends TestCase {
             for (int i = 0; i < 10000000; i++) {
                 t2 += JsopBuilder.encode(s).length();
             }
-            System.out.println(timer.seconds());
+            // System.out.println(timer.seconds());
         }
         // old: not escaped: 5691 ms; escaped: 10609 ms
         // new: not escaped: 3931 ms; escaped: 11001 ms

Modified: jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/fast/JsopObjectTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/fast/JsopObjectTest.java?rev=1329757&r1=1329756&r2=1329757&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/fast/JsopObjectTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/json/fast/JsopObjectTest.java
Tue Apr 24 14:50:59 2012
@@ -42,7 +42,7 @@ public class JsopObjectTest extends Test
                 JsopObject o = (JsopObject) Jsop.parse(jsop);
                 assertEquals(data, o.get("child99"));
             }
-            System.out.println(timer.seconds() + " lengthIndex=" + lengthIndex);
+            // System.out.println(timer.seconds() + " lengthIndex=" + lengthIndex);
         }
     }
 



Mime
View raw message