Search in sources :

Example 1 with MongoGraphDatabase

use of org.locationtech.geogig.storage.mongo.MongoGraphDatabase in project GeoGig by boundlessgeo.

the class MongoGraphDatabaseTest method createDatabase.

@Override
protected MongoGraphDatabase createDatabase(Platform platform) throws Exception {
    final IniMongoProperties properties = new IniMongoProperties();
    final String uri = properties.get("mongodb.uri", String.class).or("mongodb://localhost:27017/");
    final String database = properties.get("mongodb.database", String.class).or("geogig");
    MongoClient client = new MongoClient(new MongoClientURI(uri));
    DB db = client.getDB(database);
    db.dropDatabase();
    MongoConnectionManager manager = new MongoConnectionManager();
    ConfigDatabase config = new TestConfigDatabase(platform);
    MongoGraphDatabase mongoGraphDatabase = new MongoGraphDatabase(manager, config);
    return mongoGraphDatabase;
}
Also used : MongoClient(com.mongodb.MongoClient) MongoGraphDatabase(org.locationtech.geogig.storage.mongo.MongoGraphDatabase) ConfigDatabase(org.locationtech.geogig.storage.ConfigDatabase) MongoClientURI(com.mongodb.MongoClientURI) MongoConnectionManager(org.locationtech.geogig.storage.mongo.MongoConnectionManager) DB(com.mongodb.DB)

Aggregations

DB (com.mongodb.DB)1 MongoClient (com.mongodb.MongoClient)1 MongoClientURI (com.mongodb.MongoClientURI)1 ConfigDatabase (org.locationtech.geogig.storage.ConfigDatabase)1 MongoConnectionManager (org.locationtech.geogig.storage.mongo.MongoConnectionManager)1 MongoGraphDatabase (org.locationtech.geogig.storage.mongo.MongoGraphDatabase)1