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


Java SimpleConfig.putProperty方法代码示例

本文整理汇总了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();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:ModuleServiceBaseTest.java

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

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

示例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);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:MaxValueIncrementerFactoryTest.java

示例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);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:MaxValueIncrementerFactoryTest.java

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

示例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);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:33,代码来源:LegacyDataAdapterImplTest.java

示例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);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:11,代码来源:MaxValueIncrementerFactoryTest.java

示例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);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:8,代码来源:KradEclipseLinkEntityManagerFactoryBeanTest.java

示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:36,代码来源:GlobalResourceLoaderTestUtils.java

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


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