Java Code Examples for com.mongodb.DB.dropDatabase()

The following are Jave code examples for showing how to use dropDatabase() of the com.mongodb.DB class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: xxl-incubator   File: MongoDBUtil.java   View Source Code Vote up 5 votes
/**
 * 删除一个数据库实例
 */
public void dropDB(String dbName) {
	DB db = getDB(dbName);
	if (db != null) {
		db.dropDatabase();
	}
}
 
Example 2
Project: effektif   File: MongoMemoryApiTest.java   View Source Code Vote up 5 votes
@Test
public void testApiWithMongoConfiguration() {
  Configuration configuration = createMongoMemoryWorkflowEngineConfiguration();
  
  DB db = configuration.get(DB.class);
  db.dropDatabase();

  TestSuiteHelper.run(configuration
    // use the next line if you only want to run 1 test
    //  , CaseTest.class, "testCaseCrud"
    );
}
 
Example 3
Project: effektif   File: MongoApiTest.java   View Source Code Vote up 5 votes
@Test
public void testApiWithMongoConfiguration() {
  Configuration configuration = createMongoTestConfiguration();
  
  DB db = configuration.get(DB.class);
  db.dropDatabase();

  initializeIds();
  // this test runs the full API test suite with a mongo test configuration.
  
  TestSuiteHelper.run(configuration
    // use the next line if you only want to run 1 test
    // , SequentialExecutionTest.class, "testSequentialExecution"
    );
}