本文整理汇总了Java中org.kuali.rice.core.framework.config.property.SimpleConfig.putProperty方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleConfig.putProperty方法的具体用法?Java SimpleConfig.putProperty怎么用?Java SimpleConfig.putProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.core.framework.config.property.SimpleConfig
的用法示例。
在下文中一共展示了SimpleConfig.putProperty方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initGRL
import org.kuali.rice.core.framework.config.property.SimpleConfig; //导入方法依赖的package包/类
@Before
public void initGRL() throws Exception {
GlobalResourceLoader.stop();
SimpleConfig config = new SimpleConfig();
config.putProperty(CoreConstants.Config.APPLICATION_ID, "APPID");
ConfigContext.init(config);
StaticListableBeanFactory testBf = new StaticListableBeanFactory();
when(kualiModuleService.getInstalledModuleServices()).thenReturn(installedModuleServices);
testBf.addBean(KRADServiceLocator.PROVIDER_REGISTRY, mock(ProviderRegistry.class));
testBf.addBean(KRADServiceLocatorWeb.KUALI_MODULE_SERVICE, kualiModuleService);
ResourceLoader rl = new BeanFactoryResourceLoader(new QName("moduleservicebase-unittest"), testBf);
GlobalResourceLoader.addResourceLoader(rl);
GlobalResourceLoader.start();
}
示例2: initGrl
import org.kuali.rice.core.framework.config.property.SimpleConfig; //导入方法依赖的package包/类
@BeforeClass
public static void initGrl() throws Exception {
MetadataRepository metadataRepository = mock(MetadataRepository.class);
DataDictionaryService dataDictionaryService = mock(DataDictionaryService.class);
ResourceLoader resourceLoader = mock(ResourceLoader.class);
SimpleConfig config = new SimpleConfig();
config.putProperty(CoreConstants.Config.APPLICATION_ID, LegacyUtilsTest.class.getName());
config.putProperty(KRADConstants.Config.ENABLE_LEGACY_DATA_FRAMEWORK, "true");
ConfigContext.init(config);
when(resourceLoader.getName()).thenReturn(QName.valueOf(LegacyUtilsTest.class.getName()));
when(resourceLoader.getService(QName.valueOf("metadataRepository"))).thenReturn(metadataRepository);
when(resourceLoader.getService(QName.valueOf("dataDictionaryService"))).thenReturn(dataDictionaryService);
GlobalResourceLoader.addResourceLoader(resourceLoader);
GlobalResourceLoader.start();
}
示例3: installRiceKualiModuleService
import org.kuali.rice.core.framework.config.property.SimpleConfig; //导入方法依赖的package包/类
@Before
public void installRiceKualiModuleService() throws Exception {
GlobalResourceLoader.stop();
SimpleConfig config = new SimpleConfig();
config.putProperty(CoreConstants.Config.APPLICATION_ID, "APPID");
ConfigContext.init(config);
StaticListableBeanFactory testBf = new StaticListableBeanFactory();
KualiModuleService riceKualiModuleService = mock(KualiModuleService.class);
when(riceKualiModuleService.getInstalledModuleServices()).thenReturn(riceModuleServices);
testBf.addBean(KRADServiceLocatorWeb.KUALI_MODULE_SERVICE, riceKualiModuleService);
ResourceLoader rl = new BeanFactoryResourceLoader(new QName("moduleservicebase-unittest"), testBf);
GlobalResourceLoader.addResourceLoader(rl);
GlobalResourceLoader.start();
}
示例4: testCustomIncrementerDatasourceVersion
import org.kuali.rice.core.framework.config.property.SimpleConfig; //导入方法依赖的package包/类
@Test
public void testCustomIncrementerDatasourceVersion() throws Exception {
SimpleConfig config = new SimpleConfig();
config.putProperty("rice.krad.data.platform.incrementer.mysql.5",
"org.kuali.rice.krad.data.platform.testincrementers.CustomIncrementerMySQLVersion5");
config.putProperty("rice.krad.data.platform.incrementer.oracle.11",
"org.kuali.rice.krad.data.platform.testincrementers.CustomIncrementerOracleVersion11");
ConfigContext.init(config);
DataFieldMaxValueIncrementer mySQLMaxVal = MaxValueIncrementerFactory.getIncrementer(mysql,"test_mySQL");
assertTrue("Found MySQL custom incrementer",mySQLMaxVal != null);
assertTrue("Custom incrementer for MySQL should be mySQL5 for String val",
StringUtils.equals(mySQLMaxVal.nextStringValue(),"mySQL5"));
DataFieldMaxValueIncrementer oracleMaxVal = MaxValueIncrementerFactory.getIncrementer(oracle,"test_oracle");
assertTrue("Found Oracle custom incrementer", oracleMaxVal != null);
}
示例5: testCustomIncrementerDatasourceNoVersion
import org.kuali.rice.core.framework.config.property.SimpleConfig; //导入方法依赖的package包/类
@Test
public void testCustomIncrementerDatasourceNoVersion() throws Exception {
SimpleConfig config = new SimpleConfig();
config.putProperty("rice.krad.data.platform.incrementer.mysql",
"org.kuali.rice.krad.data.platform.testincrementers.CustomIncrementerMySQLVersion5");
config.putProperty("rice.krad.data.platform.incrementer.oracle",
"org.kuali.rice.krad.data.platform.testincrementers.CustomIncrementerOracleVersion11");
ConfigContext.init(config);
DataFieldMaxValueIncrementer mySQLMaxVal = MaxValueIncrementerFactory.getIncrementer(mysql,"test_mySQL");
assertTrue("Found MySQL custom incrementer",mySQLMaxVal != null);
assertTrue("Custom incrementer for MySQL should be mySQL5 for String val",
StringUtils.equals(mySQLMaxVal.nextStringValue(),"mySQL5"));
DataFieldMaxValueIncrementer oracleMaxVal = MaxValueIncrementerFactory.getIncrementer(oracle,"test_oracle");
assertTrue("Found Oracle custom incrementer", oracleMaxVal != null);
}
示例6: initGRL
import org.kuali.rice.core.framework.config.property.SimpleConfig; //导入方法依赖的package包/类
@Before
public void initGRL() throws Exception {
GlobalResourceLoader.stop();
SimpleConfig config = new SimpleConfig();
config.putProperty(CoreConstants.Config.APPLICATION_ID, "APPID");
ConfigContext.init(config);
StaticListableBeanFactory testBf = new StaticListableBeanFactory();
testBf.addBean(KRADServiceLocator.PROVIDER_REGISTRY, prMock);
ResourceLoader rl = new BeanFactoryResourceLoader(new QName("moduleconfiguration-unittest"), testBf);
GlobalResourceLoader.addResourceLoader(rl);
GlobalResourceLoader.start();
}
示例7: setup
import org.kuali.rice.core.framework.config.property.SimpleConfig; //导入方法依赖的package包/类
@Before
public void setup() throws Exception {
GlobalResourceLoader.stop();
SimpleConfig config = new SimpleConfig();
config.putProperty(CoreConstants.Config.APPLICATION_ID, getClass().getName());
ConfigContext.init(config);
ConfigContext.getCurrentContextConfig().removeProperty(KRADConstants.Config.ENABLE_LEGACY_DATA_FRAMEWORK);
ConfigContext.getCurrentContextConfig().removeProperty(KRADConstants.Config.KNS_ENABLED);
StaticListableBeanFactory testBf = new StaticListableBeanFactory();
testBf.addBean("metadataRepository", metadataRepository);
testBf.addBean("dataDictionaryService", dataDictionaryService);
testBf.addBean("knsLegacyDataAdapter", knsLegacyDataAdapter);
testBf.addBean("kradLegacyDataAdapter", kradLegacyDataAdapter);
ResourceLoader rl = new BeanFactoryResourceLoader(new QName(getClass().getName()), testBf);
GlobalResourceLoader.addResourceLoader(rl);
GlobalResourceLoader.start();
MetadataManager mm = MetadataManager.getInstance();
// register Legacy object
ClassDescriptor legacyDescriptor = new ClassDescriptor(mm.getGlobalRepository());
legacyDescriptor.setClassOfObject(Legacy.class);
mm.getGlobalRepository().put(Legacy.class, legacyDescriptor);
// register LegacyDocument object
ClassDescriptor legacyDocumentDescriptor = new ClassDescriptor(mm.getGlobalRepository());
legacyDocumentDescriptor.setClassOfObject(LegacyDocument.class);
mm.getGlobalRepository().put(LegacyDocument.class, legacyDocumentDescriptor);
}
示例8: testCustomIncrementerDatasourceInvalidClass
import org.kuali.rice.core.framework.config.property.SimpleConfig; //导入方法依赖的package包/类
@Test(expected = InstantiationError.class)
public void testCustomIncrementerDatasourceInvalidClass() throws Exception {
SimpleConfig config = new SimpleConfig();
config.putProperty("rice.krad.data.platform.incrementer.mysql",
"org.kuali.rice.krad.data.platform.testincrementers.NonExistent");
ConfigContext.init(config);
DataFieldMaxValueIncrementer mySQLMaxVal = MaxValueIncrementerFactory.getIncrementer(mysql,"test_mySQL");
assertTrue("Cannot create incrementer", mySQLMaxVal == null);
}
示例9: initializeConfig
import org.kuali.rice.core.framework.config.property.SimpleConfig; //导入方法依赖的package包/类
private void initializeConfig() {
SimpleConfig config = new SimpleConfig();
config.putProperty("rice.krad.jpa.global.randomProperty", "randomValue");
config.putProperty("rice.krad.jpa.global.eclipselink.weaving", "false");
config.putProperty("rice.krad.jpa.global.jpa.vendor.adapter.class", "org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter");
ConfigContext.init(config);
}
示例10: getMockServiceMap
import org.kuali.rice.core.framework.config.property.SimpleConfig; //导入方法依赖的package包/类
/**
* Getter for the mockServiceMap, which on first call constructs it and also initializes our hack of the GRL.
*
* @return the mockServiceMap
*/
private static synchronized Map<String, Object> getMockServiceMap() {
// the first time this is called, inject our special resource loader
if (mockServiceMap == null) {
mockServiceMap = new ConcurrentHashMap<String, Object>();
// this little dance is required to prevent issues when
SimpleConfig config = new SimpleConfig();
config.putProperty(CoreConstants.Config.APPLICATION_ID, "TEST");
ConfigContext.init(config);
try {
GlobalResourceLoader.stop();
} catch (Exception e) {
throw new RiceRuntimeException(e);
}
// Add to the front of the line our hacked resource loader which will fetch services from the mockServiceMap
GlobalResourceLoader.addResourceLoaderFirst(new BaseResourceLoader(new QName("TEST", "TEST")) {
@Override
public Object getService(QName serviceQName) {
String localPart = serviceQName.getLocalPart();
return mockServiceMap.get(localPart);
}
});
}
return mockServiceMap;
}
示例11: initializeConfig
import org.kuali.rice.core.framework.config.property.SimpleConfig; //导入方法依赖的package包/类
private void initializeConfig() {
SimpleConfig config = new SimpleConfig();
config.putProperty("rice.krad.jpa.global.randomProperty", "randomValue");
config.putProperty("rice.krad.jpa.global.eclipselink.weaving", "false");
ConfigContext.init(config);
}