jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1410319 [1/2] - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/ oak-mk-perf/ oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/ oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/tasks/ ...
Date Fri, 16 Nov 2012 12:29:46 GMT
Author: mduerig
Date: Fri Nov 16 12:29:42 2012
New Revision: 1410319

URL: http://svn.apache.org/viewvc?rev=1410319&view=rev
Log:
OAK-434: Setup build profiles to run against either of the Microkernel implementations
Merge remote-tracking branch 'tudor/trunk' into trunk

Added:
    jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/
    jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/ConcurrentAddNodes1Commit.java
      - copied, changed from r1410265, jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkConcurrentAddNodes1CommitTest.java
    jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/ConcurrentAddNodesMultipleCommits.java
      - copied, changed from r1410265, jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkConcurrentAddNodesMultipleCommitTest.java
    jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/MicroKernelMultipleCommits.java
      - copied, changed from r1410265, jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkAddNodesMultipleCommitsTest.java
    jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/MicroKernelRelativePath.java
      - copied, changed from r1410265, jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MKAddNodesRelativePathTest.java
    jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/MicrokernelDifferentStructures.java
      - copied, changed from r1410265, jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkAddNodesDifferentStructuresTest.java
    jackrabbit/oak/trunk/oak-mongomk-perf/remotePom.xml   (with props)
    jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/
    jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/
    jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelMongoTestBase.java
      - copied, changed from r1410265, jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelTestBase.java
    jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoClearCollections.java   (with props)
    jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoConcurrentMicroKernelTestBase.java
      - copied, changed from r1410265, jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/ConcurrentMicroKernelTestBase.java
    jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoMicroKernelInitializer.java   (with props)
    jackrabbit/oak/trunk/oak-mongomk-perf/src/test/
    jackrabbit/oak/trunk/oak-mongomk-perf/src/test/java/
    jackrabbit/oak/trunk/oak-mongomk-perf/src/test/java/org/
    jackrabbit/oak/trunk/oak-mongomk-perf/src/test/java/org/apache/
    jackrabbit/oak/trunk/oak-mongomk-perf/src/test/java/org/apache/jackrabbit/
    jackrabbit/oak/trunk/oak-mongomk-perf/src/test/java/org/apache/jackrabbit/mk/
    jackrabbit/oak/trunk/oak-mongomk-perf/src/test/java/org/apache/jackrabbit/mk/tests/
    jackrabbit/oak/trunk/oak-mongomk-perf/src/test/java/org/apache/jackrabbit/mk/tests/perf/
    jackrabbit/oak/trunk/oak-mongomk-perf/src/test/java/org/apache/jackrabbit/mk/tests/perf/MongoAddNodesMultipleCommitsTest.java   (with props)
    jackrabbit/oak/trunk/oak-mongomk-perf/src/test/java/org/apache/jackrabbit/mk/tests/perf/MongoAddNodesMultipleStructuresTest.java   (with props)
    jackrabbit/oak/trunk/oak-mongomk-perf/src/test/java/org/apache/jackrabbit/mk/tests/perf/MongoAddNodesRelativePathTest.java   (with props)
    jackrabbit/oak/trunk/oak-mongomk-perf/src/test/java/org/apache/jackrabbit/mk/tests/perf/MongoConcurrentAddNodes1CommitTest.java   (with props)
    jackrabbit/oak/trunk/oak-mongomk-perf/src/test/java/org/apache/jackrabbit/mk/tests/perf/MongoConcurrentAddNodesMultipleCommitTest.java   (with props)
Removed:
    jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mongomk/performance/write/MultipleMksWriteNodesTest.java
    jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mongomk/performance/write/MultipleNodesTestBase.java
    jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mongomk/performance/write/TestUtil.java
    jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mongomk/performance/write/WriteNodesTest.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProvider.java
    jackrabbit/oak/trunk/oak-mk-perf/pom.xml
    jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/tasks/GenericWriteTask.java
    jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/ConcurrentMicroKernelTestBase.java
    jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelCollection.java
    jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelInitializer.java
    jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelTestBase.java
    jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/OakMicroKernelInitializer.java
    jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/util/MicroKernelOperation.java
    jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MKAddNodesRelativePathTest.java
    jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkAddNodesDifferentStructuresTest.java
    jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkAddNodesMultipleCommitsTest.java
    jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkConcurrentAddNodes1CommitTest.java
    jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkConcurrentAddNodesMultipleCommitTest.java
    jackrabbit/oak/trunk/oak-mongomk-perf/pom.xml
    jackrabbit/oak/trunk/oak-mongomk-perf/src/main/resources/config.cfg
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/command/CommitCommand.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProvider.java?rev=1410319&r1=1410318&r2=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProvider.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserProvider.java Fri Nov 16 12:29:42 2012
@@ -205,7 +205,6 @@ class UserProvider extends AuthorizableB
             StringBuilder stmt = new StringBuilder();
             stmt.append("SELECT * FROM [").append(UserConstants.NT_REP_AUTHORIZABLE).append(']');
             stmt.append("WHERE [").append(UserConstants.REP_PRINCIPAL_NAME).append("] = $principalName");
-
             Result result = root.getQueryEngine().executeQuery(stmt.toString(),
                     Query.JCR_SQL2, 1, 0,
                     Collections.singletonMap("principalName", PropertyValues.newString(principal.getName())),

Modified: jackrabbit/oak/trunk/oak-mk-perf/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-perf/pom.xml?rev=1410319&r1=1410318&r2=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-mk-perf/pom.xml Fri Nov 16 12:29:42 2012
@@ -1,13 +1,13 @@
 <?xml version="1.0"?>
-<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
-    license agreements. See the NOTICE file distributed with this work for additional
-    information regarding copyright ownership. The ASF licenses this file to
-    You under the Apache License, Version 2.0 (the "License"); you may not use
-    this file except in compliance with the License. You may obtain a copy of
-    the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
-    by applicable law or agreed to in writing, software distributed under the
-    License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
-    OF ANY KIND, either express or implied. See the License for the specific
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+    license agreements. See the NOTICE file distributed with this work for additional 
+    information regarding copyright ownership. The ASF licenses this file to 
+    You under the Apache License, Version 2.0 (the "License"); you may not use 
+    this file except in compliance with the License. You may obtain a copy of 
+    the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+    by applicable law or agreed to in writing, software distributed under the 
+    License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+    OF ANY KIND, either express or implied. See the License for the specific 
     language governing permissions and limitations under the License. -->
 
 <project
@@ -27,20 +27,6 @@
     </properties>
     <profiles>
         <profile>
-            <id>oakmk</id>
-            <properties>
-                <user>qe1</user>
-                <mktype>oakmk</mktype>
-            </properties>
-        </profile>
-        <profile>
-            <id>mongomk</id>
-            <properties>
-                <user>qe</user>
-                <mktype>mongomk</mktype>
-            </properties>
-        </profile>
-        <profile>
             <id>local</id>
             <build>
                 <plugins>
@@ -68,11 +54,11 @@
                         <version>0.6</version>
                         <configuration>
                             <testMachine>${remotehost}</testMachine>
-                            <username>${user}</username>
+                            <username>qe1</username>
                             <password>${pass}</password>
                             <display>0</display>
                             <!--<keyFile>/home/rogoz/private-key-file</keyFile> -->
-                            <remoteFolder>/home/${user}/tests/</remoteFolder>
+                            <remoteFolder>/home/qe1/tests/</remoteFolder>
                             <pomfile>${basedir}/remotePom.xml</pomfile>
                         </configuration>
                         <executions>
@@ -119,7 +105,7 @@
             <artifactId>junit</artifactId>
 
         </dependency>
-        <!--
+        <!-- 
         <dependency>
             <groupId>org.apache.jackrabbit</groupId>
             <artifactId>oak-mongomk</artifactId>

Copied: jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/ConcurrentAddNodes1Commit.java (from r1410265, jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkConcurrentAddNodes1CommitTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/ConcurrentAddNodes1Commit.java?p2=jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/ConcurrentAddNodes1Commit.java&p1=jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkConcurrentAddNodes1CommitTest.java&r1=1410265&r2=1410319&rev=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkConcurrentAddNodes1CommitTest.java (original)
+++ jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/ConcurrentAddNodes1Commit.java Fri Nov 16 12:29:42 2012
@@ -14,33 +14,23 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.tests;
+package org.apache.jackrabbit.mk.scenarios;
 
 import java.util.ArrayList;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.tasks.GenericWriteTask;
-import org.apache.jackrabbit.mk.testing.ConcurrentMicroKernelTestBase;
+import org.apache.jackrabbit.mk.util.Chronometer;
 import org.apache.jackrabbit.mk.util.MicroKernelOperation;
-import org.junit.Test;
 
-/**
- * Test class for microkernel concurrent writing.All the nodes are added in a
- * single commit.
- */
-public class MkConcurrentAddNodes1CommitTest extends ConcurrentMicroKernelTestBase {
-
-    // nodes for each worker
-    int nodesNumber = 100;
+public class ConcurrentAddNodes1Commit {
 
-    /**
-    @Rule
-    public CatchAllExceptionsRule catchAllExceptionsRule = new CatchAllExceptionsRule();
-**/
-    @Test
-    public void testConcurentWritingFlatStructure() throws InterruptedException {
+    public static void concurentWritingFlatStructure(
+            ArrayList<MicroKernel> mks, int mkNumber, int nodesNumber,
+            Chronometer chronometer) throws InterruptedException {
 
         ArrayList<GenericWriteTask> tasks = new ArrayList<GenericWriteTask>();
         String diff;
@@ -62,8 +52,9 @@ public class MkConcurrentAddNodes1Commit
         System.out.println("Total time for is " + chronometer.getSeconds());
     }
 
-    @Test
-    public void testConcurentWritingPyramid1() throws InterruptedException {
+    public static void concurentWritingPyramid1(ArrayList<MicroKernel> mks,
+            int mkNumber, int nodesNumber, Chronometer chronometer)
+            throws InterruptedException {
 
         ArrayList<GenericWriteTask> tasks = new ArrayList<GenericWriteTask>();
         String diff;
@@ -85,13 +76,14 @@ public class MkConcurrentAddNodes1Commit
         System.out.println("Total time is " + chronometer.getSeconds());
     }
 
-    @Test
-    public void testConcurentWritingPyramid2() throws InterruptedException {
+    public static void concurentWritingPyramid2(ArrayList<MicroKernel> mks,
+            int mkNumber, int nodesNumber, Chronometer chronometer)
+            throws InterruptedException {
 
         ArrayList<GenericWriteTask> tasks = new ArrayList<GenericWriteTask>();
         String diff;
         for (int i = 0; i < mkNumber; i++) {
-            diff = MicroKernelOperation.buildPyramidDiff("/", 0, 10,
+            diff = MicroKernelOperation.buildPyramidDiff("/", 0, 100,
                     nodesNumber, "N" + i + "N", new StringBuilder()).toString();
             tasks.add(new GenericWriteTask(mks.get(i), diff, 0));
             System.out.println("The diff size is " + diff.getBytes().length);
@@ -107,4 +99,5 @@ public class MkConcurrentAddNodes1Commit
         chronometer.stop();
         System.out.println("Total time for is " + chronometer.getSeconds());
     }
+
 }

Copied: jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/ConcurrentAddNodesMultipleCommits.java (from r1410265, jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkConcurrentAddNodesMultipleCommitTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/ConcurrentAddNodesMultipleCommits.java?p2=jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/ConcurrentAddNodesMultipleCommits.java&p1=jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkConcurrentAddNodesMultipleCommitTest.java&r1=1410265&r2=1410319&rev=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkConcurrentAddNodesMultipleCommitTest.java (original)
+++ jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/ConcurrentAddNodesMultipleCommits.java Fri Nov 16 12:29:42 2012
@@ -14,35 +14,24 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.tests;
+package org.apache.jackrabbit.mk.scenarios;
 
 import java.util.ArrayList;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.tasks.GenericWriteTask;
-import org.apache.jackrabbit.mk.testing.ConcurrentMicroKernelTestBase;
+import org.apache.jackrabbit.mk.util.Chronometer;
 import org.apache.jackrabbit.mk.util.MicroKernelOperation;
-import org.junit.Test;
 
-/**
- * Test class for microkernel concurrent writing.The microkernel is adding 1000
- * nodes per commit.
- */
-public class MkConcurrentAddNodesMultipleCommitTest extends
-        ConcurrentMicroKernelTestBase {
+public class ConcurrentAddNodesMultipleCommits {
 
-    // nodes for each worker
-    int nodesNumber = 100;
-    int numberOfNodesPerCommit = 10;
-
-    /**
-     * @Rule public CatchAllExceptionsRule catchAllExceptionsRule = new
-     *       CatchAllExceptionsRule();
-     */
-    @Test
-    public void testConcurentWritingFlatStructure() throws InterruptedException {
+    public static void concurentWritingFlatStructure(
+            ArrayList<MicroKernel> mks, int mkNumber, long nodesNumber,
+            int numberOfNodesPerCommit, Chronometer chronometer)
+            throws InterruptedException {
 
         int children = 0;
         ArrayList<GenericWriteTask> tasks = new ArrayList<GenericWriteTask>();
@@ -66,9 +55,10 @@ public class MkConcurrentAddNodesMultipl
         System.out.println("Total time is " + chronometer.getSeconds());
     }
 
-    @Test
-    public void testConcurentWritingPyramid1() throws InterruptedException {
-        int children = 15;
+    public static void concurentWritingPyramid1(ArrayList<MicroKernel> mks,
+            int mkNumber, long nodesNumber, int numberOfNodesPerCommit,
+            Chronometer chronometer) throws InterruptedException {
+        int children = 10;
         ArrayList<GenericWriteTask> tasks = new ArrayList<GenericWriteTask>();
         String diff;
         for (int i = 0; i < mkNumber; i++) {
@@ -90,9 +80,10 @@ public class MkConcurrentAddNodesMultipl
         System.out.println("Total time is " + chronometer.getSeconds());
     }
 
-    @Test
-    public void testConcurentWritingPyramid2() throws InterruptedException {
-        int children = 2;
+    public static void concurentWritingPyramid2(ArrayList<MicroKernel> mks,
+            int mkNumber, long nodesNumber, int numberOfNodesPerCommit,
+            Chronometer chronometer) throws InterruptedException {
+        int children = 100;
         ArrayList<GenericWriteTask> tasks = new ArrayList<GenericWriteTask>();
         String diff;
         for (int i = 0; i < mkNumber; i++) {

Copied: jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/MicroKernelMultipleCommits.java (from r1410265, jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkAddNodesMultipleCommitsTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/MicroKernelMultipleCommits.java?p2=jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/MicroKernelMultipleCommits.java&p1=jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkAddNodesMultipleCommitsTest.java&r1=1410265&r2=1410319&rev=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkAddNodesMultipleCommitsTest.java (original)
+++ jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/MicroKernelMultipleCommits.java Fri Nov 16 12:29:42 2012
@@ -14,38 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.tests;
+package org.apache.jackrabbit.mk.scenarios;
 
-import org.apache.jackrabbit.mk.util.MicroKernelOperation;
-import org.apache.jackrabbit.mk.testing.MicroKernelTestBase;
+import org.apache.jackrabbit.mk.api.MicroKernel;
+import org.apache.jackrabbit.mk.util.Chronometer;
 import org.apache.jackrabbit.mk.util.Committer;
-import org.junit.BeforeClass;
-import org.junit.Test;
 
-/**
- * Measure the time needed for writing the same node structure in one or
- * multiple commit steps.
- * <p>
- * Tree structure:
- * <p>
- * Number of nodes per <b>level</b> =100^(<b>level</b>).
- * <p>
- * Each node has 100 children.
- */
-public class MkAddNodesMultipleCommitsTest extends MicroKernelTestBase {
-
-    static String diff;
-    static int nodesNumber = 1000;
-    static String nodeNamePrefix = "N";
-
-    @BeforeClass
-    public static void prepareDiff() {
-        diff = MicroKernelOperation.buildPyramidDiff("/", 0, 10, nodesNumber,
-                nodeNamePrefix, new StringBuilder()).toString();
-    }
+public class MicroKernelMultipleCommits {
 
-    @Test
-    public void testWriteNodesAllNodes1Commit() {
+    public static void writeNodesAllNodes1Commit(MicroKernel mk, String diff,
+            Chronometer chronometer) {
 
         Committer commiter = new Committer();
         chronometer.start();
@@ -55,8 +33,8 @@ public class MkAddNodesMultipleCommitsTe
                 + chronometer.getSeconds());
     }
 
-    @Test
-    public void testWriteNodes1NodePerCommit() {
+    public static void writeNodes1NodePerCommit(MicroKernel mk, String diff,
+            Chronometer chronometer) {
 
         Committer commiter = new Committer();
         chronometer.start();
@@ -66,8 +44,8 @@ public class MkAddNodesMultipleCommitsTe
                 + chronometer.getSeconds());
     }
 
-    @Test
-    public void testWriteNodes50NodesPerCommit() {
+    public static void writeNodes50NodesPerCommit(MicroKernel mk, String diff,
+            Chronometer chronometer) {
 
         Committer commiter = new Committer();
         chronometer.start();
@@ -77,8 +55,8 @@ public class MkAddNodesMultipleCommitsTe
                 + chronometer.getSeconds());
     }
 
-    @Test
-    public void testWriteNodes1000NodesPerCommit() {
+    public static void writeNodes1000NodesPerCommit(MicroKernel mk,
+            String diff, Chronometer chronometer) {
 
         Committer commiter = new Committer();
         chronometer.start();
@@ -88,4 +66,5 @@ public class MkAddNodesMultipleCommitsTe
                 .println("Total time for testWriteNodes1000NodesPerCommit is "
                         + chronometer.getSeconds());
     }
-}
\ No newline at end of file
+
+}

Copied: jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/MicroKernelRelativePath.java (from r1410265, jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MKAddNodesRelativePathTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/MicroKernelRelativePath.java?p2=jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/MicroKernelRelativePath.java&p1=jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MKAddNodesRelativePathTest.java&r1=1410265&r2=1410319&rev=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MKAddNodesRelativePathTest.java (original)
+++ jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/MicroKernelRelativePath.java Fri Nov 16 12:29:42 2012
@@ -14,24 +14,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.tests;
+package org.apache.jackrabbit.mk.scenarios;
 
-import org.apache.jackrabbit.mk.testing.MicroKernelTestBase;
+import org.apache.jackrabbit.mk.api.MicroKernel;
+import org.apache.jackrabbit.mk.util.Chronometer;
 import org.apache.jackrabbit.mk.util.Committer;
-import org.junit.Test;
 
-/**
- * Measure the time needed for writing nodes in different tree structures.Each
- * node is committed separately.Each node is also committed using the relative
- * path of the parent node.
- */
-public class MKAddNodesRelativePathTest extends MicroKernelTestBase {
-
-    static String nodeNamePrefix = "N";
-    static int nodesNumber = 1000;
+public class MicroKernelRelativePath {
 
-    @Test
-    public void testWriteNodesSameLevel() throws Exception {
+    public static void writeNodesSameLevel(MicroKernel mk,
+            Chronometer chronometer, long nodesNumber, String nodeNamePrefix)
+            throws Exception {
         Committer commiter = new Committer();
         chronometer.start();
         commiter.addPyramidStructure(mk, "/", 0, 0, nodesNumber, nodeNamePrefix);
@@ -40,8 +33,8 @@ public class MKAddNodesRelativePathTest 
                 + chronometer.getSeconds());
     }
 
-    @Test
-    public void testWriteNodes10Children() {
+    public static void writeNodes10Children(MicroKernel mk,
+            Chronometer chronometer, long nodesNumber, String nodeNamePrefix) {
         Committer commiter = new Committer();
         chronometer.start();
 
@@ -52,8 +45,8 @@ public class MKAddNodesRelativePathTest 
                 + chronometer.getSeconds());
     }
 
-    @Test
-    public void testWriteNodes100Children() {
+    public static void writeNodes100Children(MicroKernel mk,
+            Chronometer chronometer, long nodesNumber, String nodeNamePrefix) {
         Committer commiter = new Committer();
         chronometer.start();
         commiter.addPyramidStructure(mk, "/", 0, 100, nodesNumber,
@@ -62,4 +55,4 @@ public class MKAddNodesRelativePathTest 
         System.out.println("Total time for testWriteNodes100Children is "
                 + chronometer.getSeconds());
     }
-}
+}
\ No newline at end of file

Copied: jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/MicrokernelDifferentStructures.java (from r1410265, jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkAddNodesDifferentStructuresTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/MicrokernelDifferentStructures.java?p2=jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/MicrokernelDifferentStructures.java&p1=jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkAddNodesDifferentStructuresTest.java&r1=1410265&r2=1410319&rev=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkAddNodesDifferentStructuresTest.java (original)
+++ jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/scenarios/MicrokernelDifferentStructures.java Fri Nov 16 12:29:42 2012
@@ -14,21 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.tests;
+package org.apache.jackrabbit.mk.scenarios;
 
-import org.apache.jackrabbit.mk.util.MicroKernelOperation;
-import org.apache.jackrabbit.mk.testing.MicroKernelTestBase;
+import org.apache.jackrabbit.mk.api.MicroKernel;
+import org.apache.jackrabbit.mk.util.Chronometer;
 import org.apache.jackrabbit.mk.util.Committer;
-import org.junit.Test;
-
-/**
- * Measure the time needed for writing nodes in different tree structures.All
- * the nodes are added in a single commit.
- */
-public class MkAddNodesDifferentStructuresTest extends MicroKernelTestBase {
+import org.apache.jackrabbit.mk.util.MicroKernelOperation;
 
-    static long nodesNumber = 100;
-    static String nodeNamePrefix = "N";
+public class MicrokernelDifferentStructures {
 
     /**
      * Tree structure:
@@ -37,8 +30,9 @@ public class MkAddNodesDifferentStructur
      * <p>
      * N0 N1... Nn-1 Nn
      */
-    @Test
-    public void testWriteNodesSameLevel() {
+
+    public static void writeNodesSameLevel(MicroKernel mk,
+            Chronometer chronometer, long nodesNumber, String nodeNamePrefix) {
 
         String diff = MicroKernelOperation.buildPyramidDiff("/", 0, 0,
                 nodesNumber, nodeNamePrefix, new StringBuilder()).toString();
@@ -63,9 +57,8 @@ public class MkAddNodesDifferentStructur
      * <p>
      * N3
      */
-    @Test
-    public void testWriteNodes1Child() {
-        int nodesNumber = 100;
+    public static void writeNodes1Child(MicroKernel mk,
+            Chronometer chronometer, long nodesNumber, String nodeNamePrefix) {
 
         String diff = MicroKernelOperation.buildPyramidDiff("/", 0, 1,
                 nodesNumber, nodeNamePrefix, new StringBuilder()).toString();
@@ -84,10 +77,10 @@ public class MkAddNodesDifferentStructur
      * <p>
      * Each node has 10 children.
      */
-    @Test
-    public void testWriteNodes10Children() {
+    public static void writeNodes10Children(MicroKernel mk,
+            Chronometer chronometer, long nodesNumber, String nodeNamePrefix) {
 
-        String diff = MicroKernelOperation.buildPyramidDiff("/", 0, 10,
+        String diff = MicroKernelOperation.buildPyramidDiff("/", 0, 3,
                 nodesNumber, nodeNamePrefix, new StringBuilder()).toString();
         Committer committer = new Committer();
         chronometer.start();
@@ -104,8 +97,8 @@ public class MkAddNodesDifferentStructur
      * <p>
      * Each node has 100 children.
      */
-    @Test
-    public void testWriteNodes100Children() {
+    public static void writeNodes100Children(MicroKernel mk,
+            Chronometer chronometer, long nodesNumber, String nodeNamePrefix) {
 
         String diff = MicroKernelOperation.buildPyramidDiff("/", 0, 100,
                 nodesNumber, nodeNamePrefix, new StringBuilder()).toString();
@@ -124,8 +117,9 @@ public class MkAddNodesDifferentStructur
      * <p>
      * Each node has 1000 children.
      */
-    @Test
-    public void testWriteNodes1000Children() {
+    public static void writeNodes1000Children(MicroKernel mk,
+            Chronometer chronometer, long nodesNumber, String nodeNamePrefix) {
+
         String diff = MicroKernelOperation.buildPyramidDiff("/", 0, 1000,
                 nodesNumber, nodeNamePrefix, new StringBuilder()).toString();
         Committer committer = new Committer();

Modified: jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/tasks/GenericWriteTask.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/tasks/GenericWriteTask.java?rev=1410319&r1=1410318&r2=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/tasks/GenericWriteTask.java (original)
+++ jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/tasks/GenericWriteTask.java Fri Nov 16 12:29:42 2012
@@ -25,7 +25,7 @@ public class GenericWriteTask implements
     Committer committer;
     String diff;
     int nodesPerCommit;
- 
+
     public GenericWriteTask(MicroKernel mk, String diff, int nodesPerCommit) {
         this.mk = mk;
         this.diff = diff;

Modified: jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/ConcurrentMicroKernelTestBase.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/ConcurrentMicroKernelTestBase.java?rev=1410319&r1=1410318&r2=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/ConcurrentMicroKernelTestBase.java (original)
+++ jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/ConcurrentMicroKernelTestBase.java Fri Nov 16 12:29:42 2012
@@ -32,23 +32,18 @@ public class ConcurrentMicroKernelTestBa
     static MicroKernelInitializer initializator;
     static Configuration conf;
 
-
     /**
      * Loads the corresponding microkernel initialization class and the
      * microkernel configuration.The method searches for the <b>mk.type</b>
      * system property in order to initialize the proper microkernel.By default,
      * the oak microkernel will be instantiated.
-     *
+     * 
      * @throws Exception
      */
     @BeforeClass
     public static void beforeSuite() throws Exception {
 
-        // FIXME - Add back
         initializator = new OakMicroKernelInitializer();
-        //String mktype = System.getProperty("mk.type");
-        //initializator = (mktype == null || mktype.equals("oakmk")) ? new OakMicroKernelInitializer()
-        //        : new MongoMicroKernelInitializer();
         System.out.println("Tests will run against ***"
                 + initializator.getType() + "***");
         conf = MicroKernelConfigProvider.readConfig();
@@ -56,7 +51,7 @@ public class ConcurrentMicroKernelTestBa
 
     /**
      * Creates a microkernel collection with only one microkernel.
-     *
+     * 
      * @throws Exception
      */
     @Before

Modified: jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelCollection.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelCollection.java?rev=1410319&r1=1410318&r2=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelCollection.java (original)
+++ jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelCollection.java Fri Nov 16 12:29:42 2012
@@ -43,8 +43,8 @@ public class MicroKernelCollection {
     public MicroKernelCollection(MicroKernelInitializer initializator,
             Configuration conf, int size) throws Exception {
         mks = initializator.init(conf, size);
-        }
-    
+    }
+
     /**
      * Returns a microkernel collection.
      * 

Modified: jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelInitializer.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelInitializer.java?rev=1410319&r1=1410318&r2=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelInitializer.java (original)
+++ jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelInitializer.java Fri Nov 16 12:29:42 2012
@@ -28,6 +28,8 @@ import org.apache.jackrabbit.mk.util.Con
  * 
  */
 public interface MicroKernelInitializer {
-    public ArrayList<MicroKernel> init(Configuration conf,int mksNumber) throws Exception;
+    public ArrayList<MicroKernel> init(Configuration conf, int mksNumber)
+            throws Exception;
+
     public String getType();
 }

Modified: jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelTestBase.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelTestBase.java?rev=1410319&r1=1410318&r2=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelTestBase.java (original)
+++ jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelTestBase.java Fri Nov 16 12:29:42 2012
@@ -25,13 +25,13 @@ import org.junit.BeforeClass;
 
 /**
  * The test base class for tests that are using only one microkernel instance.
- *
- *
- *
+ * 
+ * 
+ * 
  */
-public class MicroKernelTestBase {
+public abstract class MicroKernelTestBase {
 
-    static MicroKernelInitializer initializator;
+    protected static MicroKernelInitializer initializator;
     public MicroKernel mk;
     public static Configuration conf;
     public Chronometer chronometer;
@@ -41,17 +41,12 @@ public class MicroKernelTestBase {
      * microkernel configuration.The method searches for the <b>mk.type</b>
      * system property in order to initialize the proper microkernel.By default,
      * the oak microkernel will be instantiated.
-     *
+     * 
      * @throws Exception
      */
     @BeforeClass
     public static void beforeSuite() throws Exception {
-
-        // FIXME - Add back
         initializator = new OakMicroKernelInitializer();
-        //String mktype = System.getProperty("mk.type");
-        //initializator = (mktype == null || mktype.equals("oakmk")) ? new OakMicroKernelInitializer()
-        //        : new MongoMicroKernelInitializer();
         System.out.println("Tests will run against ***"
                 + initializator.getType() + "***");
         conf = MicroKernelConfigProvider.readConfig();
@@ -59,7 +54,7 @@ public class MicroKernelTestBase {
 
     /**
      * Creates a microkernel collection with only one microkernel.
-     *
+     * 
      * @throws Exception
      */
     @Before

Modified: jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/OakMicroKernelInitializer.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/OakMicroKernelInitializer.java?rev=1410319&r1=1410318&r2=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/OakMicroKernelInitializer.java (original)
+++ jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/OakMicroKernelInitializer.java Fri Nov 16 12:29:42 2012
@@ -29,8 +29,6 @@ import org.apache.jackrabbit.mk.util.Con
  */
 public class OakMicroKernelInitializer implements MicroKernelInitializer {
 
-
-
     @Override
     public ArrayList<MicroKernel> init(Configuration conf, int mksNumber)
             throws Exception {
@@ -43,11 +41,10 @@ public class OakMicroKernelInitializer i
         }
         return mks;
     }
-    
+
     public String getType() {
         // TODO Auto-generated method stub
         return "Oak Microkernel";
     }
 
-
 }

Modified: jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/util/MicroKernelOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/util/MicroKernelOperation.java?rev=1410319&r1=1410318&r2=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/util/MicroKernelOperation.java (original)
+++ jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/util/MicroKernelOperation.java Fri Nov 16 12:29:42 2012
@@ -16,8 +16,6 @@
  */
 package org.apache.jackrabbit.mk.util;
 
-
-
 /**
  * Useful methods for building node structure.
  * 
@@ -53,7 +51,7 @@ public class MicroKernelOperation {
         if (index >= nodesNumber)
             return diff;
         diff.append(addNodeToDiff(startingPoint, nodePrefixName + index));
-        //System.out.println("Create node "+ index);
+        // System.out.println("Create node "+ index);
         for (int i = 1; i <= numberOfChildren; i++) {
             if (!startingPoint.endsWith("/"))
                 startingPoint = startingPoint + "/";

Modified: jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MKAddNodesRelativePathTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MKAddNodesRelativePathTest.java?rev=1410319&r1=1410318&r2=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MKAddNodesRelativePathTest.java (original)
+++ jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MKAddNodesRelativePathTest.java Fri Nov 16 12:29:42 2012
@@ -16,15 +16,18 @@
  */
 package org.apache.jackrabbit.mk.tests;
 
+import org.apache.jackrabbit.mk.scenarios.MicroKernelRelativePath;
 import org.apache.jackrabbit.mk.testing.MicroKernelTestBase;
-import org.apache.jackrabbit.mk.util.Committer;
 import org.junit.Test;
 
 /**
  * Measure the time needed for writing nodes in different tree structures.Each
  * node is committed separately.Each node is also committed using the relative
  * path of the parent node.
+ * 
+ * 
  */
+
 public class MKAddNodesRelativePathTest extends MicroKernelTestBase {
 
     static String nodeNamePrefix = "N";
@@ -32,34 +35,19 @@ public class MKAddNodesRelativePathTest 
 
     @Test
     public void testWriteNodesSameLevel() throws Exception {
-        Committer commiter = new Committer();
-        chronometer.start();
-        commiter.addPyramidStructure(mk, "/", 0, 0, nodesNumber, nodeNamePrefix);
-        chronometer.stop();
-        System.out.println("Total time for testWriteNodesSameLevel is "
-                + chronometer.getSeconds());
+        MicroKernelRelativePath.writeNodesSameLevel(mk, chronometer,
+                nodesNumber, nodeNamePrefix);
     }
 
     @Test
     public void testWriteNodes10Children() {
-        Committer commiter = new Committer();
-        chronometer.start();
-
-        commiter.addPyramidStructure(mk, "/", 0, 10, nodesNumber,
-                nodeNamePrefix);
-        chronometer.stop();
-        System.out.println("Total time for testWriteNodes10Children is "
-                + chronometer.getSeconds());
+        MicroKernelRelativePath.writeNodes10Children(mk, chronometer,
+                nodesNumber, nodeNamePrefix);
     }
 
     @Test
     public void testWriteNodes100Children() {
-        Committer commiter = new Committer();
-        chronometer.start();
-        commiter.addPyramidStructure(mk, "/", 0, 100, nodesNumber,
-                nodeNamePrefix);
-        chronometer.stop();
-        System.out.println("Total time for testWriteNodes100Children is "
-                + chronometer.getSeconds());
+        MicroKernelRelativePath.writeNodes100Children(mk, chronometer,
+                nodesNumber, nodeNamePrefix);
     }
 }

Modified: jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkAddNodesDifferentStructuresTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkAddNodesDifferentStructuresTest.java?rev=1410319&r1=1410318&r2=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkAddNodesDifferentStructuresTest.java (original)
+++ jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkAddNodesDifferentStructuresTest.java Fri Nov 16 12:29:42 2012
@@ -16,14 +16,15 @@
  */
 package org.apache.jackrabbit.mk.tests;
 
-import org.apache.jackrabbit.mk.util.MicroKernelOperation;
+import org.apache.jackrabbit.mk.scenarios.MicrokernelDifferentStructures;
 import org.apache.jackrabbit.mk.testing.MicroKernelTestBase;
-import org.apache.jackrabbit.mk.util.Committer;
 import org.junit.Test;
 
 /**
  * Measure the time needed for writing nodes in different tree structures.All
  * the nodes are added in a single commit.
+ * 
+ * 
  */
 public class MkAddNodesDifferentStructuresTest extends MicroKernelTestBase {
 
@@ -39,15 +40,8 @@ public class MkAddNodesDifferentStructur
      */
     @Test
     public void testWriteNodesSameLevel() {
-
-        String diff = MicroKernelOperation.buildPyramidDiff("/", 0, 0,
-                nodesNumber, nodeNamePrefix, new StringBuilder()).toString();
-        Committer committer = new Committer();
-        chronometer.start();
-        committer.addNodes(mk, diff, 0);
-        chronometer.stop();
-        System.out.println("Total time for testWriteNodesSameLevel is "
-                + chronometer.getSeconds());
+        MicrokernelDifferentStructures.writeNodesSameLevel(mk, chronometer,
+                nodesNumber, nodeNamePrefix);
     }
 
     /**
@@ -65,16 +59,8 @@ public class MkAddNodesDifferentStructur
      */
     @Test
     public void testWriteNodes1Child() {
-        int nodesNumber = 100;
-
-        String diff = MicroKernelOperation.buildPyramidDiff("/", 0, 1,
-                nodesNumber, nodeNamePrefix, new StringBuilder()).toString();
-        Committer committer = new Committer();
-        chronometer.start();
-        committer.addNodes(mk, diff, 0);
-        chronometer.stop();
-        System.out.println("Total time for testWriteNodes1Child is "
-                + chronometer.getSeconds());
+        MicrokernelDifferentStructures.writeNodes1Child(mk, chronometer,
+                nodesNumber, nodeNamePrefix);
     }
 
     /**
@@ -86,15 +72,8 @@ public class MkAddNodesDifferentStructur
      */
     @Test
     public void testWriteNodes10Children() {
-
-        String diff = MicroKernelOperation.buildPyramidDiff("/", 0, 10,
-                nodesNumber, nodeNamePrefix, new StringBuilder()).toString();
-        Committer committer = new Committer();
-        chronometer.start();
-        committer.addNodes(mk, diff, 0);
-        chronometer.stop();
-        System.out.println("Total time for testWriteNodes10Children is "
-                + chronometer.getSeconds());
+        MicrokernelDifferentStructures.writeNodes10Children(mk, chronometer,
+                nodesNumber, nodeNamePrefix);
     }
 
     /**
@@ -106,15 +85,8 @@ public class MkAddNodesDifferentStructur
      */
     @Test
     public void testWriteNodes100Children() {
-
-        String diff = MicroKernelOperation.buildPyramidDiff("/", 0, 100,
-                nodesNumber, nodeNamePrefix, new StringBuilder()).toString();
-        Committer committer = new Committer();
-        chronometer.start();
-        committer.addNodes(mk, diff, 0);
-        chronometer.stop();
-        System.out.println("Total time for testWriteNodes100Children is "
-                + chronometer.getSeconds());
+        MicrokernelDifferentStructures.writeNodes100Children(mk, chronometer,
+                nodesNumber, nodeNamePrefix);
     }
 
     /**
@@ -126,13 +98,7 @@ public class MkAddNodesDifferentStructur
      */
     @Test
     public void testWriteNodes1000Children() {
-        String diff = MicroKernelOperation.buildPyramidDiff("/", 0, 1000,
-                nodesNumber, nodeNamePrefix, new StringBuilder()).toString();
-        Committer committer = new Committer();
-        chronometer.start();
-        committer.addNodes(mk, diff, 0);
-        chronometer.stop();
-        System.out.println("Total time for testWriteNodes1000Children is "
-                + chronometer.getSeconds());
+        MicrokernelDifferentStructures.writeNodes1000Children(mk, chronometer,
+                nodesNumber, nodeNamePrefix);
     }
 }

Modified: jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkAddNodesMultipleCommitsTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkAddNodesMultipleCommitsTest.java?rev=1410319&r1=1410318&r2=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkAddNodesMultipleCommitsTest.java (original)
+++ jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkAddNodesMultipleCommitsTest.java Fri Nov 16 12:29:42 2012
@@ -17,8 +17,8 @@
 package org.apache.jackrabbit.mk.tests;
 
 import org.apache.jackrabbit.mk.util.MicroKernelOperation;
+import org.apache.jackrabbit.mk.scenarios.MicroKernelMultipleCommits;
 import org.apache.jackrabbit.mk.testing.MicroKernelTestBase;
-import org.apache.jackrabbit.mk.util.Committer;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -31,7 +31,12 @@ import org.junit.Test;
  * Number of nodes per <b>level</b> =100^(<b>level</b>).
  * <p>
  * Each node has 100 children.
+ * 
+ * 
+ * 
+ * 
  */
+
 public class MkAddNodesMultipleCommitsTest extends MicroKernelTestBase {
 
     static String diff;
@@ -46,46 +51,26 @@ public class MkAddNodesMultipleCommitsTe
 
     @Test
     public void testWriteNodesAllNodes1Commit() {
-
-        Committer commiter = new Committer();
-        chronometer.start();
-        commiter.addNodes(mk, diff, 0);
-        chronometer.stop();
-        System.out.println("Total time for testWriteNodesAllNodes1Commit is "
-                + chronometer.getSeconds());
+        MicroKernelMultipleCommits.writeNodesAllNodes1Commit(mk, diff,
+                chronometer);
     }
 
     @Test
     public void testWriteNodes1NodePerCommit() {
-
-        Committer commiter = new Committer();
-        chronometer.start();
-        commiter.addNodes(mk, diff, 1);
-        chronometer.stop();
-        System.out.println("Total time for testWriteNodes1NodePerCommit is "
-                + chronometer.getSeconds());
+        MicroKernelMultipleCommits.writeNodes1NodePerCommit(mk, diff,
+                chronometer);
     }
 
     @Test
     public void testWriteNodes50NodesPerCommit() {
-
-        Committer commiter = new Committer();
-        chronometer.start();
-        commiter.addNodes(mk, diff, 50);
-        chronometer.stop();
-        System.out.println("Total time for testWriteNodes50NodesPerCommit is "
-                + chronometer.getSeconds());
+        MicroKernelMultipleCommits.writeNodes50NodesPerCommit(mk, diff,
+                chronometer);
     }
 
     @Test
     public void testWriteNodes1000NodesPerCommit() {
-
-        Committer commiter = new Committer();
-        chronometer.start();
-        commiter.addNodes(mk, diff, 10);
-        chronometer.stop();
-        System.out
-                .println("Total time for testWriteNodes1000NodesPerCommit is "
-                        + chronometer.getSeconds());
+        MicroKernelMultipleCommits.writeNodes1000NodesPerCommit(mk, diff,
+                chronometer);
     }
-}
\ No newline at end of file
+
+}

Modified: jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkConcurrentAddNodes1CommitTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkConcurrentAddNodes1CommitTest.java?rev=1410319&r1=1410318&r2=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkConcurrentAddNodes1CommitTest.java (original)
+++ jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkConcurrentAddNodes1CommitTest.java Fri Nov 16 12:29:42 2012
@@ -16,95 +16,45 @@
  */
 package org.apache.jackrabbit.mk.tests;
 
-import java.util.ArrayList;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.jackrabbit.mk.tasks.GenericWriteTask;
+import org.apache.jackrabbit.mk.scenarios.ConcurrentAddNodes1Commit;
 import org.apache.jackrabbit.mk.testing.ConcurrentMicroKernelTestBase;
-import org.apache.jackrabbit.mk.util.MicroKernelOperation;
 import org.junit.Test;
 
+import com.cedarsoft.test.utils.CatchAllExceptionsRule;
+
 /**
  * Test class for microkernel concurrent writing.All the nodes are added in a
  * single commit.
  */
-public class MkConcurrentAddNodes1CommitTest extends ConcurrentMicroKernelTestBase {
+
+public class MkConcurrentAddNodes1CommitTest extends
+        ConcurrentMicroKernelTestBase {
 
     // nodes for each worker
     int nodesNumber = 100;
 
     /**
-    @Rule
-    public CatchAllExceptionsRule catchAllExceptionsRule = new CatchAllExceptionsRule();
-**/
+     * @Rule public CatchAllExceptionsRule catchAllExceptionsRule = new
+     *       CatchAllExceptionsRule();
+     **/
     @Test
     public void testConcurentWritingFlatStructure() throws InterruptedException {
 
-        ArrayList<GenericWriteTask> tasks = new ArrayList<GenericWriteTask>();
-        String diff;
-        for (int i = 0; i < mkNumber; i++) {
-            diff = MicroKernelOperation.buildPyramidDiff("/", 0, 0,
-                    nodesNumber, "N" + i + "N", new StringBuilder()).toString();
-            tasks.add(new GenericWriteTask(mks.get(i), diff, 0));
-            System.out.println("The diff size is " + diff.getBytes().length);
-        }
-
-        ExecutorService threadExecutor = Executors.newFixedThreadPool(mkNumber);
-        chronometer.start();
-        for (GenericWriteTask genericWriteTask : tasks) {
-            threadExecutor.execute(genericWriteTask);
-        }
-        threadExecutor.shutdown();
-        threadExecutor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
-        chronometer.stop();
-        System.out.println("Total time for is " + chronometer.getSeconds());
+        ConcurrentAddNodes1Commit.concurentWritingFlatStructure(mks, 3,
+                nodesNumber, chronometer);
     }
 
     @Test
     public void testConcurentWritingPyramid1() throws InterruptedException {
 
-        ArrayList<GenericWriteTask> tasks = new ArrayList<GenericWriteTask>();
-        String diff;
-        for (int i = 0; i < mkNumber; i++) {
-            diff = MicroKernelOperation.buildPyramidDiff("/", 0, 10,
-                    nodesNumber, "N" + i + "N", new StringBuilder()).toString();
-            tasks.add(new GenericWriteTask(mks.get(i), diff, 0));
-            System.out.println("The diff size is " + diff.getBytes().length);
-        }
-
-        ExecutorService threadExecutor = Executors.newFixedThreadPool(mkNumber);
-        chronometer.start();
-        for (GenericWriteTask genericWriteTask : tasks) {
-            threadExecutor.execute(genericWriteTask);
-        }
-        threadExecutor.shutdown();
-        threadExecutor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
-        chronometer.stop();
-        System.out.println("Total time is " + chronometer.getSeconds());
+        ConcurrentAddNodes1Commit.concurentWritingPyramid1(mks, 3, nodesNumber,
+                chronometer);
     }
 
     @Test
     public void testConcurentWritingPyramid2() throws InterruptedException {
 
-        ArrayList<GenericWriteTask> tasks = new ArrayList<GenericWriteTask>();
-        String diff;
-        for (int i = 0; i < mkNumber; i++) {
-            diff = MicroKernelOperation.buildPyramidDiff("/", 0, 10,
-                    nodesNumber, "N" + i + "N", new StringBuilder()).toString();
-            tasks.add(new GenericWriteTask(mks.get(i), diff, 0));
-            System.out.println("The diff size is " + diff.getBytes().length);
-        }
-
-        ExecutorService threadExecutor = Executors.newFixedThreadPool(mkNumber);
-        chronometer.start();
-        for (GenericWriteTask genericWriteTask : tasks) {
-            threadExecutor.execute(genericWriteTask);
-        }
-        threadExecutor.shutdown();
-        threadExecutor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
-        chronometer.stop();
-        System.out.println("Total time for is " + chronometer.getSeconds());
+        ConcurrentAddNodes1Commit.concurentWritingPyramid2(mks, 3, nodesNumber,
+                chronometer);
     }
 }

Modified: jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkConcurrentAddNodesMultipleCommitTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkConcurrentAddNodesMultipleCommitTest.java?rev=1410319&r1=1410318&r2=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkConcurrentAddNodesMultipleCommitTest.java (original)
+++ jackrabbit/oak/trunk/oak-mk-perf/src/test/java/org/apache/jackrabbit/mk/tests/MkConcurrentAddNodesMultipleCommitTest.java Fri Nov 16 12:29:42 2012
@@ -16,25 +16,21 @@
  */
 package org.apache.jackrabbit.mk.tests;
 
-import java.util.ArrayList;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.jackrabbit.mk.tasks.GenericWriteTask;
+import org.apache.jackrabbit.mk.scenarios.ConcurrentAddNodesMultipleCommits;
 import org.apache.jackrabbit.mk.testing.ConcurrentMicroKernelTestBase;
-import org.apache.jackrabbit.mk.util.MicroKernelOperation;
+
 import org.junit.Test;
 
 /**
  * Test class for microkernel concurrent writing.The microkernel is adding 1000
  * nodes per commit.
  */
+
 public class MkConcurrentAddNodesMultipleCommitTest extends
         ConcurrentMicroKernelTestBase {
 
     // nodes for each worker
-    int nodesNumber = 100;
+    int nodesNumber = 1000;
     int numberOfNodesPerCommit = 10;
 
     /**
@@ -43,76 +39,21 @@ public class MkConcurrentAddNodesMultipl
      */
     @Test
     public void testConcurentWritingFlatStructure() throws InterruptedException {
-
-        int children = 0;
-        ArrayList<GenericWriteTask> tasks = new ArrayList<GenericWriteTask>();
-        String diff;
-        for (int i = 0; i < mkNumber; i++) {
-            diff = MicroKernelOperation.buildPyramidDiff("/", 0, children,
-                    nodesNumber, "N" + i + "N", new StringBuilder()).toString();
-            tasks.add(new GenericWriteTask(mks.get(i), diff,
-                    numberOfNodesPerCommit));
-            System.out.println("The diff size is " + diff.getBytes().length);
-        }
-
-        ExecutorService threadExecutor = Executors.newFixedThreadPool(mkNumber);
-        chronometer.start();
-        for (GenericWriteTask genericWriteTask : tasks) {
-            threadExecutor.execute(genericWriteTask);
-        }
-        threadExecutor.shutdown();
-        threadExecutor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
-        chronometer.stop();
-        System.out.println("Total time is " + chronometer.getSeconds());
+        ConcurrentAddNodesMultipleCommits.concurentWritingFlatStructure(mks,
+                mkNumber, nodesNumber, numberOfNodesPerCommit, chronometer);
     }
 
     @Test
     public void testConcurentWritingPyramid1() throws InterruptedException {
-        int children = 15;
-        ArrayList<GenericWriteTask> tasks = new ArrayList<GenericWriteTask>();
-        String diff;
-        for (int i = 0; i < mkNumber; i++) {
-            diff = MicroKernelOperation.buildPyramidDiff("/", 0, children,
-                    nodesNumber, "N" + i + "N", new StringBuilder()).toString();
-            tasks.add(new GenericWriteTask(mks.get(i), diff,
-                    numberOfNodesPerCommit));
-            System.out.println("The diff size is " + diff.getBytes().length);
-        }
-
-        ExecutorService threadExecutor = Executors.newFixedThreadPool(mkNumber);
-        chronometer.start();
-        for (GenericWriteTask genericWriteTask : tasks) {
-            threadExecutor.execute(genericWriteTask);
-        }
-        threadExecutor.shutdown();
-        threadExecutor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
-        chronometer.stop();
-        System.out.println("Total time is " + chronometer.getSeconds());
+        ConcurrentAddNodesMultipleCommits.concurentWritingPyramid1(mks,
+                mkNumber, nodesNumber, numberOfNodesPerCommit, chronometer);
+
     }
 
     @Test
     public void testConcurentWritingPyramid2() throws InterruptedException {
-        int children = 2;
-        ArrayList<GenericWriteTask> tasks = new ArrayList<GenericWriteTask>();
-        String diff;
-        for (int i = 0; i < mkNumber; i++) {
-
-            diff = MicroKernelOperation.buildPyramidDiff("/", 0, children,
-                    nodesNumber, "N" + i + "N", new StringBuilder()).toString();
-
-            tasks.add(new GenericWriteTask(mks.get(i), diff,
-                    numberOfNodesPerCommit));
-
-        }
-
-        ExecutorService threadExecutor = Executors.newFixedThreadPool(mkNumber);
-        chronometer.start();
-        for (GenericWriteTask genericWriteTask : tasks) {
-            threadExecutor.execute(genericWriteTask);
-        }
-        threadExecutor.shutdown();
-        threadExecutor.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
-        chronometer.stop();
-        System.out.println("Total time for is " + chronometer.getSeconds());
+        ConcurrentAddNodesMultipleCommits.concurentWritingPyramid2(mks,
+                mkNumber, nodesNumber, numberOfNodesPerCommit, chronometer);
     }
+
 }

Modified: jackrabbit/oak/trunk/oak-mongomk-perf/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk-perf/pom.xml?rev=1410319&r1=1410318&r2=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk-perf/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-mongomk-perf/pom.xml Fri Nov 16 12:29:42 2012
@@ -1,93 +1,143 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<!--
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-  -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
-                             http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+	license agreements. See the NOTICE file distributed with this work for additional 
+	information regarding copyright ownership. The ASF licenses this file to 
+	You under the Apache License, Version 2.0 (the "License"); you may not use 
+	this file except in compliance with the License. You may obtain a copy of 
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+	by applicable law or agreed to in writing, software distributed under the 
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+	OF ANY KIND, either express or implied. See the License for the specific 
+	language governing permissions and limitations under the License. -->
 
-  <parent>
-    <groupId>org.apache.jackrabbit</groupId>
-    <artifactId>oak-parent</artifactId>
-    <version>0.6-SNAPSHOT</version>
-    <relativePath>../oak-parent/pom.xml</relativePath>
-  </parent>
-
-  <artifactId>oak-mongomk-perf</artifactId>
-  <name>Oak Mongo MicroKernel Performance Test</name>
-
-  <dependencies>
-
-    <!-- Oak MongoMK -->
-    <dependency>
-      <groupId>org.apache.jackrabbit</groupId>
-      <artifactId>oak-mongomk</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-      <version>1.2.16</version>
-    </dependency>
-    <dependency>
-      <groupId>commons-cli</groupId>
-      <artifactId>commons-cli</artifactId>
-      <version>1.2</version>
-    </dependency>
-    <dependency>
-      <groupId>com.jamonapi</groupId>
-      <artifactId>jamon</artifactId>
-      <version>2.4</version>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <configuration>
-          <descriptorRefs>
-            <descriptorRef>jar-with-dependencies</descriptorRef>
-          </descriptorRefs>
-          <archive>
-            <manifest>
-              <mainClass>org.apache.jackrabbit.mongomk.perf.MicroKernelPerf</mainClass>
-            </manifest>
-          </archive>
-        </configuration>
-        <executions>
-          <execution>
-            <id>make-assembly</id>
-            <phase>package</phase>
-            <goals>
-              <goal>single</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+                             http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
 
+	<parent>
+		<groupId>org.apache.jackrabbit</groupId>
+		<artifactId>oak-parent</artifactId>
+		<version>0.6-SNAPSHOT</version>
+		<relativePath>../oak-parent/pom.xml</relativePath>
+	</parent>
+
+	<artifactId>oak-mongomk-perf</artifactId>
+	<name>Oak Mongo MicroKernel Performance Test</name>
+	<profiles>
+		<profile>
+			<id>local</id>
+			<build>
+				<plugins>
+					<plugin>
+						<artifactId>maven-dependency-plugin</artifactId>
+						<configuration>
+							<outputDirectory>
+								${project.build.outputDirectory}</outputDirectory>
+						</configuration>
+						<executions>
+							<execution>
+								<id>unpack-dependencies</id>
+								<phase>process-resources</phase>
+								<goals>
+									<goal>unpack-dependencies</goal>
+								</goals>
+							</execution>
+						</executions>
+					</plugin>
+
+					<plugin>
+						<groupId>org.evolvis.maven.plugins.remote-testing</groupId>
+						<artifactId>remote-testing-plugin</artifactId>
+						<version>0.6</version>
+						<configuration>
+							<testMachine>${remotehost}</testMachine>
+							<username>qe</username>
+							<password>${pass}</password>
+							<display>0</display>
+							<!--<keyFile>/home/rogoz/private-key-file</keyFile> -->
+							<remoteFolder>/home/qe/tests/</remoteFolder>
+							<pomfile>${basedir}/remotePom.xml</pomfile>
+						</configuration>
+						<executions>
+							<execution>
+								<id>remote testing</id>
+								<goals>
+									<goal>clean</goal>
+									<goal>test</goal>
+								</goals>
+							</execution>
+						</executions>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+	</profiles>
+	<dependencies>
+
+		<!-- Oak MongoMK -->
+		<dependency>
+			<groupId>org.apache.jackrabbit</groupId>
+			<artifactId>oak-mongomk</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+			<version>1.2.16</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-cli</groupId>
+			<artifactId>commons-cli</artifactId>
+			<version>1.2</version>
+		</dependency>
+		<dependency>
+			<groupId>com.jamonapi</groupId>
+			<artifactId>jamon</artifactId>
+			<version>2.4</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.jackrabbit</groupId>
+			<artifactId>oak-mk-perf</artifactId>
+			<version>0.6-SNAPSHOT</version>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<artifactId>maven-assembly-plugin</artifactId>
+				<configuration>
+					<descriptorRefs>
+						<descriptorRef>jar-with-dependencies</descriptorRef>
+					</descriptorRefs>
+					<archive>
+						<manifest>
+							<mainClass>org.apache.jackrabbit.mongomk.perf.MicroKernelPerf</mainClass>
+						</manifest>
+					</archive>
+				</configuration>
+				<executions>
+					<execution>
+						<id>make-assembly</id>
+						<phase>package</phase>
+						<goals>
+							<goal>single</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+	<pluginRepositories>
+		<pluginRepository>
+			<id>maven-repo.evolvis.org</id>
+			<url>http://maven-repo.evolvis.org/releases/</url>
+		</pluginRepository>
+	</pluginRepositories>
 </project>

Added: jackrabbit/oak/trunk/oak-mongomk-perf/remotePom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk-perf/remotePom.xml?rev=1410319&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk-perf/remotePom.xml (added)
+++ jackrabbit/oak/trunk/oak-mongomk-perf/remotePom.xml Fri Nov 16 12:29:42 2012
@@ -0,0 +1,57 @@
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+    license agreements. See the NOTICE file distributed with this work for additional 
+    information regarding copyright ownership. The ASF licenses this file to 
+    You under the Apache License, Version 2.0 (the "License"); you may not use 
+    this file except in compliance with the License. You may obtain a copy of 
+    the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+    by applicable law or agreed to in writing, software distributed under the 
+    License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+    OF ANY KIND, either express or implied. See the License for the specific 
+    language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.apache.jackrabbit</groupId>
+    <artifactId>remote-oak-mk-perf</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>jar</packaging>
+
+    <name>remote-sharedcloud-oak-performance</name>
+    <url>http://maven.apache.org</url>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+    <profiles>
+        <profile>
+            <id>remote</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <version>2.10</version>
+                        <dependencies>
+                            <dependency>
+                                <groupId>org.apache.maven.surefire</groupId>
+                                <artifactId>surefire-junit47</artifactId>
+                                <version>2.12.3</version>
+                            </dependency>
+                        </dependencies>
+                        <configuration>
+                            <systemPropertyVariables>
+                                <mk.type>${env.mktype}</mk.type>
+                            </systemPropertyVariables>
+                            <testFailureIgnore>false</testFailureIgnore>
+                            <argLine>-Xmx4056m</argLine>
+                            <includes>
+                                <include>**/*Test.java</include>
+                            </includes>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+</project>

Propchange: jackrabbit/oak/trunk/oak-mongomk-perf/remotePom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelMongoTestBase.java (from r1410265, jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelTestBase.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelMongoTestBase.java?p2=jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelMongoTestBase.java&p1=jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelTestBase.java&r1=1410265&r2=1410319&rev=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelTestBase.java (original)
+++ jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MicroKernelMongoTestBase.java Fri Nov 16 12:29:42 2012
@@ -23,15 +23,9 @@ import org.apache.jackrabbit.mk.util.Mic
 import org.junit.Before;
 import org.junit.BeforeClass;
 
-/**
- * The test base class for tests that are using only one microkernel instance.
- *
- *
- *
- */
-public class MicroKernelTestBase {
+public class MicroKernelMongoTestBase {
 
-    static MicroKernelInitializer initializator;
+    protected static MicroKernelInitializer initializator;
     public MicroKernel mk;
     public static Configuration conf;
     public Chronometer chronometer;
@@ -41,17 +35,12 @@ public class MicroKernelTestBase {
      * microkernel configuration.The method searches for the <b>mk.type</b>
      * system property in order to initialize the proper microkernel.By default,
      * the oak microkernel will be instantiated.
-     *
+     * 
      * @throws Exception
      */
     @BeforeClass
     public static void beforeSuite() throws Exception {
-
-        // FIXME - Add back
-        initializator = new OakMicroKernelInitializer();
-        //String mktype = System.getProperty("mk.type");
-        //initializator = (mktype == null || mktype.equals("oakmk")) ? new OakMicroKernelInitializer()
-        //        : new MongoMicroKernelInitializer();
+        initializator = new MongoMicroKernelInitializer();
         System.out.println("Tests will run against ***"
                 + initializator.getType() + "***");
         conf = MicroKernelConfigProvider.readConfig();
@@ -59,12 +48,11 @@ public class MicroKernelTestBase {
 
     /**
      * Creates a microkernel collection with only one microkernel.
-     *
+     * 
      * @throws Exception
      */
     @Before
     public void beforeTest() throws Exception {
-
         mk = (new MicroKernelCollection(initializator, conf, 1))
                 .getMicroKernels().get(0);
         chronometer = new Chronometer();

Added: jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoClearCollections.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoClearCollections.java?rev=1410319&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoClearCollections.java (added)
+++ jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoClearCollections.java Fri Nov 16 12:29:42 2012
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.mk.testing;
+
+import java.util.Arrays;
+
+import org.apache.jackrabbit.mongomk.impl.MongoConnection;
+import org.apache.jackrabbit.mongomk.impl.model.MongoCommit;
+import org.apache.jackrabbit.mongomk.impl.model.MongoNode;
+import org.apache.jackrabbit.mongomk.impl.model.MongoSync;
+import org.omg.Messaging.SYNC_WITH_TRANSPORT;
+
+import com.mongodb.BasicDBObject;
+import com.mongodb.DB;
+import com.mongodb.DBCollection;
+
+public class MongoClearCollections {
+
+    public static final String INITIAL_COMMIT_MESSAGE = "This is an autogenerated initial commit";
+    public static final String INITIAL_COMMIT_PATH = "";
+    public static final String INITIAL_COMMIT_DIFF = "+\"/\" : {}";
+
+    public static final String COLLECTION_COMMITS = "commits";
+    public static final String COLLECTION_NODES = "nodes";
+    public static final String COLLECTION_SYNC = "sync";
+
+    /**
+     * Removes all documents from nodes collection.
+     * 
+     * @param mongoConnection
+     */
+    public static void clearNodesCollection(MongoConnection mongoConnection) {
+
+        if (!mongoConnection.getDB().collectionExists(COLLECTION_NODES)) {
+            return;
+        }
+        DBCollection nodeCollection = mongoConnection.getDB().getCollection(
+                COLLECTION_NODES);
+        nodeCollection.remove(new BasicDBObject());
+        MongoNode root = new MongoNode();
+        root.setRevisionId(0L);
+        root.setPath("/");
+        nodeCollection.insert(root);
+    }
+
+    /**
+     * Removes all documents from commits collection.
+     * 
+     * @param mongoConnection
+     */
+    public static void clearCommitsCollection(MongoConnection mongoConnection) {
+        if (!mongoConnection.getDB().collectionExists(COLLECTION_COMMITS)) {
+            return;
+        }
+        DBCollection commitCollection = mongoConnection.getDB().getCollection(
+                COLLECTION_COMMITS);
+        commitCollection.remove(new BasicDBObject());
+
+        MongoCommit commit = new MongoCommit();
+        commit.setAffectedPaths(Arrays.asList(new String[] { "/" }));
+        commit.setBaseRevisionId(0L);
+        commit.setDiff(INITIAL_COMMIT_DIFF);
+        commit.setMessage(INITIAL_COMMIT_MESSAGE);
+        commit.setRevisionId(0L);
+        commit.setPath(INITIAL_COMMIT_PATH);
+        commitCollection.insert(commit);
+    }
+
+    /**
+     * Removes all documents from head collection.
+     * 
+     * @param mongoConnection
+     */
+    public static void clearHeadCollection(MongoConnection mongoConnection) {
+        if (!mongoConnection.getDB().collectionExists(COLLECTION_SYNC)) {
+            return;
+        }
+        DBCollection headCollection = mongoConnection.getDB().getCollection(
+                COLLECTION_SYNC);
+        headCollection.remove(new BasicDBObject());
+        MongoSync headMongo = new MongoSync();
+        headMongo.setHeadRevisionId(0L);
+        headMongo.setNextRevisionId(1L);
+        headCollection.insert(headMongo);
+    }
+
+    /**
+     * Removes all documents from all microkernel collections.
+     * 
+     * @param mongoConnection
+     */
+    public static void clearAllCollections(MongoConnection mongoConnection) {
+        clearNodesCollection(mongoConnection);
+        clearCommitsCollection(mongoConnection);
+        clearHeadCollection(mongoConnection);
+    }
+}

Propchange: jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoClearCollections.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoClearCollections.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Copied: jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoConcurrentMicroKernelTestBase.java (from r1410265, jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/ConcurrentMicroKernelTestBase.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoConcurrentMicroKernelTestBase.java?p2=jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoConcurrentMicroKernelTestBase.java&p1=jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/ConcurrentMicroKernelTestBase.java&r1=1410265&r2=1410319&rev=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk-perf/src/main/java/org/apache/jackrabbit/mk/testing/ConcurrentMicroKernelTestBase.java (original)
+++ jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoConcurrentMicroKernelTestBase.java Fri Nov 16 12:29:42 2012
@@ -25,30 +25,25 @@ import org.apache.jackrabbit.mk.util.Mic
 import org.junit.Before;
 import org.junit.BeforeClass;
 
-public class ConcurrentMicroKernelTestBase {
+public class MongoConcurrentMicroKernelTestBase {
     public static int mkNumber = 3;
     public ArrayList<MicroKernel> mks;
     public Chronometer chronometer;
     static MicroKernelInitializer initializator;
     static Configuration conf;
 
-
     /**
      * Loads the corresponding microkernel initialization class and the
      * microkernel configuration.The method searches for the <b>mk.type</b>
      * system property in order to initialize the proper microkernel.By default,
      * the oak microkernel will be instantiated.
-     *
+     * 
      * @throws Exception
      */
     @BeforeClass
     public static void beforeSuite() throws Exception {
 
-        // FIXME - Add back
-        initializator = new OakMicroKernelInitializer();
-        //String mktype = System.getProperty("mk.type");
-        //initializator = (mktype == null || mktype.equals("oakmk")) ? new OakMicroKernelInitializer()
-        //        : new MongoMicroKernelInitializer();
+        initializator = new MongoMicroKernelInitializer();
         System.out.println("Tests will run against ***"
                 + initializator.getType() + "***");
         conf = MicroKernelConfigProvider.readConfig();
@@ -56,7 +51,7 @@ public class ConcurrentMicroKernelTestBa
 
     /**
      * Creates a microkernel collection with only one microkernel.
-     *
+     * 
      * @throws Exception
      */
     @Before

Added: jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoMicroKernelInitializer.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoMicroKernelInitializer.java?rev=1410319&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoMicroKernelInitializer.java (added)
+++ jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoMicroKernelInitializer.java Fri Nov 16 12:29:42 2012
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.mk.testing;
+
+import java.util.ArrayList;
+
+import org.apache.jackrabbit.mk.api.MicroKernel;
+import org.apache.jackrabbit.mk.blobs.BlobStore;
+import org.apache.jackrabbit.mk.util.Configuration;
+import org.apache.jackrabbit.mongomk.impl.MongoConnection;
+import org.apache.jackrabbit.mongomk.impl.MongoMicroKernel;
+import org.apache.jackrabbit.mongomk.impl.MongoNodeStore;
+import org.apache.jackrabbit.mongomk.impl.blob.*;
+
+import com.mongodb.BasicDBObjectBuilder;
+
+/**
+ * Creates a {@code MongoMicroKernel}.Initialize the mongo database for the
+ * tests.
+ */
+public class MongoMicroKernelInitializer implements MicroKernelInitializer {
+
+    public ArrayList<MicroKernel> init(Configuration conf, int mksNumber)
+            throws Exception {
+
+        ArrayList<MicroKernel> mks = new ArrayList<MicroKernel>();
+
+        MongoConnection mongoConnection;
+        mongoConnection = new MongoConnection(conf.getHost(),
+                conf.getMongoPort(), conf.getMongoDatabase());
+
+        Thread.sleep(1000);
+        MongoClearCollections.clearAllCollections(mongoConnection);
+        mongoConnection.close();
+
+        mongoConnection = new MongoConnection(conf.getHost(),
+                conf.getMongoPort(), "admin");
+        // set the shard key
+        mongoConnection.getDB()
+                .command(
+                        BasicDBObjectBuilder
+                                .start("shardCollection", "test.nodes")
+                                .push("key").add("path", 1).add("revId", 1)
+                                .pop().get());
+
+        for (int i = 0; i < mksNumber; i++) {
+            mongoConnection = new MongoConnection(conf.getHost(),
+                    conf.getMongoPort(), conf.getMongoDatabase());
+            MongoNodeStore nodeStore = new MongoNodeStore(
+                    mongoConnection.getDB());
+            // MongoAssert.setNodeStore(nodeStore);
+            BlobStore blobStore = new MongoGridFSBlobStore(
+                    mongoConnection.getDB());
+            mks.add(new MongoMicroKernel(mongoConnection, nodeStore, blobStore));
+        }
+
+        return mks;
+    }
+
+    public String getType() {
+        return "Mongo Microkernel implementation";
+    }
+}

Propchange: jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoMicroKernelInitializer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/trunk/oak-mongomk-perf/src/main/java/org/apache/jackrabbit/mk/testing/MongoMicroKernelInitializer.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Modified: jackrabbit/oak/trunk/oak-mongomk-perf/src/main/resources/config.cfg
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk-perf/src/main/resources/config.cfg?rev=1410319&r1=1410318&r2=1410319&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk-perf/src/main/resources/config.cfg (original)
+++ jackrabbit/oak/trunk/oak-mongomk-perf/src/main/resources/config.cfg Fri Nov 16 12:29:42 2012
@@ -18,4 +18,10 @@ master.port = 12345
 
 mongo.host = localhost
 mongo.port = 27017
-mongo.db = mk-tf
\ No newline at end of file
+mongo.db = mk-tf
+
+mk.type=oak
+hostname=localhost
+mongo.port=27017
+mongo.database=test
+storage.path=target/mk-tck-repo
\ No newline at end of file



Mime
View raw message