jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1409971 - in /jackrabbit/oak/trunk: ./ oak-mongomk/ oak-mongomk/src/test/java/org/apache/jackrabbit/mk/blobs/ oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/ oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/ oak-mongom...
Date Thu, 15 Nov 2012 20:15:07 GMT
Author: jukka
Date: Thu Nov 15 20:15:04 2012
New Revision: 1409971

URL: http://svn.apache.org/viewvc?rev=1409971&view=rev
Log:
OAK-293: MongoDB-based MicroKernel

Adjust the MongoMK tests so that they're automatically skipped
when no MongoDB instance is available. This way we can include
the oak-mongomk component to the default build without problems.

Added:
    jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/AbstractMongoConnectionTest.java
    jackrabbit/oak/trunk/oak-mongomk/src/test/resources/logging.properties
      - copied, changed from r1409893, jackrabbit/oak/trunk/oak-mongomk/src/test/resources/config.cfg
Removed:
    jackrabbit/oak/trunk/oak-mongomk/src/test/resources/config.cfg
Modified:
    jackrabbit/oak/trunk/oak-mongomk/pom.xml
    jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mk/blobs/MongoBlobStoreTest.java
    jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/BaseMongoMicroKernelTest.java
    jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKGetLengthTest.java
    jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKReadTest.java
    jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKWriteTest.java
    jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/multitenancy/MultiTenancyTest.java
    jackrabbit/oak/trunk/pom.xml

Modified: jackrabbit/oak/trunk/oak-mongomk/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/pom.xml?rev=1409971&r1=1409970&r2=1409971&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-mongomk/pom.xml Thu Nov 15 20:15:04 2012
@@ -61,6 +61,16 @@
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-scr-plugin</artifactId>
             </plugin>
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <systemPropertyVariables>
+                        <java.util.logging.config.file>
+                            src/test/resources/logging.properties
+                        </java.util.logging.config.file>
+                    </systemPropertyVariables>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 
@@ -146,6 +156,12 @@
         <scope>test</scope>
     </dependency>
     <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>jul-to-slf4j</artifactId>
+        <version>1.6.4</version>
+        <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>com.googlecode.json-simple</groupId>
       <artifactId>json-simple</artifactId>
       <version>1.1</version>

Modified: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mk/blobs/MongoBlobStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mk/blobs/MongoBlobStoreTest.java?rev=1409971&r1=1409970&r2=1409971&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mk/blobs/MongoBlobStoreTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mk/blobs/MongoBlobStoreTest.java
Thu Nov 15 20:15:04 2012
@@ -29,39 +29,27 @@ import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
-import java.util.Properties;
 import java.util.Random;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.apache.jackrabbit.mongomk.impl.MongoConnection;
+import org.apache.jackrabbit.mongomk.AbstractMongoConnectionTest;
 import org.apache.jackrabbit.mongomk.impl.blob.MongoBlobStore;
 import org.junit.After;
-import org.junit.AfterClass;
 import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
-import com.mongodb.DB;
-
 /**
  * Tests the {@link MongoBlobStore} implementation. It should really extend from
  * AbstractBlobStore but it cannot due to classpath issues, so instead AbstractBlobStore
  * tests are copied here as well.
  */
-public class MongoBlobStoreTest /*extends AbstractBlobStoreTest*/ {
+public class MongoBlobStoreTest extends AbstractMongoConnectionTest {
 
     protected AbstractBlobStore store;
-    private static DB db;
-
-    @BeforeClass
-    public static void setUpBeforeClass() throws Exception {
-        createDefaultMongoConnection();
-    }
 
     @Before
     public void setUp() throws Exception {
-        dropCollections();
-        MongoBlobStore blobStore = new MongoBlobStore(db);
+        MongoBlobStore blobStore = new MongoBlobStore(mongoConnection.getDB());
         blobStore.setBlockSize(128);
         blobStore.setBlockSizeMin(48);
         this.store = blobStore;
@@ -69,15 +57,9 @@ public class MongoBlobStoreTest /*extend
 
     @After
     public void tearDown() throws Exception {
-        dropCollections();
         store = null;
     }
 
-    @AfterClass
-    public static void tearDownAfterClass() throws Exception {
-        db.dropDatabase();
-    }
-
     @Test
     public void testWriteFile() throws Exception {
         store.setBlockSize(1024 * 1024);
@@ -305,23 +287,4 @@ public class MongoBlobStoreTest /*extend
         return data;
     }
 
-    private static void createDefaultMongoConnection() throws Exception {
-        InputStream is = MongoBlobStoreTest.class.getResourceAsStream("/config.cfg");
-        Properties properties = new Properties();
-        properties.load(is);
-
-        String host = properties.getProperty("host");
-        int port = Integer.parseInt(properties.getProperty("port"));
-        String database = properties.getProperty("db");
-
-        MongoConnection mongoConnection = new MongoConnection(host, port, database);
-        db = mongoConnection.getDB();
-    }
-
-    protected void dropCollections() {
-        if (db == null) {
-            return;
-        }
-        db.getCollection(MongoBlobStore.COLLECTION_BLOBS).drop();
-    }
 }
\ No newline at end of file

Added: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/AbstractMongoConnectionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/AbstractMongoConnectionTest.java?rev=1409971&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/AbstractMongoConnectionTest.java
(added)
+++ jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/AbstractMongoConnectionTest.java
Thu Nov 15 20:15:04 2012
@@ -0,0 +1,72 @@
+/*
+ * 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.mongomk;
+
+import org.apache.jackrabbit.mongomk.impl.MongoConnection;
+import org.junit.After;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.BeforeClass;
+
+import com.mongodb.BasicDBObject;
+import com.mongodb.DB;
+
+/**
+ * Base class for test cases that need a {@link MongoConnection}
+ * to a clean test database. Tests in subclasses are automatically
+ * skipped if the configured MongoDB connection can not be created.
+ */
+public class AbstractMongoConnectionTest {
+
+    protected static final String HOST =
+            System.getProperty("mongo.host", "127.0.0.1");
+
+    protected static final int PORT =
+            Integer.getInteger("mongo.port", 27017);
+
+    protected static final String DB =
+            System.getProperty("mongo.db", "MongoMKDB");
+
+    protected static MongoConnection mongoConnection;
+
+    private static Exception mongoException = null;
+
+    @BeforeClass
+    public static void setUpBeforeClass() throws Exception {
+        if (mongoConnection == null) {
+            mongoConnection = new MongoConnection(HOST, PORT, DB);
+            try {
+                mongoConnection.getDB().command(new BasicDBObject("ping", 1));
+            } catch (Exception e) {
+                mongoException = e;
+            }
+        }
+        Assume.assumeNoException(mongoException);
+    }
+
+    @Before
+    public void setUpConnection() throws Exception {
+        // the database will get automatically recreated
+        mongoConnection.getDB().dropDatabase(); 
+    }
+
+    @After
+    public void tearDownConnection() throws Exception {
+        mongoConnection.getDB().dropDatabase();
+    }
+
+}

Modified: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/BaseMongoMicroKernelTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/BaseMongoMicroKernelTest.java?rev=1409971&r1=1409970&r2=1409971&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/BaseMongoMicroKernelTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/BaseMongoMicroKernelTest.java
Thu Nov 15 20:15:04 2012
@@ -22,61 +22,34 @@ import static org.junit.Assert.assertNot
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.io.InputStream;
-import java.util.Properties;
-
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.blobs.BlobStore;
-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.MongoBlobStore;
 import org.apache.jackrabbit.mongomk.impl.blob.MongoGridFSBlobStore;
 import org.json.simple.JSONArray;
 import org.json.simple.JSONObject;
 import org.json.simple.parser.JSONParser;
-import org.junit.After;
-import org.junit.AfterClass;
 import org.junit.Before;
-import org.junit.BeforeClass;
 
 import com.mongodb.DB;
 
 /**
  * Base class for {@code MongoDB} tests that need the MongoMK.
  */
-public class BaseMongoMicroKernelTest {
+public class BaseMongoMicroKernelTest extends AbstractMongoConnectionTest {
 
     public static MicroKernel mk;
-    public static MongoConnection mongoConnection;
-
-    @BeforeClass
-    public static void setUpBeforeClass() throws Exception {
-        createDefaultMongoConnection();
-    }
 
     @Before
     public void setUp() throws Exception {
         DB db = mongoConnection.getDB();
-        dropCollections(db);
-
         MongoNodeStore nodeStore = new MongoNodeStore(db);
         MongoAssert.setNodeStore(nodeStore);
         BlobStore blobStore = new MongoGridFSBlobStore(db);
         mk = new MongoMicroKernel(mongoConnection, nodeStore, blobStore);
     }
 
-    @After
-    public void tearDown() throws Exception {
-        DB db = mongoConnection.getDB();
-        dropCollections(db);
-    }
-
-    @AfterClass
-    public static void tearDownAfterClass() throws Exception {
-        mongoConnection.getDB().dropDatabase();
-    }
-
     protected MongoNodeStore getNodeStore() {
         MongoMicroKernel mongoMk = (MongoMicroKernel)mk;
         return (MongoNodeStore)mongoMk.getNodeStore();
@@ -223,22 +196,4 @@ public class BaseMongoMicroKernelTest {
         return val;
     }
 
-    private static void createDefaultMongoConnection() throws Exception {
-        InputStream is = BaseMongoMicroKernelTest.class.getResourceAsStream("/config.cfg");
-        Properties properties = new Properties();
-        properties.load(is);
-
-        String host = properties.getProperty("host");
-        int port = Integer.parseInt(properties.getProperty("port"));
-        String database = properties.getProperty("db");
-
-        mongoConnection = new MongoConnection(host, port, database);
-    }
-
-    protected void dropCollections(DB db) {
-        db.getCollection(MongoBlobStore.COLLECTION_BLOBS).drop();
-        db.getCollection(MongoNodeStore.COLLECTION_COMMITS).drop();
-        db.getCollection(MongoNodeStore.COLLECTION_NODES).drop();
-        db.getCollection(MongoNodeStore.COLLECTION_SYNC).drop();
-    }
 }
\ No newline at end of file

Modified: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKGetLengthTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKGetLengthTest.java?rev=1409971&r1=1409970&r2=1409971&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKGetLengthTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKGetLengthTest.java
Thu Nov 15 20:15:04 2012
@@ -22,7 +22,7 @@ import static org.junit.Assert.fail;
 import java.io.ByteArrayInputStream;
 
 import org.apache.jackrabbit.mk.blobs.BlobStore;
-import org.apache.jackrabbit.mongomk.BaseMongoMicroKernelTest;
+import org.apache.jackrabbit.mongomk.AbstractMongoConnectionTest;
 import org.apache.jackrabbit.mongomk.MongoAssert;
 import org.apache.jackrabbit.mongomk.impl.blob.MongoBlobStore;
 import org.junit.Before;
@@ -33,14 +33,13 @@ import com.mongodb.DB;
 /**
  * Tests for {@code MongoMicroKernel#getLength(String)}
  */
-public class MongoMKGetLengthTest extends BaseMongoMicroKernelTest {
+public class MongoMKGetLengthTest extends AbstractMongoConnectionTest {
+
+    private MongoMicroKernel mk;
 
-    // Override to set the right blob store.
     @Before
     public void setUp() throws Exception {
-        super.setUp();
         DB db = mongoConnection.getDB();
-        dropCollections(db);
 
         MongoNodeStore nodeStore = new MongoNodeStore(db);
         MongoAssert.setNodeStore(nodeStore);

Modified: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKReadTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKReadTest.java?rev=1409971&r1=1409970&r2=1409971&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKReadTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKReadTest.java
Thu Nov 15 20:15:04 2012
@@ -23,7 +23,7 @@ import junit.framework.Assert;
 
 import org.apache.jackrabbit.mk.blobs.BlobStore;
 import org.apache.jackrabbit.mk.util.MicroKernelInputStream;
-import org.apache.jackrabbit.mongomk.BaseMongoMicroKernelTest;
+import org.apache.jackrabbit.mongomk.AbstractMongoConnectionTest;
 import org.apache.jackrabbit.mongomk.impl.blob.MongoBlobStore;
 import org.junit.Before;
 import org.junit.Test;
@@ -33,17 +33,15 @@ import com.mongodb.DB;
 /**
  * Tests for {@code MongoMicroKernel#read(String, long, byte[], int, int)}
  */
-public class MongoMKReadTest extends BaseMongoMicroKernelTest {
+public class MongoMKReadTest extends AbstractMongoConnectionTest {
 
+    private MongoMicroKernel mk;
     private byte[] blob;
     private String blobId;
 
-    // Override to set the right blob store.
     @Before
     public void setUp() throws Exception {
-        super.setUp();
         DB db = mongoConnection.getDB();
-        dropCollections(db);
 
         MongoNodeStore nodeStore = new MongoNodeStore(db);
         BlobStore blobStore = new MongoBlobStore(db);

Modified: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKWriteTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKWriteTest.java?rev=1409971&r1=1409970&r2=1409971&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKWriteTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/impl/MongoMKWriteTest.java
Thu Nov 15 20:15:04 2012
@@ -24,7 +24,7 @@ import java.util.Arrays;
 
 import org.apache.jackrabbit.mk.blobs.BlobStore;
 import org.apache.jackrabbit.mk.util.MicroKernelInputStream;
-import org.apache.jackrabbit.mongomk.BaseMongoMicroKernelTest;
+import org.apache.jackrabbit.mongomk.AbstractMongoConnectionTest;
 import org.apache.jackrabbit.mongomk.MongoAssert;
 import org.apache.jackrabbit.mongomk.impl.blob.MongoBlobStore;
 import org.junit.Before;
@@ -35,14 +35,13 @@ import com.mongodb.DB;
 /**
  * Tests for {@code MongoMicroKernel#write(java.io.InputStream)}
  */
-public class MongoMKWriteTest extends BaseMongoMicroKernelTest {
+public class MongoMKWriteTest extends AbstractMongoConnectionTest {
+
+    private MongoMicroKernel mk;
 
-    // Override to set the right blob store.
     @Before
     public void setUp() throws Exception {
-        super.setUp();
         DB db = mongoConnection.getDB();
-        dropCollections(db);
 
         MongoNodeStore nodeStore = new MongoNodeStore(db);
         MongoAssert.setNodeStore(nodeStore);

Modified: jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/multitenancy/MultiTenancyTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/multitenancy/MultiTenancyTest.java?rev=1409971&r1=1409970&r2=1409971&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/multitenancy/MultiTenancyTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/test/java/org/apache/jackrabbit/mongomk/multitenancy/MultiTenancyTest.java
Thu Nov 15 20:15:04 2012
@@ -20,17 +20,13 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 
-import java.io.InputStream;
-import java.util.Properties;
-
 import org.apache.jackrabbit.mk.api.MicroKernel;
+import org.apache.jackrabbit.mongomk.AbstractMongoConnectionTest;
 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.MongoBlobStore;
 import org.apache.jackrabbit.mongomk.impl.blob.MongoGridFSBlobStore;
 import org.junit.After;
-import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -40,34 +36,47 @@ import com.mongodb.DB;
 /**
  * Tests for multi-tenancy.
  */
-public class MultiTenancyTest {
+public class MultiTenancyTest extends AbstractMongoConnectionTest {
+
+    private static final String DB2 =
+            System.getProperty("mongo.db", "MongoMKDB2");
+
+    private static MongoConnection mongoConnection2;
+    private static MongoConnection mongoConnection3;
 
     private static MicroKernel mk1;
     private static MicroKernel mk2;
     private static MicroKernel mk3;
-    private static MongoConnection mongoConnection1;
-    private static MongoConnection mongoConnection2;
-    private static MongoConnection mongoConnection3;
 
     @BeforeClass
-    public static void setUpBeforeClass() throws Exception {
-        createMongoConnections();
+    public static void createMongoConnections() throws Exception {
+        mongoConnection2 = new MongoConnection(HOST, PORT, DB2);
+        mongoConnection3 = new MongoConnection(HOST, PORT, DB);
     }
 
+
     @Before
-    public void setUp() throws Exception {
-        dropCollections();
-        setupMicroKernels();
-    }
+    public void setupMicroKernels() throws Exception {
+        mongoConnection2.getDB().dropDatabase();
+        // DB1 handled by the AbstractMongoConnectionTest
 
-    @After
-    public void tearDown() throws Exception {
-        dropCollections();
+        DB db = mongoConnection.getDB();
+        mk1 = new MongoMicroKernel(mongoConnection, new MongoNodeStore(db),
+                new MongoGridFSBlobStore(db));
+
+        DB db2 = mongoConnection2.getDB();
+        mk2 = new MongoMicroKernel(mongoConnection2, new MongoNodeStore(db2),
+                new MongoGridFSBlobStore(db2));
+
+        DB db3 = mongoConnection3.getDB();
+        mk3 = new MongoMicroKernel(mongoConnection3, new MongoNodeStore(db3),
+                new MongoGridFSBlobStore(db3));
     }
 
-    @AfterClass
-    public static void tearDownAfterClass() throws Exception {
-        dropDatabases();
+    @After
+    public void dropDatabases() throws Exception {
+        mongoConnection2.getDB().dropDatabase();
+        // DB1 handled by the AbstractMongoConnectionTest
     }
 
     /**
@@ -99,51 +108,4 @@ public class MultiTenancyTest {
         assertFalse(mk3.nodeExists("/c", null));
     }
 
-    private static void createMongoConnections() throws Exception {
-        InputStream is = MultiTenancyTest.class.getResourceAsStream("/config.cfg");
-        Properties properties = new Properties();
-        properties.load(is);
-
-        String host = properties.getProperty("host");
-        int port = Integer.parseInt(properties.getProperty("port"));
-        String db1 = properties.getProperty("db");
-        String db2 = properties.getProperty("db2");
-
-        mongoConnection1 = new MongoConnection(host, port, db1);
-        mongoConnection2 = new MongoConnection(host, port, db2);
-        mongoConnection3 = new MongoConnection(host, port, db1);
-    }
-
-    private static void dropDatabases() {
-        mongoConnection1.getDB().dropDatabase();
-        mongoConnection2.getDB().dropDatabase();
-        mongoConnection3.getDB().dropDatabase();
-    }
-
-    private void dropCollections() {
-        doDropCollections(mongoConnection1.getDB());
-        doDropCollections(mongoConnection2.getDB());
-        doDropCollections(mongoConnection3.getDB());
-    }
-
-    private void doDropCollections(DB db) {
-        db.getCollection(MongoBlobStore.COLLECTION_BLOBS).drop();
-        db.getCollection(MongoNodeStore.COLLECTION_COMMITS).drop();
-        db.getCollection(MongoNodeStore.COLLECTION_NODES).drop();
-        db.getCollection(MongoNodeStore.COLLECTION_SYNC).drop();
-    }
-
-    private void setupMicroKernels() {
-        DB db = mongoConnection1.getDB();
-        mk1 = new MongoMicroKernel(mongoConnection1, new MongoNodeStore(db),
-                new MongoGridFSBlobStore(db));
-
-        DB db2 = mongoConnection2.getDB();
-        mk2 = new MongoMicroKernel(mongoConnection2, new MongoNodeStore(db2),
-                new MongoGridFSBlobStore(db2));
-
-        DB db3 = mongoConnection1.getDB();
-        mk3 = new MongoMicroKernel(mongoConnection3, new MongoNodeStore(db3),
-                new MongoGridFSBlobStore(db3));
-    }
 }
\ No newline at end of file

Copied: jackrabbit/oak/trunk/oak-mongomk/src/test/resources/logging.properties (from r1409893,
jackrabbit/oak/trunk/oak-mongomk/src/test/resources/config.cfg)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/test/resources/logging.properties?p2=jackrabbit/oak/trunk/oak-mongomk/src/test/resources/logging.properties&p1=jackrabbit/oak/trunk/oak-mongomk/src/test/resources/config.cfg&r1=1409893&r2=1409971&rev=1409971&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/test/resources/config.cfg (original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/test/resources/logging.properties Thu Nov 15 20:15:04
2012
@@ -13,19 +13,4 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# This file contains configuration properties for the MongoDB related services. These properties
are
-# required for the SharedCloud MicroKernel integration tests.
-#
-# Please be cautious with any blanklines and whitespaces!
-
-# The host of the running mongodb or mongos process
-host = 127.0.0.1
-
-# The port of the running mongodb or mongos process
-port = 27017
-
-# The database to use
-db = MongoMKDB
-
-# The secondary database to use for multi-tenancy tests
-db2 = MongoMKDB2
\ No newline at end of file
+handlers = org.slf4j.bridge.SLF4JBridgeHandler

Modified: jackrabbit/oak/trunk/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/pom.xml?rev=1409971&r1=1409970&r2=1409971&view=diff
==============================================================================
--- jackrabbit/oak/trunk/pom.xml (original)
+++ jackrabbit/oak/trunk/pom.xml Thu Nov 15 20:15:04 2012
@@ -41,15 +41,16 @@
     <module>oak-mk-api</module>
     <module>oak-mk</module>
     <module>oak-mk-remote</module>
+    <module>oak-mongomk</module>
     <module>oak-core</module>
     <module>oak-jcr</module>
     <module>oak-sling</module>
     <module>oak-http</module>
+    <module>oak-lucene</module>
     <module>oak-run</module>
     <module>oak-it</module>
     <module>oak-bench</module>
     <module>oak-mk-perf</module>
-    <module>oak-lucene</module>
   </modules>
 
   <scm>
@@ -92,7 +93,6 @@
     <profile>
       <id>mongomk</id>
       <modules>
-        <module>oak-mongomk</module>
         <module>oak-mongomk-test</module>
         <module>oak-mongomk-perf</module>
       </modules>



Mime
View raw message