jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1448028 - /jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/fixture/OakRepositoryFixture.java
Date Wed, 20 Feb 2013 08:02:28 GMT
Author: jukka
Date: Wed Feb 20 08:02:28 2013
New Revision: 1448028

URL: http://svn.apache.org/r1448028
Log:
OAK-641: Improved benchmark tooling

Fix teardown code also for the new MongoMK fixture

Modified:
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/fixture/OakRepositoryFixture.java

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/fixture/OakRepositoryFixture.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/fixture/OakRepositoryFixture.java?rev=1448028&r1=1448027&r2=1448028&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/fixture/OakRepositoryFixture.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/fixture/OakRepositoryFixture.java
Wed Feb 20 08:02:28 2013
@@ -108,14 +108,13 @@ public abstract class OakRepositoryFixtu
 
     public static RepositoryFixture getNewMongo() {
         return new OakRepositoryFixture() {
-            private MongoConnection mongo;
             private MongoMK[] kernels;
             @Override
             public void setUpCluster(Repository[] cluster) throws Exception {
-                mongo = new MongoConnection(
-                        "127.0.0.1", 27017, "oak-benchmark-newmongo");
                 kernels = new MongoMK[cluster.length];
                 for (int i = 0; i < cluster.length; i++) {
+                    MongoConnection mongo = new MongoConnection(
+                            "127.0.0.1", 27017, "oak-benchmark-newmongo");
                     kernels[i] = new MongoMK(mongo.getDB(), i);
                     cluster[i] = new Jcr(kernels[i]).createRepository();
                 }
@@ -125,8 +124,14 @@ public abstract class OakRepositoryFixtu
                 for (MongoMK kernel : kernels) {
                     kernel.dispose();
                 }
-                mongo.getDB().dropDatabase();
-                mongo.close();
+                try {
+                    MongoConnection mongo = new MongoConnection(
+                            "127.0.0.1", 27017, "oak-benchmark-mongo");
+                    mongo.getDB().dropDatabase();
+                    mongo.close();
+                } catch (Exception e) {
+                    throw new IllegalStateException(e);
+                }
             }
         };
     }



Mime
View raw message