Search in sources :

Example 1 with SystemConfiguration

use of org.mifos.config.business.SystemConfiguration in project head by mifos.

the class ConfigurationInitializer method createSystemConfiguration.

protected SystemConfiguration createSystemConfiguration() throws SystemException {
    MifosCurrency defaultCurrency = null;
    try {
        defaultCurrency = AccountingRules.getMifosCurrency(new ConfigurationPersistence());
    } catch (RuntimeException re) {
        throw new SystemException("cannot fetch default currency", re);
    }
    // TODO: pick timezone offset from database
    int timeZone = 19800000;
    return new SystemConfiguration(defaultCurrency, timeZone);
}
Also used : SystemException(org.mifos.framework.exceptions.SystemException) ConfigurationPersistence(org.mifos.config.persistence.ConfigurationPersistence) SystemConfiguration(org.mifos.config.business.SystemConfiguration) MifosCurrency(org.mifos.application.master.business.MifosCurrency)

Example 2 with SystemConfiguration

use of org.mifos.config.business.SystemConfiguration in project head by mifos.

the class ConfigurationIntializerIntegrationTest method testCreateSystemCache.

@Test
public void testCreateSystemCache() throws Exception {
    SystemConfiguration configuration = configInitializer.createSystemConfiguration();
    Assert.assertNotNull(configuration);
    Assert.assertNotNull(configuration.getCurrency());
    Assert.assertNotNull(configuration.getMifosTimeZone());
}
Also used : SystemConfiguration(org.mifos.config.business.SystemConfiguration) Test(org.junit.Test)

Aggregations

SystemConfiguration (org.mifos.config.business.SystemConfiguration)2 Test (org.junit.Test)1 MifosCurrency (org.mifos.application.master.business.MifosCurrency)1 ConfigurationPersistence (org.mifos.config.persistence.ConfigurationPersistence)1 SystemException (org.mifos.framework.exceptions.SystemException)1