Search in sources :

Example 76 with Ignore

use of org.junit.Ignore in project head by mifos.

the class LoanScheduleEntityIntegrationTest method testGetTotalDueWithFees.

@Ignore
@Test
public void testGetTotalDueWithFees() {
    LoanScheduleEntity accountActionDate = (LoanScheduleEntity) groupLoan.getAccountActionDates().toArray()[0];
    accountActionDate.setPrincipalPaid(new Money(getCurrency(), "10.0"));
    accountActionDate.setInterestPaid(new Money(getCurrency(), "2.0"));
    accountActionDate.setPenalty(new Money(getCurrency(), "20.0"));
    accountActionDate.setPenaltyPaid(new Money(getCurrency(), "5.0"));
    accountActionDate.setMiscPenalty(new Money(getCurrency(), "10.0"));
    accountActionDate.setMiscFee(new Money(getCurrency(), "20.0"));
    accountActionDate.setMiscFeePaid(new Money(getCurrency(), "5.0"));
    Assert.assertEquals(TestUtils.createMoney(240.0), accountActionDate.getTotalDueWithFees());
}
Also used : Money(org.mifos.framework.util.helpers.Money) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 77 with Ignore

use of org.junit.Ignore in project head by mifos.

the class SavingsScheduleIntegrationTest method createWeeklySavingScheduleSecondInstallmentFallsInNextMeetingHoliday.

@Ignore
@Test
public void createWeeklySavingScheduleSecondInstallmentFallsInNextMeetingHoliday() throws Exception {
    buildAndPersistHoliday(expectedFirstDepositDate.plusWeeks(1), expectedFirstDepositDate.plusWeeks(1), RepaymentRuleTypes.NEXT_MEETING_OR_REPAYMENT);
    createClientSavingsAccount();
    short installmentId = 1;
    DateTime installmentDate = expectedFirstDepositDate;
    for (AccountActionDateEntity accountActionDate : getActionDatesSortedByDate(savingsAccount)) {
        SavingsScheduleEntity scheduleEntity = (SavingsScheduleEntity) accountActionDate;
        assertThat(scheduleEntity.getInstallmentId(), is(installmentId));
        if (installmentId == 2) {
            // only second installment pushed out one week.
            assertThat(new LocalDate(scheduleEntity.getActionDate()), is(new LocalDate(installmentDate.plusWeeks(1).toDate())));
        } else {
            assertThat(new LocalDate(scheduleEntity.getActionDate()), is(new LocalDate(installmentDate.toDate())));
        }
        assertThat(scheduleEntity.getDeposit().getAmountDoubleValue(), is(13.0));
        installmentId++;
        installmentDate = installmentDate.plusWeeks(1);
    }
}
Also used : AccountActionDateEntity(org.mifos.accounts.business.AccountActionDateEntity) SavingsScheduleEntity(org.mifos.accounts.savings.business.SavingsScheduleEntity) LocalDate(org.joda.time.LocalDate) DateTime(org.joda.time.DateTime) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 78 with Ignore

use of org.junit.Ignore in project head by mifos.

the class SavingsScheduleIntegrationTest method createWeeklySavingScheduleSecondInstallmentFallsInNextWorkingDayHoliday.

@Ignore
@Test
public void createWeeklySavingScheduleSecondInstallmentFallsInNextWorkingDayHoliday() throws Exception {
    // One-day holiday on the second deposit date, Monday
    buildAndPersistHoliday(expectedFirstDepositDate.plusWeeks(1), expectedFirstDepositDate.plusWeeks(1), RepaymentRuleTypes.NEXT_WORKING_DAY);
    createClientSavingsAccount();
    short installmentId = 1;
    DateTime installmentDate = expectedFirstDepositDate;
    for (AccountActionDateEntity accountActionDate : getActionDatesSortedByDate(savingsAccount)) {
        SavingsScheduleEntity scheduleEntity = (SavingsScheduleEntity) accountActionDate;
        assertThat(scheduleEntity.getInstallmentId(), is(installmentId));
        if (installmentId == 2) {
            assertThat(new LocalDate(scheduleEntity.getActionDate()), //Tuesday after holiday
            is(new LocalDate(installmentDate.plusDays(1).toDate())));
        } else {
            assertThat(new LocalDate(scheduleEntity.getActionDate()), is(new LocalDate(installmentDate.toDate())));
        }
        assertThat(scheduleEntity.getDeposit().getAmountDoubleValue(), is(13.0));
        installmentId++;
        installmentDate = installmentDate.plusWeeks(1);
    }
}
Also used : AccountActionDateEntity(org.mifos.accounts.business.AccountActionDateEntity) SavingsScheduleEntity(org.mifos.accounts.savings.business.SavingsScheduleEntity) LocalDate(org.joda.time.LocalDate) DateTime(org.joda.time.DateTime) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 79 with Ignore

use of org.junit.Ignore in project head by mifos.

the class SavingsScheduleIntegrationTest method createWeeklySavingScheduleSecondInstallmentFallsInMoratorium.

@Ignore
@Test
public void createWeeklySavingScheduleSecondInstallmentFallsInMoratorium() throws Exception {
    buildAndPersistHoliday(expectedFirstDepositDate.plusWeeks(1), expectedFirstDepositDate.plusWeeks(1), RepaymentRuleTypes.REPAYMENT_MORATORIUM);
    createClientSavingsAccount();
    short installmentId = 1;
    DateTime installmentDate = expectedFirstDepositDate;
    for (AccountActionDateEntity accountActionDate : getActionDatesSortedByDate(savingsAccount)) {
        SavingsScheduleEntity scheduleEntity = (SavingsScheduleEntity) accountActionDate;
        assertThat(scheduleEntity.getInstallmentId(), is(installmentId));
        if (installmentId < 2) {
            assertThat(new LocalDate(scheduleEntity.getActionDate()), is(new LocalDate(installmentDate.toDate())));
        } else {
            // second and following dates pushed out one week.
            assertThat(new LocalDate(scheduleEntity.getActionDate()), is(new LocalDate(installmentDate.plusWeeks(1).toDate())));
        }
        assertThat(scheduleEntity.getDeposit().getAmountDoubleValue(), is(13.0));
        installmentId++;
        installmentDate = installmentDate.plusWeeks(1);
    }
}
Also used : AccountActionDateEntity(org.mifos.accounts.business.AccountActionDateEntity) SavingsScheduleEntity(org.mifos.accounts.savings.business.SavingsScheduleEntity) LocalDate(org.joda.time.LocalDate) DateTime(org.joda.time.DateTime) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 80 with Ignore

use of org.junit.Ignore in project head by mifos.

the class LoanBOTest method testCopyInstallmentSchedule.

/**
     * does't work when changing applicatonConfiguration.custom.properties file.
     * Need to pull out static references to AccountingRules in used classes.
     */
@Ignore
@Test
public void testCopyInstallmentSchedule() {
    Money.setDefaultCurrency(rupee);
    LoanBO loanBO = new LoanAccountBuilder().build();
    loanBO.addAccountActionDate(getLoanScheduleEntity(rupee, getDate(23, 10, 2010), "100", "10", "1", Money.zero(rupee)));
    loanBO.addAccountActionDate(getLoanScheduleEntity(rupee, getDate(23, 11, 2010), "100", "10", "2", Money.zero(rupee)));
    loanBO.addAccountActionDate(getLoanScheduleEntity(rupee, getDate(23, 12, 2010), "100", "10", "3", Money.zero(rupee)));
    List<RepaymentScheduleInstallment> installments = new ArrayList<RepaymentScheduleInstallment>();
    installments.add(getRepaymentScheduleInstallment("24-Oct-2010", 1, "123", "12"));
    installments.add(getRepaymentScheduleInstallment("24-Nov-2010", 2, "231", "23"));
    installments.add(getRepaymentScheduleInstallment("24-Dec-2010", 3, "312", "31"));
    loanBO.updateInstallmentSchedule(installments);
    Set<LoanScheduleEntity> loanScheduleEntities = loanBO.getLoanScheduleEntities();
    LoanScheduleEntity[] loanScheduleEntitiesArr = loanScheduleEntities.toArray(new LoanScheduleEntity[loanScheduleEntities.size()]);
    assertLoanScheduleEntity(loanScheduleEntitiesArr[0], "123.0", "12.0", "2010-10-24");
    assertLoanScheduleEntity(loanScheduleEntitiesArr[1], "231.0", "23.0", "2010-11-24");
    assertLoanScheduleEntity(loanScheduleEntitiesArr[2], "312.0", "31.0", "2010-12-24");
}
Also used : RepaymentScheduleInstallment(org.mifos.accounts.loan.util.helpers.RepaymentScheduleInstallment) LoanAccountBuilder(org.mifos.domain.builders.LoanAccountBuilder) ArrayList(java.util.ArrayList) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

Ignore (org.junit.Ignore)5092 Test (org.junit.Test)4807 File (java.io.File)445 ArrayList (java.util.ArrayList)374 IOException (java.io.IOException)217 HashMap (java.util.HashMap)187 List (java.util.List)171 CountDownLatch (java.util.concurrent.CountDownLatch)118 Map (java.util.Map)103 LocalDate (java.time.LocalDate)94 Dataset (org.apache.jena.query.Dataset)93 InputStream (java.io.InputStream)89 Date (java.util.Date)88 Random (java.util.Random)85 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)83 Properties (java.util.Properties)78 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)78 HashSet (java.util.HashSet)71 ByteArrayOutputStream (java.io.ByteArrayOutputStream)70 ExecutorService (java.util.concurrent.ExecutorService)70