.net(new Net(LOCALHOST, port, Network.localhostIsIPv6())) // .cmdOptions(cmdOptions);
.net(new Net(LOCALHOST, port, Network.localhostIsIPv6())) //
protected static MongodConfigBuilder createMongodConfigBuilder(int port) throws Exception { return new MongodConfigBuilder() .version(Version.Main.V2_4) .net(new Net(port, Network.localhostIsIPv6())); }
@Override public void configure() throws Exception { conf = new MongodConfigBuilder() .version(Version.Main.PRODUCTION) .net(new Net(ip, port, false)) .build(); }
@Override public void configure() throws Exception { conf = new MongodConfigBuilder() .version(Version.Main.PRODUCTION) .net(new Net(ip, port, false)) .build(); }
private IMongodConfig newMongodConfig(final IFeatureAwareVersion version) throws UnknownHostException, IOException { final Net net = new Net(findRandomOpenPortOnAllLocalInterfaces(), false); return new MongodConfigBuilder().version(version).net(net).build(); }
@Override public void evaluate() throws Throwable { MongodExecutable _mongodExe = runtime .prepare(new MongodConfigBuilder() .version(mongoVersion) .net(new Net(Integer.parseInt(mongoClientURI .getURI().split(":")[2]), false)) .build()); MongodProcess _mongod = _mongodExe.start(); MongoClient mongoClient = new MongoClient(mongoClientURI); base.evaluate(); mongoClient.close(); _mongod.stop(); _mongodExe.stop(); } };
private IMongodConfig newMongodConfig(final IFeatureAwareVersion version) throws UnknownHostException, IOException { final Net net = new Net(findRandomOpenPortOnAllLocalInterfaces(), false); return new MongodConfigBuilder().version(version).net(net).build(); }
private IMongodConfig buildMongodConfig() throws IOException { return new MongodConfigBuilder() .version(version) .net(new Net(bindIp, getPort(), Network.localhostIsIPv6())) .build(); }
private boolean startMongoExe(boolean startMongoLocal, int localPort) { if (startMongoLocal) { LOGGER.info("STARTING MONGO EXE"); try { IMongodConfig config = new MongodConfigBuilder().version(Version.Main.PRODUCTION) .net(new Net(localPort, Network.localhostIsIPv6())).build(); exe = MongodStarter.getDefaultInstance().prepare(config); exe.start(); return true; } catch (IOException e) { throw new RuntimeException(e); } } return false; }
@Override public void before() throws Exception { if(defaultPort < 0) { currentPort = Helper.findRandomOpenPortOnAllLocalInterfaces(); } else { currentPort = defaultPort; } IMongodConfig mongodConfig = new MongodConfigBuilder() .version(version) .net(new Net("localhost", currentPort, Network.localhostIsIPv6())) .build(); MongodStarter runtime = MongodStarter.getDefaultInstance(); mongodExe = runtime.prepare(mongodConfig); mongod = mongodExe.start(); }
public AbstractMongoConfigBuilder() throws IOException { timeout().setDefault(new Timeout()); net().setDefault(new Net()); cmdOptions().setDefault(new MongoCmdOptionsBuilder().build()); username().setDefault(""); password().setDefault(""); dbName().setDefault(""); stopTimeout().setDefault(TimeUnit.SECONDS.toMillis(5)); }
public void start() throws Exception { MongodStarter starter = MongodStarter.getDefaultInstance(); mongodExe = starter.prepare(new MongodConfigBuilder().version(Version.V3_2_1) .net(new Net(27017, Network.localhostIsIPv6())).build()); mongod = mongodExe.start(); client = new MongoClient("localhost"); }
@Override protected void before() throws IOException { MongodStarter runtime = MongodStarter.getDefaultInstance(); IMongodConfig config = new MongodConfigBuilder(). version(getMongoVersion()). net(new Net(getPort(), Network.localhostIsIPv6())). build(); mongodExe = runtime.prepare(config); try { mongod = mongodExe.start(); } catch (IOException e) { //Mongo failed to start for the previously stated reason. A single retry will be attempted. mongod = mongodExe.start(); } }
private IMongodConfig createConfiguration(String rsName, int p) throws IOException { return new MongodConfigBuilder() .version(Versions.withFeatures(() -> VERSION)) .net(new Net(InetAddress.getLoopbackAddress().getHostAddress(), p, false)) .replication(newStorage(p, rsName)) // enable journal .cmdOptions(new MongoCmdOptionsBuilder().useNoJournal(false).build()) .build(); }
/** * Start MongoDB instance. Don't forget to call {@link #stop()} * if you don't need it anymore! * @throws IOException if the instance could not be started */ public MongoDBTestConnector() throws IOException { mongodExe = starter.prepare(new MongodConfigBuilder() .version(Version.Main.PRODUCTION) .net(new Net(serverAddress.getPort(), Network.localhostIsIPv6())) .build()); mongod = mongodExe.start(); }
@BeforeClass public static void beforeClass() throws Exception { MongodStarter runtime = MongodStarter.getDefaultInstance(); mongodExe = runtime.prepare( new MongodConfigBuilder().version(Version.V3_3_1) .net(new Net(12345, Network.localhostIsIPv6())) .build()); MongodProcess process = mongodExe.start(); await().until(() -> process != null); }
@BeforeClass public static void beforeClass() throws Exception { MongodStarter runtime = MongodStarter.getDefaultInstance(); mongodExe = runtime.prepare( new MongodConfigBuilder().version(Version.V3_3_1) .net(new Net(12345, Network.localhostIsIPv6())) .build()); MongodProcess process = mongodExe.start(); await().until(() -> process != null); }
@BeforeClass public static void beforeClass() throws Exception { MongodStarter runtime = MongodStarter.getDefaultInstance(); mongodExe = runtime.prepare( new MongodConfigBuilder().version(Version.V3_3_1) .net(new Net(12345, Network.localhostIsIPv6())) .build()); MongodProcess process = mongodExe.start(); await().until(() -> process != null); }
@BeforeClass public static void beforeClass() throws Exception { MongodStarter runtime = MongodStarter.getDefaultInstance(); mongodExe = runtime.prepare( new MongodConfigBuilder().version(Version.V3_3_1) .net(new Net(12345, Network.localhostIsIPv6())) .build()); MongodProcess process = mongodExe.start(); await().until(() -> process != null); }