private void initializeMongos() throws Exception { MongosStarter runtime = MongosStarter.getInstance(new RuntimeConfigBuilder() .defaultsWithLogger(Command.MongoS,logger) .processOutput(outputFunction.apply(Command.MongoS)) .build()); mongosExecutable = runtime.prepare(config); mongosProcess = mongosExecutable.start(); }
.defaultsWithLogger(Command.MongoD,logger) .processOutput(outputFunction.apply(Command.MongoD)) .build();
private void initializeMongos() throws Exception { MongosStarter runtime = MongosStarter.getInstance(new RuntimeConfigBuilder() .defaultsWithLogger(Command.MongoS,logger) .build()); mongosExecutable = runtime.prepare(config); mongosProcess = mongosExecutable.start(); }
/** * Create the testing utility using the specified version of MongoDB. * * @param version * version of MongoDB. */ private EmbeddedMongoFactory(final IFeatureAwareVersion version) throws IOException { final MongodStarter runtime = MongodStarter.getInstance(new RuntimeConfigBuilder().defaultsWithLogger(Command.MongoD, logger).build()); mongodExecutable = runtime.prepare(newMongodConfig(version)); mongodProcess = mongodExecutable.start(); }
/** * Create the testing utility using the specified version of MongoDB. * * @param version * version of MongoDB. */ private EmbeddedMongoFactory(final IFeatureAwareVersion version) throws IOException { final MongodStarter runtime = MongodStarter.getInstance(new RuntimeConfigBuilder().defaultsWithLogger(Command.MongoD, logger).build()); mongodExecutable = runtime.prepare(newMongodConfig(version)); mongodProcess = mongodExecutable.start(); }
/** * Create the testing utility using the specified version of MongoDB. * * @param version * version of MongoDB. */ public MongodForTestsFactory(final IFeatureAwareVersion version) throws IOException { final MongodStarter runtime = MongodStarter.getInstance(new RuntimeConfigBuilder() .defaultsWithLogger(Command.MongoD, logger) .build()); mongodExecutable = runtime.prepare(newMongodConfig(version)); mongodProcess = mongodExecutable.start(); }
public static void startMongoDB() throws IOException { if (!started.compareAndSet(false, true)) { throw new RuntimeException("Embedded mongo already running, call stopMongoDB before starting it again!"); } final String bindIp = "localhost"; try { final int port = Network.getFreeServerPort(); final IMongodConfig mongodConfig = new MongodConfigBuilder() .version(Version.Main.PRODUCTION) .net(new Net(bindIp, port, Network.localhostIsIPv6())) .build(); final MongodStarter runtime = MongodStarter.getInstance(new RuntimeConfigBuilder() .defaultsWithLogger(Command.MongoD, LOG) .build()); mongodExecutable = runtime.prepare(mongodConfig, Distribution.detectFor(Version.Main.PRODUCTION)); mongodProcess = mongodExecutable.start(); mongoClient = new MongoClient(bindIp, port); } catch (final IOException e) { stopMongoDB(); throw e; } }
.defaultsWithLogger(Command.MongoS,logger) .build()); .defaultsWithLogger(Command.MongoS, logger) .build());