use of org.mifos.framework.util.ConfigurationLocator in project head by mifos.
the class ApplicationInitializer method copyLogo.
private void copyLogo(ServletContext servletContext) throws IOException {
ConfigurationLocator configurationLocator = new ConfigurationLocator();
Resource logoResource = configurationLocator.getUploadedMifosLogo();
if (!logoResource.exists()) {
InputStream defaultLogoStream = servletContext.getResourceAsStream("/pages/framework/images/logo.jpg");
File logoDir = new File(configurationLocator.getConfigurationDirectory() + File.separator + configurationLocator.getLogoDirectory());
logoDir.mkdir();
File logo = new File(logoDir, configurationLocator.getLogoName());
FileUtils.copyInputStreamToFile(defaultLogoStream, logo);
logger.info("Copy default logo to: " + logo.getAbsolutePath());
}
}
use of org.mifos.framework.util.ConfigurationLocator in project head by mifos.
the class MifosIntegrationTestCase method init.
@BeforeClass
public static void init() throws Exception {
Log4jConfigurer.initLogging(new ConfigurationLocator().getFilePath(FilePaths.LOG_CONFIGURATION_FILE));
verifyDatabaseState = false;
if (!isTestingModeSet) {
new StandardTestingService().setTestMode(TestMode.INTEGRATION);
isTestingModeSet = true;
}
}
use of org.mifos.framework.util.ConfigurationLocator in project head by mifos.
the class TaskRunningIntegrationTest method getMifosSchedulerOldConfigurationFile.
private MifosScheduler getMifosSchedulerOldConfigurationFile(String taskResource, String quartzResource) throws IOException, TaskSystemException {
ConfigurationLocator mockConfigurationLocator = createMock(ConfigurationLocator.class);
expect(mockConfigurationLocator.getResource(SchedulerConstants.CONFIGURATION_FILE_NAME)).andReturn(MifosResourceUtil.getClassPathResourceAsResource(taskResource));
expect(mockConfigurationLocator.getResource(SchedulerConstants.SCHEDULER_CONFIGURATION_FILE_NAME)).andReturn(MifosResourceUtil.getClassPathResourceAsResource(quartzResource));
replay(mockConfigurationLocator);
MifosScheduler mifosScheduler = new MifosScheduler();
mifosScheduler.setConfigurationLocator(mockConfigurationLocator);
mifosScheduler.initialize();
return mifosScheduler;
}
use of org.mifos.framework.util.ConfigurationLocator in project head by mifos.
the class TaskRunningIntegrationTest method getMifosScheduler.
private MifosScheduler getMifosScheduler(String taskConfiguration) throws TaskSystemException, IOException, FileNotFoundException {
ConfigurationLocator mockConfigurationLocator = createMock(ConfigurationLocator.class);
expect(mockConfigurationLocator.getResource(SchedulerConstants.CONFIGURATION_FILE_NAME)).andReturn(MifosResourceUtil.getClassPathResourceAsResource(taskConfiguration));
expectLastCall().times(2);
replay(mockConfigurationLocator);
MifosScheduler mifosScheduler = new MifosScheduler();
mifosScheduler.setConfigurationLocator(mockConfigurationLocator);
mifosScheduler.initialize();
return mifosScheduler;
}
use of org.mifos.framework.util.ConfigurationLocator in project head by mifos.
the class BatchJobCatchUpIntegrationTest method getMifosScheduler.
private MifosScheduler getMifosScheduler(String taskConfigurationPath) throws TaskSystemException, IOException, FileNotFoundException {
ConfigurationLocator mockConfigurationLocator = createMock(ConfigurationLocator.class);
expect(mockConfigurationLocator.getResource(SchedulerConstants.CONFIGURATION_FILE_NAME)).andReturn(MifosResourceUtil.getClassPathResourceAsResource(taskConfigurationPath));
expectLastCall().times(2);
replay(mockConfigurationLocator);
MifosScheduler mifosScheduler = new MifosScheduler();
mifosScheduler.setConfigurationLocator(mockConfigurationLocator);
mifosScheduler.initialize();
return mifosScheduler;
}
Aggregations