use of org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters in project head by mifos.
the class AdditionalSavingsAccountTest method savingsAdjustmentsForDepositsWithdrawals.
//http://mifosforge.jira.com/browse/MIFOSTEST-144
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void savingsAdjustmentsForDepositsWithdrawals() throws Exception {
//Given
DateTimeUpdaterRemoteTestingService dateTimeUpdaterRemoteTestingService = new DateTimeUpdaterRemoteTestingService(selenium);
DateTime targetTime = new DateTime(2011, 1, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "acceptance_small_008_dbunit.xml", dataSource, selenium);
//When
SavingsProductParameters params = getVoluntaryGroupsMonthCalculactionProductParameters(targetTime);
params.setApplicableFor(SavingsProductParameters.CLIENTS);
params.setInterestRate("10");
String savingsId = createSavingsAccount(params);
DepositWithdrawalSavingsParameters depositParams = new DepositWithdrawalSavingsParameters();
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "500");
targetTime = new DateTime(2011, 2, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.WITHDRAWAL, "200");
targetTime = new DateTime(2011, 3, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
navigationHelper.navigateToAdminPage();
runBatchJobsForSavingsIntPosting();
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "4.1");
targetTime = new DateTime(2011, 4, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
navigationHelper.navigateToAdminPage();
runBatchJobsForSavingsIntPosting();
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "2.6");
SavingsAccountDetailPage savingsAccountDetailPage = new SavingsAccountDetailPage(selenium);
SavingsApplyAdjustmentPage savingsApplyAdjustmentPage = new SavingsApplyAdjustmentPage(selenium);
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "123");
savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
savingsApplyAdjustmentPage = savingsAccountDetailPage.navigateToApplyAdjustmentPage();
savingsApplyAdjustmentPage.applyAdjustment("234", "adjustment");
targetTime = new DateTime(2011, 5, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
navigationHelper.navigateToAdminPage();
runBatchJobsForSavingsIntPosting();
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "4.4");
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.WITHDRAWAL, "45");
savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
savingsApplyAdjustmentPage = savingsAccountDetailPage.navigateToApplyAdjustmentPage();
savingsApplyAdjustmentPage.applyAdjustment("55", "adjustment");
targetTime = new DateTime(2011, 6, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
navigationHelper.navigateToAdminPage();
runBatchJobsForSavingsIntPosting();
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "4.2");
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "555");
savingsAccountDetailPage = navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
savingsApplyAdjustmentPage = savingsAccountDetailPage.navigateToApplyAdjustmentPage();
savingsApplyAdjustmentPage.applyAdjustment("444", "adjustment");
targetTime = new DateTime(2011, 7, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
navigationHelper.navigateToAdminPage();
runBatchJobsForSavingsIntPosting();
navigationHelper.navigateToSavingsAccountDetailPage(savingsId);
Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "7.6");
//step 12-15
params = getVoluntaryGroupsMonthCalculactionProductParameters(targetTime);
params.setApplicableFor(SavingsProductParameters.CLIENTS);
String savingsId2 = createSavingsAccount(params);
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId2, DepositWithdrawalSavingsParameters.DEPOSIT, "555");
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId2, DepositWithdrawalSavingsParameters.WITHDRAWAL, "222");
// month with last day is a non-working day
targetTime = new DateTime(2011, 8, 1, 13, 0, 0, 0);
dateTimeUpdaterRemoteTestingService.setDateTime(targetTime);
navigationHelper.navigateToAdminPage();
runBatchJobsForSavingsIntPosting();
navigationHelper.navigateToSavingsAccountDetailPage(savingsId2);
Assert.assertEquals(selenium.getTable("recentActivityForDetailPage.1.2"), "1.4");
}
use of org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters in project head by mifos.
the class SavingsImportTest method importSavingAccountsToClientTest.
@Test(enabled = true)
public void importSavingAccountsToClientTest() {
ManageRolePage manageRolePage = navigationHelper.navigateToAdminPage().navigateToViewRolesPage().navigateToManageRolePage("Admin");
try {
manageRolePage.enablePermission("8_8");
} catch (AssertionError ex) {
Logger.getAnonymousLogger().info("Permission is marked.");
}
manageRolePage.submitAndGotoViewRolesPage();
String succesNumber = "1";
String errorNumber = "5";
arrayOfErrors = buildArrayOfErrorsForImportSavingsTest();
String importFile = this.getClass().getResource("/ImportSavingsAccountsTest.xls").toString();
SavingsProductParameters parameters = savingsProductHelper.getGenericSavingsProductParameters(targetTime, SavingsProductParameters.VOLUNTARY, SavingsProductParameters.CLIENTS);
parameters.setProductInstanceName("importSavings");
parameters.setShortName("IMP");
try {
savingsProductHelper.createSavingsProduct(parameters);
} catch (AssertionError e) {
Logger.getAnonymousLogger().info("Product exists");
}
ImportSavingsReviewPage reviewPage = adminTestHelper.loadImportSavingsFileAndSubmitForReview(importFile);
reviewPage.validateErrors(arrayOfErrors);
reviewPage.validateSuccesText(succesNumber);
ImportSavingsSaveSummaryPage summaryPage = reviewPage.saveSuccessfullRows();
summaryPage.verifySuccesString(succesNumber);
summaryPage.verifyErrorString(errorNumber);
}
use of org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters in project head by mifos.
the class SavingsProductHelper method getVoluntaryClients3MonthCalculactionPostingProductParameters.
public SavingsProductParameters getVoluntaryClients3MonthCalculactionPostingProductParameters(DateTime startDate) {
SavingsProductParameters params = getGenericSavingsProductParameters(startDate, SavingsProductParameters.VOLUNTARY, SavingsProductParameters.CLIENTS);
params.setDaysOrMonthsForInterestCalculation(params.MONTHS);
params.setInterestRate("5");
params.setFrequencyOfInterestPostings("3");
params.setNumberOfDaysOrMonthsForInterestCalculation("3");
params.setBalanceUsedForInterestCalculation(SavingsProductParameters.MINIMUM_BALANCE);
params.setMandatoryAmount("100000");
params.setStartDateDD("15");
params.setStartDateMM("2");
params.setStartDateYYYY("2011");
return params;
}
use of org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters in project head by mifos.
the class SavingsProductHelper method getGenericSavingsProductParameters.
/**
* This method return a fully useable parameter object for the type of deposit (mandatory/voluntary)
* and applicable for (clients/groups/centers).
* @return Parameters like noted above.
* @param typeOfDeposits
* @param applicableFor
*/
public SavingsProductParameters getGenericSavingsProductParameters(DateTime startDate, int typeOfDeposits, int applicableFor) {
SavingsProductParameters params = new SavingsProductParameters();
params.setProductInstanceName("Savings product test" + StringUtil.getRandomString(3));
params.setShortName(StringUtil.getRandomString(4));
params.setProductCategory(SavingsProductParameters.OTHER);
params.setStartDateDD(Integer.valueOf(startDate.getDayOfMonth()).toString());
params.setStartDateMM(Integer.valueOf(startDate.getMonthOfYear()).toString());
params.setStartDateYYYY(Integer.valueOf(startDate.getYearOfEra()).toString());
params.setApplicableFor(applicableFor);
params.setTypeOfDeposits(typeOfDeposits);
// these two settings are not required in all configurations
// but they're good to have anyway
params.setMandatoryAmount("10");
params.setAmountAppliesTo(SavingsProductParameters.WHOLE_GROUP);
params.setInterestRate("4");
params.setBalanceUsedForInterestCalculation(SavingsProductParameters.AVERAGE_BALANCE);
params.setDaysOrMonthsForInterestCalculation(SavingsProductParameters.MONTHS);
params.setNumberOfDaysOrMonthsForInterestCalculation("3");
params.setFrequencyOfInterestPostings("6");
params.setGlCodeForDeposit("24101 - Mandatory Savings Accounts");
params.setGlCodeForInterest("41102 - Interest on clients mandatory savings");
return params;
}
use of org.mifos.test.acceptance.framework.savingsproduct.SavingsProductParameters in project head by mifos.
the class SavingsProductHelper method getMandatoryClientsMinimumBalanceSavingsProductParameters.
public SavingsProductParameters getMandatoryClientsMinimumBalanceSavingsProductParameters(DateTime startDate) {
SavingsProductParameters params = getGenericSavingsProductParameters(startDate, SavingsProductParameters.MANDATORY, SavingsProductParameters.CLIENTS);
params.setDaysOrMonthsForInterestCalculation(params.DAYS);
params.setInterestRate("1");
params.setFrequencyOfInterestPostings("1");
params.setNumberOfDaysOrMonthsForInterestCalculation("1");
params.setBalanceUsedForInterestCalculation(SavingsProductParameters.MINIMUM_BALANCE);
params.setMandatoryAmount("100000");
return params;
}
Aggregations