jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1453822 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoMKRepositoryStub.java
Date Thu, 07 Mar 2013 12:45:42 GMT
Author: mreutegg
Date: Thu Mar  7 12:45:42 2013
New Revision: 1453822

URL: http://svn.apache.org/r1453822
Log:
OAK-682: Run Oak-Jcr tests using the new MongoMK prototype
- update OakMongoMKRepositoryStub to use the new MongoMK prototype

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoMKRepositoryStub.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoMKRepositoryStub.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoMKRepositoryStub.java?rev=1453822&r1=1453821&r2=1453822&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoMKRepositoryStub.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoMKRepositoryStub.java
Thu Mar  7 12:45:42 2013
@@ -27,11 +27,8 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.UnsupportedRepositoryOperationException;
 
-import org.apache.jackrabbit.mk.core.MicroKernelImpl;
 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.MongoGridFSBlobStore;
+import org.apache.jackrabbit.mongomk.prototype.MongoMK;
 import org.apache.jackrabbit.test.NotExecutableException;
 import org.apache.jackrabbit.test.RepositoryStub;
 
@@ -66,9 +63,7 @@ public class OakMongoMKRepositoryStub ex
         Session session = null;
         try {
             this.connection = new MongoConnection(HOST, PORT, DB);
-            Jcr jcr = new Jcr(new MongoMicroKernel(connection,
-                    new MongoNodeStore(connection.getDB()),
-                    new MongoGridFSBlobStore(connection.getDB())));
+            Jcr jcr = new Jcr(new MongoMK(connection.getDB(), 0));
             jcr.with(Executors.newScheduledThreadPool(1));
             this.repository = jcr.createRepository();
 
@@ -91,12 +86,17 @@ public class OakMongoMKRepositoryStub ex
     }
 
     public static boolean isMongoDBAvailable() {
+        MongoConnection connection = null;
         try {
-            MongoConnection connection = new MongoConnection(HOST, PORT, DB);
+            connection = new MongoConnection(HOST, PORT, DB);
             connection.getDB().command(new BasicDBObject("ping", 1));
             return true;
         } catch (Exception e) {
             return false;
+        } finally {
+            if (connection != null) {
+                connection.close();
+            }
         }
     }
 



Mime
View raw message