Skip to content

Instantly share code, notes, and snippets.

@mox601
Created September 18, 2013 15:04
Show Gist options
  • Save mox601/6610488 to your computer and use it in GitHub Desktop.
Save mox601/6610488 to your computer and use it in GitHub Desktop.
@BeforeClass
protected void setUpMongoInstance() throws Exception {
// final IRuntimeConfig runtimeConfig = new RuntimeConfigBuilder()
// .defaultsWithLogger(Command.MongoD, LOGGER)
// .build();
final MongodStarter runtime = MongodStarter.getDefaultInstance();
mongodExecutable = runtime.prepare(new MongodConfig(Version.Main.DEVELOPMENT, PORT,
Network.localhostIsIPv6()));
mongodProcess = mongodExecutable.start();
mongoClient = new MongoClient("localhost", PORT);
}
@AfterClass
protected void tearDownMongoInstance() throws Exception {
mongodProcess.stop();
mongodExecutable.stop();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment