本文整理汇总了Java中org.kuali.rice.core.framework.config.property.SimpleConfig类的典型用法代码示例。如果您正苦于以下问题:Java SimpleConfig类的具体用法?Java SimpleConfig怎么用?Java SimpleConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SimpleConfig类属于org.kuali.rice.core.framework.config.property包,在下文中一共展示了SimpleConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 {
ConfigContext.init(new SimpleConfig());
ConfigContext.getCurrentContextConfig().putProperty(CoreConstants.Config.APPLICATION_ID, LegacyUtilsTest.class.getName());
// have to mock these because LegacyDetectionAdvice is calling LegacyUtils
MetadataRepository metadataRepository = mock(MetadataRepository.class);
DataDictionaryService dataDictionaryService = mock(DataDictionaryService.class);
ResourceLoader resourceLoader = mock(ResourceLoader.class);
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: 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();
}
示例4: 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();
}
示例5: 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);
}
示例6: 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);
}
示例7: setUp
import org.kuali.rice.core.framework.config.property.SimpleConfig; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
String formats = "MM/dd/yy;MM/dd/yyyy;MM-dd-yy;MM-dd-yyyy";
Properties props = new Properties();
props.put(CoreConstants.STRING_TO_DATE_FORMATS, formats);
Config config = new SimpleConfig(props);
ConfigContext.init(config);
ConfigContext.getCurrentContextConfig().putProperty(CoreConstants.STRING_TO_DATE_FORMATS, formats);
processor = new ValidCharactersConstraintProcessor();
dictionaryValidationResult = new DictionaryValidationResult();
dictionaryValidationResult.setErrorLevel(ErrorLevel.NOCONSTRAINT);
validDate = "07-28-2011";
validDate1 = "12-31-83";
invalidDateEmpty = "";
invalidDate = "31-12-2010";
invalidDate1 = "31-12-2010 12:30:45.456";
invalidDate2 = "2011-07-28 IST";
invalidDate3 = "12/31/2011";
List<String> allowedFormats = new ArrayList<String>();
allowedFormats.add("MM-dd-yy");
allowedFormats.add("MM-dd-yyyy");
datePatternConstraint = new DatePatternConstraint();
datePatternConstraint.setMessageKey("validate.dummykey");
datePatternConstraint.setValidationMessageParams( new ArrayList<String>());
datePatternConstraint.setAllowedFormats(allowedFormats);
dateDefinition = new AttributeDefinition();
dateDefinition.setName("date");
dateDefinition.setValidCharactersConstraint(datePatternConstraint);
}
示例8: 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();
}
示例9: 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);
}
示例10: setUp
import org.kuali.rice.core.framework.config.property.SimpleConfig; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
DescriptorRepository descriptorRepository = new DescriptorRepository();
when(metadataManager.getGlobalRepository()).thenReturn(descriptorRepository);
this.existingMetadataManager = hackOjb(metadataManager);
when(metadataRepository.contains(any(Class.class))).thenAnswer(new Answer() {
@Override
public Object answer(InvocationOnMock invocation) {
Class<?> type = (Class<?>)invocation.getArguments()[0];
return nonLegacyClasses.contains(type);
}
});
when(dataDictionaryService.getDataDictionary()).thenReturn(dataDictionary);
nonLegacyClasses.clear();
ConfigContext.init(new SimpleConfig());
ConfigContext.getCurrentContextConfig().removeProperty(KRADConstants.Config.KNS_ENABLED);
ConfigContext.getCurrentContextConfig().removeProperty(KRADConstants.Config.ENABLE_LEGACY_DATA_FRAMEWORK);
this.detector = new LegacyDetector(this.metadataRepository, this.dataDictionaryService);
addOjbClass(DummyDataObjectOjb.class);
}
示例11: 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);
}
示例12: 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);
}
示例13: 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;
}
示例14: testGetObject_SpringTransactionManager
import org.kuali.rice.core.framework.config.property.SimpleConfig; //导入依赖的package包/类
@Test
public void testGetObject_SpringTransactionManager() throws Exception {
Jta.configure(transactionManager, userTransaction);
SimpleConfig config = new SimpleConfig();
config.putObject(RiceConstants.SPRING_TRANSACTION_MANAGER, new JtaTransactionManager());
ConfigContext.init(config);
// since a spring configuration transaction manager has been configured, getObject will always return null, even
// though we have JTA setup (i'm suppose it's questionable that it should be doing this, but that's how it's
// always worked
assertNull(transactionManagerFactoryBean.getObject());
}
示例15: initializeJtaJndiConfig
import org.kuali.rice.core.framework.config.property.SimpleConfig; //导入依赖的package包/类
private void initializeJtaJndiConfig() throws Exception {
this.builder = SimpleNamingContextBuilder.emptyActivatedContextBuilder();
builder.bind(TRANSACTION_MANAGER_JNDI_NAME, transactionManager);
builder.bind(USER_TRANSACTION_JNDI_NAME, userTransaction);
this.config = new SimpleConfig();
this.config.putProperty(RiceConstants.TRANSACTION_MANAGER_JNDI, TRANSACTION_MANAGER_JNDI_NAME);
this.config.putProperty(RiceConstants.USER_TRANSACTION_JNDI, USER_TRANSACTION_JNDI_NAME);
ConfigContext.init(this.config);
}