use of org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters 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.savings.DepositWithdrawalSavingsParameters in project head by mifos.
the class SavingsAccountPerformanceHistoryTest method savingsDepositWithdrawalAndVerifyPerformanceHistory.
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void savingsDepositWithdrawalAndVerifyPerformanceHistory() throws Exception {
initRemote.dataLoadAndCacheRefresh(dbUnitUtilities, "acceptance_small_008_dbunit.xml", dataSource, selenium);
DepositWithdrawalSavingsParameters params = new DepositWithdrawalSavingsParameters();
params.setTrxnDateMM("09");
params.setTrxnDateDD("09");
params.setTrxnDateYYYY("2009");
params.setAmount("888.8");
params.setPaymentType(DepositWithdrawalSavingsParameters.CASH);
params.setTrxnType(DepositWithdrawalSavingsParameters.DEPOSIT);
// deposit initial amount to savings account
SavingsAccountDetailPage savingsAccountDetailPage = savingsAccountHelper.makeDepositOrWithdrawalOnSavingsAccount("000100000000119", params);
savingsAccountDetailPage.verifyPage();
// withdraw portion of savings
params.setAmount("123.0");
params.setTrxnType(DepositWithdrawalSavingsParameters.WITHDRAWAL);
savingsAccountHelper.makeDepositOrWithdrawalOnSavingsAccount("000100000000119", params);
// another deposit
params.setAmount("10.0");
params.setTrxnType(DepositWithdrawalSavingsParameters.DEPOSIT);
savingsAccountHelper.makeDepositOrWithdrawalOnSavingsAccount("000100000000119", params);
// another withdrawal
params.setAmount("20.0");
params.setTrxnType(DepositWithdrawalSavingsParameters.WITHDRAWAL);
savingsAccountHelper.makeDepositOrWithdrawalOnSavingsAccount("000100000000119", params);
// validate savings performance history
Assert.assertEquals("Performance history", selenium.getTable("performanceHistoryTable.0.0"));
Assert.assertEquals("Date account opened: 29/01/2009", selenium.getTable("performanceHistoryTable.2.0"));
Assert.assertEquals(selenium.getTable("performanceHistoryTable.3.0"), "Total deposits: 898.8");
Assert.assertEquals(selenium.getTable("performanceHistoryTable.4.0"), "Total interest earned: 0");
Assert.assertEquals(selenium.getTable("performanceHistoryTable.5.0"), "Total withdrawals: 143");
}
use of org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters in project head by mifos.
the class SavingsPaymentTest method setUpSavingsAccount.
private String setUpSavingsAccount() {
CreateSavingsAccountSearchParameters searchParameters = new CreateSavingsAccountSearchParameters();
searchParameters.setSearchString(CLIENT_GLOBAL_NUM);
searchParameters.setSavingsProduct("MonthlyClientSavingsAccount");
CreateSavingsAccountSubmitParameters submitAccountParameters = new CreateSavingsAccountSubmitParameters();
submitAccountParameters.setAmount("100");
SavingsAccountDetailPage savingsPage = savingsTestHelper.createSavingsAccount(searchParameters, submitAccountParameters);
String savingsId = savingsPage.getAccountId();
savingsTestHelper.activateSavingsAccount(savingsId);
DepositWithdrawalSavingsParameters depositParams = new DepositWithdrawalSavingsParameters();
depositParams.setAmount(String.valueOf(SAVINGS_START_BALANCE));
depositParams.setPaymentType(DepositWithdrawalSavingsParameters.CASH);
depositParams.setTrxnType(DepositWithdrawalSavingsParameters.DEPOSIT);
savingsTestHelper.makeDepositOrWithdrawalOnSavingsAccount(savingsId, depositParams);
return savingsId;
}
use of org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters in project head by mifos.
the class SavingsDepositTest method makeDepositToClientSavingsAccount.
// one of the dependent methods throws Exception
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void makeDepositToClientSavingsAccount() throws Exception {
initData();
DepositWithdrawalSavingsParameters params = new DepositWithdrawalSavingsParameters();
params.setTrxnDateMM("09");
params.setTrxnDateDD("09");
params.setTrxnDateYYYY("2009");
params.setAmount("543.2");
params.setPaymentType(DepositWithdrawalSavingsParameters.CASH);
params.setTrxnType(DepositWithdrawalSavingsParameters.DEPOSIT);
params.setReceiptDateDD("09");
params.setReceiptDateMM("09");
params.setReceiptDateYYYY("2009");
SavingsAccountDetailPage accountDetailPage = savingsAccountHelper.makeDepositOrWithdrawalOnSavingsAccount("000100000000036", params);
String[] tablesToRetrieve = { "SAVINGS_ACTIVITY_DETAILS", "SAVINGS_ACCOUNT", "SAVINGS_PERFORMANCE", "SAVINGS_TRXN_DETAIL" };
String[] tablesToValidate = { "SAVINGS_ACTIVITY_DETAILS", "SAVINGS_ACCOUNT", "SAVINGS_PERFORMANCE" };
IDataSet expectedDataSet = dbUnitUtilities.getDataSetFromDataSetDirectoryFile("SavingsDeposit_001_result_dbunit.xml");
IDataSet databaseDataSet = dbUnitUtilities.getDataSetForTables(dataSource, tablesToRetrieve);
dbUnitUtilities.verifyTables(tablesToValidate, databaseDataSet, expectedDataSet);
// verify savings transaction table with sorting
String[] orderSavingsTrxnByColumns = new String[] { "deposit_amount" };
dbUnitUtilities.verifyTableWithSort(orderSavingsTrxnByColumns, SavingsDepositTest.SAVINGS_TRXN_DETAIL, expectedDataSet, databaseDataSet);
// verify transaction history table
TransactionHistoryPage historyPage = accountDetailPage.navigateToTransactionHistoryPage();
historyPage.verifyTableTypeAfterDeposit(2);
}
use of org.mifos.test.acceptance.framework.savings.DepositWithdrawalSavingsParameters in project head by mifos.
the class AdditionalSavingsAccountTest method make3StraightDeposit.
private void make3StraightDeposit(String savingsId) throws Exception {
DateTime targetTime = new DateTime(2011, 2, 10, 13, 0, 0, 0);
DepositWithdrawalSavingsParameters depositParams = new DepositWithdrawalSavingsParameters();
targetTime = new DateTime(2011, 2, 14, 13, 0, 0, 0);
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "100000.0");
targetTime = new DateTime(2011, 2, 21, 13, 0, 0, 0);
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "100000.0");
targetTime = new DateTime(2011, 2, 28, 13, 0, 0, 0);
depositParams = makeDefaultDepositWithdrawal(targetTime, depositParams, savingsId, DepositWithdrawalSavingsParameters.DEPOSIT, "100000.0");
}
Aggregations