use of org.ff4j.store.FeatureStoreMongoDB in project ff4j by ff4j.
the class FeatureStoreMongoDBCore1Test method emptyListAttributes.
/**
* LazyBSONObjectList vs BasicBSONObjectList
*/
@Test
@Ignore
public void emptyListAttributes() throws UnknownHostException {
DBCollection features = getMongoClient().getDB("FF4J").getCollection("feature");
// When
FeatureStore mongoStore = new FeatureStoreMongoDB(features, "ff4j.xml");
// Then (no error)
Assert.assertTrue(mongoStore.readAll().keySet().size() > 0);
}
use of org.ff4j.store.FeatureStoreMongoDB in project ff4j by ff4j.
the class FeatureStoreMongoDBCore1Test method testCreateSchema.
/**
* Integration Test
* @throws UnknownHostException
*/
@Test
@Ignore
public void testCreateSchema() throws UnknownHostException {
// Given
MongoClient client = new MongoClient(new ServerAddress("localhost", 27017));
// Given
Assert.assertFalse(client.getDatabaseNames().contains(FeatureStoreMongoConstants.DEFAULT_DBNAME));
// When
new FeatureStoreMongoDB(client).createSchema();
new PropertyStoreMongoDB(client).createSchema();
// Then
Assert.assertTrue(client.getDatabaseNames().contains(FeatureStoreMongoConstants.DEFAULT_DBNAME));
Assert.assertTrue(client.getDB(FeatureStoreMongoConstants.DEFAULT_DBNAME).collectionExists(FeatureStoreMongoConstants.DEFAULT_COLLECTIONAME_FEATURES));
Assert.assertTrue(client.getDB(FeatureStoreMongoConstants.DEFAULT_DBNAME).collectionExists(FeatureStoreMongoConstants.DEFAULT_COLLECTIONAME_PROPERTIES));
}
Aggregations