de.flapdoodle.embed.mongo.tests
Class MongosForTestsFactory

java.lang.Object
  extended by de.flapdoodle.embed.mongo.tests.MongosForTestsFactory

public class MongosForTestsFactory
extends Object

This class encapsulates everything that would be needed to do embedded MongoDB with sharding testing.


Constructor Summary
MongosForTestsFactory()
          Create the testing utility using the latest production version of MongoDB.
MongosForTestsFactory(de.flapdoodle.embed.process.distribution.IVersion version)
          Create the testing utility using the specified version of MongoDB.
 
Method Summary
 com.mongodb.DB newDB(com.mongodb.Mongo mongo)
          Creates a new DB with unique name for connection.
 com.mongodb.Mongo newMongo()
          Creates a new Mongo connection.
 void shutdown()
          Cleans up the resources created by the utility.
static MongosForTestsFactory with(de.flapdoodle.embed.process.distribution.IVersion version)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MongosForTestsFactory

public MongosForTestsFactory()
                      throws IOException
Create the testing utility using the latest production version of MongoDB.

Throws:
IOException

MongosForTestsFactory

public MongosForTestsFactory(de.flapdoodle.embed.process.distribution.IVersion version)
                      throws IOException
Create the testing utility using the specified version of MongoDB.

Parameters:
version - version of MongoDB.
Throws:
IOException
Method Detail

with

public static MongosForTestsFactory with(de.flapdoodle.embed.process.distribution.IVersion version)
                                  throws IOException
Throws:
IOException

newMongo

public com.mongodb.Mongo newMongo()
                           throws UnknownHostException,
                                  com.mongodb.MongoException
Creates a new Mongo connection.

Throws:
com.mongodb.MongoException
UnknownHostException

newDB

public com.mongodb.DB newDB(com.mongodb.Mongo mongo)
Creates a new DB with unique name for connection.


shutdown

public void shutdown()
Cleans up the resources created by the utility.



Copyright © 2012. All Rights Reserved.