本文整理汇总了Java中com.github.fakemongo.Fongo.getDatabase方法的典型用法代码示例。如果您正苦于以下问题:Java Fongo.getDatabase方法的具体用法?Java Fongo.getDatabase怎么用?Java Fongo.getDatabase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.fakemongo.Fongo
的用法示例。
在下文中一共展示了Fongo.getDatabase方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import com.github.fakemongo.Fongo; //导入方法依赖的package包/类
@Before
public void setup() {
Fongo fongo = new Fongo("mongoUnitTest");
final MongoDatabase db = fongo.getDatabase("mongoUnitTestDB");
m = new MongoLockHandler2() {
@Override protected MongoCollection<Document> getLockCollection(String lockName) {
return db.getCollection("ffoonnggoo" + lockName);
}
};
}
示例2: setup
import com.github.fakemongo.Fongo; //导入方法依赖的package包/类
@Before
public void setup() {
Fongo fongo = new Fongo("mongoUnitTest");
MongoDatabase db = fongo.getDatabase("mongoUnitTestDB");
collection = db.getCollection("mongoUnitTestCollection");
m = new MongoLockHandler() {
@Override
protected MongoCollection<Document> getLockCollection() {
return collection;
}
};
}
示例3: setUp
import com.github.fakemongo.Fongo; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
final Fongo fongo = new Fongo("inmemory-mongodb");
final MongoDatabase mongoDatabase = fongo.getDatabase("features");
final FeatureClassProvider featureClassProvider = new TestFeatureClassProvider();
final UserProvider userProvider = mock(UserProvider.class);
when(userProvider.getCurrentUser()).thenReturn(new SimpleFeatureUser("someUser"));
testee = new MongoTogglzRepository(mongoDatabase, featureClassProvider, userProvider, new MongoProperties());
}
示例4: setUp
import com.github.fakemongo.Fongo; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
final Fongo fongo = new Fongo("inmemory-mongodb");
final MongoDatabase mongoDatabase = fongo.getDatabase("db");
testee = new TestRepository(mongoDatabase);
}
示例5: testCheck
import com.github.fakemongo.Fongo; //导入方法依赖的package包/类
@Test
public void testCheck() throws Exception {
Fongo fongo = new Fongo("fake-mongo");
MongoHealthCheck check = new MongoHealthCheck(fongo.getDatabase("fake-mongo-db"));
assertTrue(check.check().isHealthy());
}
示例6: setup
import com.github.fakemongo.Fongo; //导入方法依赖的package包/类
@Before
public void setup() {
Fongo fongo = new Fongo("mongoUnitTest");
MongoDatabase db = fongo.getDatabase("mongoUnitTestDB");
collection = db.getCollection("mongoUnitTestCollection");
}
示例7: setup
import com.github.fakemongo.Fongo; //导入方法依赖的package包/类
@Before
public void setup() {
final Fongo fongo = new Fongo("inmemory-mongodb");
final MongoDatabase mongoDatabase = fongo.getDatabase("jobsinfo");
repo = new MongoJobRepository(mongoDatabase, "jobsinfo", new MongoProperties());
}