use of org.mifos.config.persistence.ConfigurationPersistence in project head by mifos.
the class CloseLoanActionStrutsTest method tearDown.
@After
public void tearDown() throws Exception {
new ConfigurationPersistence().updateConfigurationKeyValueInteger(LoanConstants.REPAYMENT_SCHEDULES_INDEPENDENT_OF_MEETING_IS_ENABLED, lsim);
new DateTimeService().resetToCurrentSystemDateTime();
loanBO = null;
group = null;
center = null;
}
use of org.mifos.config.persistence.ConfigurationPersistence in project head by mifos.
the class CloseLoanActionStrutsTest method setUp.
@Before
public void setUp() throws Exception {
currentDate = new DateTime(2010, 12, 23, 12, 0, 0, 0);
new DateTimeService().setCurrentDateTime(currentDate);
ConfigurationPersistence configurationPersistence = new ConfigurationPersistence();
lsim = configurationPersistence.getConfigurationValueInteger(LoanConstants.REPAYMENT_SCHEDULES_INDEPENDENT_OF_MEETING_IS_ENABLED);
configurationPersistence.updateConfigurationKeyValueInteger(LoanConstants.REPAYMENT_SCHEDULES_INDEPENDENT_OF_MEETING_IS_ENABLED, 1);
userContext = TestObjectFactory.getContext();
request.getSession().setAttribute(Constants.USERCONTEXT, userContext);
addRequestParameter("recordLoanOfficerId", "1");
addRequestParameter("recordOfficeId", "1");
request.getSession(false).setAttribute("ActivityContext", TestObjectFactory.getActivityContext());
flowKey = createFlow(request, LoanDisbursementAction.class);
setRequestPathInfo("/editStatusAction");
}
use of org.mifos.config.persistence.ConfigurationPersistence in project head by mifos.
the class RepayLoanActionStrutsTest method setUp.
@Before
public void setUp() throws Exception {
DateTime date = new DateTime(2010, 12, 23, 12, 0, 0, 0);
new DateTimeService().setCurrentDateTime(date);
ConfigurationPersistence configurationPersistence = new ConfigurationPersistence();
lsim = configurationPersistence.getConfigurationValueInteger(LoanConstants.REPAYMENT_SCHEDULES_INDEPENDENT_OF_MEETING_IS_ENABLED);
configurationPersistence.updateConfigurationKeyValueInteger(LoanConstants.REPAYMENT_SCHEDULES_INDEPENDENT_OF_MEETING_IS_ENABLED, 1);
userContext = TestObjectFactory.getContext();
request.getSession().setAttribute(Constants.USERCONTEXT, userContext);
addRequestParameter("recordLoanOfficerId", "1");
addRequestParameter("recordOfficeId", "1");
request.getSession(false).setAttribute("ActivityContext", TestObjectFactory.getActivityContext());
flowKey = createFlow(request, RepayLoanAction.class);
accountBO = getLoanAccount();
((LoanBO) accountBO).approve(legacyPersonnelDao.getPersonnel(PersonnelConstants.TEST_USER), "approved", date.toLocalDate());
StaticHibernateUtil.flushSession();
accountBO = (AccountBO) StaticHibernateUtil.getSessionTL().get(AccountBO.class, accountBO.getAccountId());
}
use of org.mifos.config.persistence.ConfigurationPersistence in project head by mifos.
the class ClientRulesIntegrationTest method testGetGroupCanApplyLoans.
@Test
public void testGetGroupCanApplyLoans() throws Exception {
MifosConfigurationManager configMgr = MifosConfigurationManager.getInstance();
ConfigurationPersistence configPersistence = new ConfigurationPersistence();
ConfigurationKeyValue savedDBValue = null;
savedDBValue = configPersistence.getConfigurationKeyValue(ClientRules.GroupCanApplyLoansKey);
Boolean savedValue = ClientRules.getGroupCanApplyLoans();
configMgr.setProperty(ClientRules.ClientRulesGroupCanApplyLoans, false);
configPersistence.updateConfigurationKeyValueInteger(ClientRules.GroupCanApplyLoansKey, Constants.NO);
ClientRules.refresh();
// set db value to false, too
Assert.assertFalse(ClientRules.getGroupCanApplyLoans());
// now the return value from accounting rules class has to be what is in
// the database (0)
ClientRules.refresh();
Assert.assertFalse(ClientRules.getGroupCanApplyLoans());
// set the saved value back for following tests
configPersistence.updateConfigurationKeyValueInteger(ClientRules.GroupCanApplyLoansKey, Integer.parseInt(savedDBValue.getValue()));
configMgr.setProperty(ClientRules.ClientRulesGroupCanApplyLoans, savedValue);
ClientRules.refresh();
}
use of org.mifos.config.persistence.ConfigurationPersistence in project head by mifos.
the class ClientRulesIntegrationTest method testClientCanExistOutsideGroup.
@Test
public void testClientCanExistOutsideGroup() throws Exception {
MifosConfigurationManager configMgr = MifosConfigurationManager.getInstance();
ConfigurationPersistence configPersistence = new ConfigurationPersistence();
ConfigurationKeyValue savedDBValue = null;
savedDBValue = configPersistence.getConfigurationKeyValue(ClientRules.ClientCanExistOutsideGroupKey);
Boolean savedValue = ClientRules.getClientCanExistOutsideGroup();
configMgr.setProperty(ClientRules.ClientRulesClientCanExistOutsideGroup, false);
configPersistence.updateConfigurationKeyValueInteger(ClientRules.ClientCanExistOutsideGroupKey, Constants.NO);
ClientRules.refresh();
// set db value to false, too
Assert.assertFalse(ClientRules.getClientCanExistOutsideGroup());
// now the return value from accounting rules class has to be what is in
// the database (0)
ClientRules.refresh();
Assert.assertFalse(ClientRules.getClientCanExistOutsideGroup());
// set the saved value back for following tests
configPersistence.updateConfigurationKeyValueInteger(ClientRules.ClientCanExistOutsideGroupKey, Integer.parseInt(savedDBValue.getValue()));
configMgr.setProperty(ClientRules.ClientRulesClientCanExistOutsideGroup, savedValue);
ClientRules.refresh();
}
Aggregations