gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewi...@apache.org
Subject [03/50] [abbrv] git commit: Upgrade de.flapdoodle.embed.mongo to 1.42
Date Wed, 04 Jun 2014 16:36:20 GMT
Upgrade de.flapdoodle.embed.mongo to 1.42

* Replace Mongo by MongoClient
* Use MongodConfigBuilder


Project: http://git-wip-us.apache.org/repos/asf/gora/repo
Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/30c671b1
Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/30c671b1
Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/30c671b1

Branch: refs/heads/master
Commit: 30c671b1672655d6d7f4e2b2bd79486e44e8a3d2
Parents: 6719773
Author: Damien Raude-Morvan <damien@dictanova.com>
Authored: Wed Apr 16 00:17:38 2014 +0200
Committer: Damien Raude-Morvan <damien@dictanova.com>
Committed: Wed Apr 16 00:18:55 2014 +0200

----------------------------------------------------------------------
 gora-mongodb/pom.xml                            |  2 +-
 .../gora/mongodb/GoraMongodbTestDriver.java     | 24 ++++++++++++++------
 2 files changed, 18 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/gora/blob/30c671b1/gora-mongodb/pom.xml
----------------------------------------------------------------------
diff --git a/gora-mongodb/pom.xml b/gora-mongodb/pom.xml
index fc2dbb8..5ff0b21 100644
--- a/gora-mongodb/pom.xml
+++ b/gora-mongodb/pom.xml
@@ -170,7 +170,7 @@
         <dependency>
             <groupId>de.flapdoodle.embed</groupId>
             <artifactId>de.flapdoodle.embed.mongo</artifactId>
-            <version>1.33</version>
+            <version>1.42</version>
             <scope>test</scope>
         </dependency>
 

http://git-wip-us.apache.org/repos/asf/gora/blob/30c671b1/gora-mongodb/src/test/java/org/apache/gora/mongodb/GoraMongodbTestDriver.java
----------------------------------------------------------------------
diff --git a/gora-mongodb/src/test/java/org/apache/gora/mongodb/GoraMongodbTestDriver.java
b/gora-mongodb/src/test/java/org/apache/gora/mongodb/GoraMongodbTestDriver.java
index 3c17e9e..e4f6e38 100644
--- a/gora-mongodb/src/test/java/org/apache/gora/mongodb/GoraMongodbTestDriver.java
+++ b/gora-mongodb/src/test/java/org/apache/gora/mongodb/GoraMongodbTestDriver.java
@@ -25,7 +25,10 @@ package org.apache.gora.mongodb;
 
 import com.mongodb.Mongo;
 
-import de.flapdoodle.embed.mongo.config.MongodConfig;
+import com.mongodb.MongoClient;
+import de.flapdoodle.embed.mongo.config.IMongodConfig;
+import de.flapdoodle.embed.mongo.config.MongodConfigBuilder;
+import de.flapdoodle.embed.mongo.config.Net;
 import de.flapdoodle.embed.mongo.distribution.Version;
 import de.flapdoodle.embed.mongo.MongodExecutable;
 import de.flapdoodle.embed.mongo.MongodProcess;
@@ -43,8 +46,7 @@ public class GoraMongodbTestDriver extends GoraTestDriver {
 
   private MongodExecutable _mongodExe;
   private MongodProcess _mongod;
-
-  private Mongo _mongo;
+  private MongoClient _mongo;
 
   
   /**
@@ -60,13 +62,21 @@ public class GoraMongodbTestDriver extends GoraTestDriver {
   @Override
   public void setUpClass() throws Exception {
     super.setUpClass();
-    log.info("Starting embedded Mongodb server on the default port: 27017");
-    try {
       MongodStarter runtime = MongodStarter.getDefaultInstance();
-      _mongodExe = runtime.prepare(new MongodConfig(Version.Main.PRODUCTION, 27017, Network.localhostIsIPv6()));
+
+      int port = 27017;
+      IMongodConfig mongodConfig = new MongodConfigBuilder()
+              .version(Version.Main.PRODUCTION)
+              .net(new Net(port, Network.localhostIsIPv6()))
+              .build();
+
+    log.info("Starting embedded Mongodb server on the default port: {}" + port);
+    try {
+
+        _mongodExe = runtime.prepare(mongodConfig);
       _mongod = _mongodExe.start();
 
-      _mongo = new Mongo("localhost", 27017);
+       _mongo = new MongoClient("localhost", port);
     } catch (Exception e) {
       log.error("Error starting embedded Mongodb server... tearing down test driver.");
       tearDownClass();


Mime
View raw message