Package de.flapdoodle.embed.mongo

Examples of de.flapdoodle.embed.mongo.MongodStarter.prepare()


  @Before
  public void beforeEach() throws Exception {

    MongodStarter runtime = MongodStarter.getDefaultInstance();
    mongodExecutable = runtime.prepare(new MongodConfig(Version.V2_2_1, 12345, Network.localhostIsIPv6()));
    mongodProcess = mongodExecutable.start();
    Mongo mongo = new Mongo("localhost", 12345);
    db = mongo.getDB(DATABASE_NAME);

    // Create collections
View Full Code Here


            .version(Version.Main.PRODUCTION)
            .net(new Net(port, Network.localhostIsIPv6()))
            .build();

        try {
            mongodExecutable = starter.prepare(mongodConfig);
            MongodProcess mongod = mongodExecutable.start();
           
            mongoClient = FiberMongoFactory.createClient( "mongodb://localhost:" + port + "/test?maxConnectionCount=10" ).asSerializedClient();
        } catch (IOException ioe) {
            tearDownClass();
View Full Code Here

    conf.set(MongoStore.PROP_MONGO_SERVERS, "127.0.0.1:" + port);

    log.info("Starting embedded Mongodb server on {} port.", port);
    try {

      _mongodExe = runtime.prepare(mongodConfig);
      _mongod = _mongodExe.start();

      _mongo = new MongoClient("localhost", port);
    } catch (Exception e) {
      log.error("Error starting embedded Mongodb server... tearing down test driver.");
View Full Code Here

        IMongodConfig mongodConfig = new MongodConfigBuilder()
            .version(Version.Main.V2_4)
            .net(new Net(PORT, Network.localhostIsIPv6()))
            .build();

        MongodExecutable mongodExecutable = starter.prepare(mongodConfig);
        mongod = mongodExecutable.start();
    } catch (IOException e) {
      throw new IllegalStateException(e);
    }
  }
View Full Code Here

                                       }))
                .build();

        MongodStarter runtime = MongodStarter.getInstance(runtimeConfig);

        return runtime.prepare(mongodConfig);
    }
}
View Full Code Here

    @BeforeClass
    public static void setUpClass() throws Exception {
        RuntimeConfig config = RuntimeConfig.getInstance(LOGGER);
        MongodStarter runtime = MongodStarter.getInstance(config);
        int freeServerPort = Network.getFreeServerPort();
        mongodExecutable = runtime.prepare(new MongodConfig(Version.Main.V2_3, freeServerPort,
                                                                             Network.localhostIsIPv6()));
        mongodProcess = mongodExecutable.start();

        binaryStore = new MongodbBinaryStore("localhost", freeServerPort, "test-" + UUID.randomUUID());
        binaryStore.start();
View Full Code Here

  private DB db;

  @BeforeMethod
  public void setup() throws Exception {
      MongodStarter runtime = MongodStarter.getDefaultInstance();
      MongodExecutable mongodExe = runtime.prepare( new MongodConfig(Version.V2_3_0, 12345,
          Network.localhostIsIPv6()) );
      mongod = mongodExe.start();
      mongo = new Mongo("localhost", 12345);
      db = mongo.getDB(DATABASE_NAME);
  }
View Full Code Here

  @SuppressWarnings("deprecation")
  @Before
  public void beforeEach() throws Exception {
    MongodStarter  runtime = MongodStarter .getDefaultInstance();
      mongodExe = runtime.prepare(new MongodConfig(Version.V2_0_1, MONGODB_PORT, Network.localhostIsIPv6()));
      mongod = mongodExe.start();
      mongo = new Mongo("localhost", MONGODB_PORT);
  }

  @After
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.