当前位置: 首页>>代码示例>>Java>>正文


Java Fongo.getDatabase方法代码示例

本文整理汇总了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);
        }
    };
}
 
开发者ID:RapturePlatform,项目名称:Rapture,代码行数:11,代码来源:MongoLockHandler2Test.java

示例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;
        }
    };
}
 
开发者ID:RapturePlatform,项目名称:Rapture,代码行数:13,代码来源:MongoLockHandlerTest.java

示例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());
}
 
开发者ID:otto-de,项目名称:edison-microservice,代码行数:10,代码来源:MongoTogglzRepositoryTest.java

示例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);
}
 
开发者ID:otto-de,项目名称:edison-microservice,代码行数:8,代码来源:AbstractMongoRepositoryTest.java

示例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());
}
 
开发者ID:stardogventures,项目名称:starwizard,代码行数:7,代码来源:MongoHealthCheckTest.java

示例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");
}
 
开发者ID:RapturePlatform,项目名称:Rapture,代码行数:7,代码来源:EpochManagerTest.java

示例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());
}
 
开发者ID:otto-de,项目名称:edison-microservice,代码行数:7,代码来源:MongoJobRepositoryTest.java


注:本文中的com.github.fakemongo.Fongo.getDatabase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。