本文整理汇总了Java中org.mongeez.Mongeez类的典型用法代码示例。如果您正苦于以下问题:Java Mongeez类的具体用法?Java Mongeez怎么用?Java Mongeez使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Mongeez类属于org.mongeez包,在下文中一共展示了Mongeez类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: loadInitialData
import org.mongeez.Mongeez; //导入依赖的package包/类
/**
* Init.
*
* @return the mongeez
*/
@Bean(initMethod = "process")
public Mongeez loadInitialData(final Mongo mongo) {
logger.info("Initializing default data");
final Mongeez mongeez = new Mongeez();
mongeez.setMongo(mongo);
mongeez.setDbName(databaseName);
mongeez.setFile(new ClassPathResource(initialLoadingFile));
return mongeez;
}
开发者ID:thefinerthingsclub,项目名称:finerleague,代码行数:15,代码来源:InitialDataLoadingConfig.java
示例2: loadInitialData
import org.mongeez.Mongeez; //导入依赖的package包/类
/**
* Load initial data mongeez.
*
* @param mongo the mongo
* @return the mongeez
*/
@Bean(initMethod = "process")
public Mongeez loadInitialData(final Mongo mongo) {
final Mongeez mongeez = new Mongeez();
mongeez.setMongo(mongo);
mongeez.setDbName(FinerLeagueTestConstants.DB_NAME);
mongeez.setFile(new ClassPathResource("db/mongeez_test.xml"));
mongeez.process();
return mongeez;
}
开发者ID:thefinerthingsclub,项目名称:finerleague,代码行数:16,代码来源:MongoTestConfig.java
示例3: shouldDoNothingIfDisabled
import org.mongeez.Mongeez; //导入依赖的package包/类
@Test
public void shouldDoNothingIfDisabled() {
EnvironmentTestUtils.addEnvironment(this.context, "mongeez.enabled:false");
registerAndRefresh(MongoAutoConfiguration.class, MongeezAutoConfiguration.class);
assumeThat(this.context.getBeanNamesForType(Mongo.class), not(emptyArray()));
assertThat(this.context.getBeanNamesForType(Mongeez.class), emptyArray());
}
开发者ID:hzpz,项目名称:mongeez-spring-boot-starter,代码行数:8,代码来源:MongeezAutoConfigurationTests.java
示例4: shouldUseDatabaseFromMongoProperties
import org.mongeez.Mongeez; //导入依赖的package包/类
@Test
public void shouldUseDatabaseFromMongoProperties() {
String database = "foo";
EnvironmentTestUtils.addEnvironment(this.context, "spring.data.mongodb.database:" + database);
registerAndRefresh(DoNotExecuteMongeezPostProcessor.class,
MongoAutoConfiguration.class, MongeezAutoConfiguration.class);
Mongeez mongeez = this.context.getBean(Mongeez.class);
Object mongeezDatabase = ReflectionTestUtils.getField(mongeez, "dbName");
assertThat(mongeezDatabase.toString(), equalTo(database));
}
开发者ID:hzpz,项目名称:mongeez-spring-boot-starter,代码行数:11,代码来源:MongeezAutoConfigurationTests.java
示例5: shouldUseDatabaseOverrideFromMongeezProperties
import org.mongeez.Mongeez; //导入依赖的package包/类
@Test
public void shouldUseDatabaseOverrideFromMongeezProperties() {
String mongoDatabase = "foo";
String mongeezOverrideDatabase = "bar";
EnvironmentTestUtils.addEnvironment(this.context, "spring.data.mongodb.database:" + mongoDatabase);
EnvironmentTestUtils.addEnvironment(this.context, "mongeez.database:" + mongeezOverrideDatabase);
registerAndRefresh(DoNotExecuteMongeezPostProcessor.class,
MongoAutoConfiguration.class, MongeezAutoConfiguration.class);
Mongeez mongeez = this.context.getBean(Mongeez.class);
Object mongeezActualDatabase = ReflectionTestUtils.getField(mongeez, "dbName");
assertThat(mongeezActualDatabase.toString(), equalTo(mongeezOverrideDatabase));
}
开发者ID:hzpz,项目名称:mongeez-spring-boot-starter,代码行数:13,代码来源:MongeezAutoConfigurationTests.java
示例6: shouldUseAuthenticationDatabaseFromMongoProperties
import org.mongeez.Mongeez; //导入依赖的package包/类
@Test
public void shouldUseAuthenticationDatabaseFromMongoProperties() {
String database = "foo";
EnvironmentTestUtils.addEnvironment(this.context, "spring.data.mongodb.authenticationDatabase:" + database);
EnvironmentTestUtils.addEnvironment(this.context, "mongeez.username:user");
EnvironmentTestUtils.addEnvironment(this.context, "mongeez.password:pass");
registerAndRefresh(DoNotExecuteMongeezPostProcessor.class,
MongoAutoConfiguration.class, MongeezAutoConfiguration.class);
Mongeez mongeez = this.context.getBean(Mongeez.class);
String authDb = ((MongoAuth) ReflectionTestUtils.getField(mongeez, "auth")).getAuthDb();
assertThat(authDb, equalTo(database));
}
开发者ID:hzpz,项目名称:mongeez-spring-boot-starter,代码行数:13,代码来源:MongeezAutoConfigurationTests.java
示例7: shouldUseAuthenticationDatabaseOverrideFromMongeezProperties
import org.mongeez.Mongeez; //导入依赖的package包/类
@Test
public void shouldUseAuthenticationDatabaseOverrideFromMongeezProperties() {
String database = "foo";
String mongeezOverrideDatabase = "bar";
EnvironmentTestUtils.addEnvironment(this.context, "spring.data.mongodb.authenticationDatabase:" + database);
EnvironmentTestUtils.addEnvironment(this.context, "mongeez.authenticationDatabase:" + mongeezOverrideDatabase);
EnvironmentTestUtils.addEnvironment(this.context, "mongeez.username:user");
EnvironmentTestUtils.addEnvironment(this.context, "mongeez.password:pass");
registerAndRefresh(DoNotExecuteMongeezPostProcessor.class,
MongoAutoConfiguration.class, MongeezAutoConfiguration.class);
Mongeez mongeez = this.context.getBean(Mongeez.class);
String authDb = ((MongoAuth) ReflectionTestUtils.getField(mongeez, "auth")).getAuthDb();
assertThat(authDb, equalTo(mongeezOverrideDatabase));
}
开发者ID:hzpz,项目名称:mongeez-spring-boot-starter,代码行数:15,代码来源:MongeezAutoConfigurationTests.java
示例8: postProcessBeanFactory
import org.mongeez.Mongeez; //导入依赖的package包/类
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
String[] mongeezBeanNames = beanFactory.getBeanNamesForType(Mongeez.class);
Assert.state(mongeezBeanNames.length == 1);
BeanDefinition beanDefinition = beanFactory.getBeanDefinition(mongeezBeanNames[0]);
Assert.state(beanDefinition instanceof RootBeanDefinition);
((RootBeanDefinition) beanDefinition).setInitMethodName(null);
}
开发者ID:hzpz,项目名称:mongeez-spring-boot-starter,代码行数:9,代码来源:DoNotExecuteMongeezPostProcessor.java
示例9: init
import org.mongeez.Mongeez; //导入依赖的package包/类
@PostConstruct
private void init() throws Exception {
//~ Execute database changeset(s)
log.info("Attempt to execute mongodb changesets..");
Mongeez mongeez = new Mongeez();
mongeez.setFile(new ClassPathResource("/mongodb-changesets/mongeez.xml"));
mongeez.setMongo(mongo());
mongeez.setDbName(this.dbName);
// mongeez.process();
}
开发者ID:datenstrudel,项目名称:bulbs-core,代码行数:11,代码来源:PersistenceConfig.java
示例10: shouldDoNothingIfNoMongoBean
import org.mongeez.Mongeez; //导入依赖的package包/类
@Test
public void shouldDoNothingIfNoMongoBean() {
registerAndRefresh(MongeezAutoConfiguration.class);
assertThat(this.context.getBeanNamesForType(Mongeez.class), emptyArray());
}
开发者ID:hzpz,项目名称:mongeez-spring-boot-starter,代码行数:6,代码来源:MongeezAutoConfigurationTests.java
注:本文中的org.mongeez.Mongeez类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论