Search in sources :

Example 6 with ProductDefinitionException

use of org.mifos.accounts.productdefinition.exceptions.ProductDefinitionException in project head by mifos.

the class LoanOfferingBOIntegrationTest method testMinInstallmentsGreaterThanMaxInstallments.

@Test
public void testMinInstallmentsGreaterThanMaxInstallments() {
    createIntitalObjects();
    Date startDate = offSetCurrentDate(0);
    Date endDate = offSetCurrentDate(2);
    try {
        new LoanOfferingBO(TestObjectFactory.getContext(), "Loan Offering", "LOAP", productCategory, prdApplicableMaster, startDate, endDate, null, null, null, interestTypes, new Money(getCurrency(), "1000"), new Money(getCurrency(), "3000"), new Money(getCurrency(), "2000.0"), 12.0, 2.0, 3.0, (short) 20, (short) 31, (short) 21, false, false, false, null, null, null, frequency, principalglCodeEntity, intglCodeEntity, waiverInterest);
        Assert.fail();
    } catch (ProductDefinitionException e) {
    }
}
Also used : Money(org.mifos.framework.util.helpers.Money) ProductDefinitionException(org.mifos.accounts.productdefinition.exceptions.ProductDefinitionException) Date(java.sql.Date) Test(org.junit.Test)

Example 7 with ProductDefinitionException

use of org.mifos.accounts.productdefinition.exceptions.ProductDefinitionException in project head by mifos.

the class LoanOfferingBOIntegrationTest method testBuildloanOfferingWithoutName.

@Test
public void testBuildloanOfferingWithoutName() throws SystemException, ApplicationException {
    createIntitalObjects();
    try {
        new LoanOfferingBO(TestObjectFactory.getContext(), null, "S", productCategory, prdApplicableMaster, new Date(System.currentTimeMillis()), interestTypes, new Money(getCurrency(), "1000"), new Money(getCurrency(), "3000"), 12.0, 2.0, 3.0, (short) 20, (short) 1, (short) 12, false, false, false, frequency, principalglCodeEntity, intglCodeEntity, waiverInterest);
        Assert.fail();
    } catch (ProductDefinitionException e) {
    }
}
Also used : Money(org.mifos.framework.util.helpers.Money) ProductDefinitionException(org.mifos.accounts.productdefinition.exceptions.ProductDefinitionException) Date(java.sql.Date) Test(org.junit.Test)

Example 8 with ProductDefinitionException

use of org.mifos.accounts.productdefinition.exceptions.ProductDefinitionException in project head by mifos.

the class LoanOfferingBOIntegrationTest method testUpdateFeeNotMatchingFrequencyOfLoanOffering.

@Test
public void testUpdateFeeNotMatchingFrequencyOfLoanOffering() throws ProductDefinitionException, FeeException {
    createIntitalObjects();
    GracePeriodTypeEntity gracePeriodType = new GracePeriodTypeEntity(GraceType.NONE);
    Date startDate = offSetCurrentDate(0);
    Date endDate = offSetCurrentDate(2);
    FeeBO fee = new AmountFeeBO(TestObjectFactory.getContext(), "Loan Periodic", new CategoryTypeEntity(FeeCategory.LOAN), new FeeFrequencyTypeEntity(FeeFrequencyType.PERIODIC), intglCodeEntity, new Money(getCurrency(), "100"), false, TestObjectFactory.createMeeting(TestObjectFactory.getNewMeeting(MONTHLY, EVERY_MONTH, CUSTOMER_MEETING, MONDAY)));
    List<FeeBO> fees = new ArrayList<FeeBO>();
    fees.add(fee);
    product = createLoanOfferingBO("Loan Product", "LOAP");
    try {
        product.update((short) 1, "Loan Product", "LOAN", productCategory, prdApplicableMaster, startDate, endDate, "Loan Product updated", PrdStatus.LOAN_ACTIVE, gracePeriodType, interestTypes, (short) 0, new Money(getCurrency(), "3000"), new Money(getCurrency(), "1000"), new Money(getCurrency(), "1000"), 12.0, 2.0, 12.0, (short) 12, (short) 1, (short) 2, false, true, false, null, fees, null, (short) 2, RecurrenceType.WEEKLY, waiverInterest);
        Assert.fail();
    } catch (ProductDefinitionException e) {
    }
}
Also used : Money(org.mifos.framework.util.helpers.Money) FeeFrequencyTypeEntity(org.mifos.accounts.fees.business.FeeFrequencyTypeEntity) ProductDefinitionException(org.mifos.accounts.productdefinition.exceptions.ProductDefinitionException) ArrayList(java.util.ArrayList) CategoryTypeEntity(org.mifos.accounts.fees.business.CategoryTypeEntity) FeeBO(org.mifos.accounts.fees.business.FeeBO) AmountFeeBO(org.mifos.accounts.fees.business.AmountFeeBO) Date(java.sql.Date) AmountFeeBO(org.mifos.accounts.fees.business.AmountFeeBO) Test(org.junit.Test)

Example 9 with ProductDefinitionException

use of org.mifos.accounts.productdefinition.exceptions.ProductDefinitionException in project head by mifos.

the class LoanOfferingBOIntegrationTest method testUpdateloanOfferingWithDuplicatePrdOfferingShortName.

@Test
public void testUpdateloanOfferingWithDuplicatePrdOfferingShortName() throws SystemException, ApplicationException {
    product = createLoanOfferingBO("Loan Product", "LOAP");
    LoanOfferingBO loanOffering1 = createLoanOfferingBO("Loan Product1", "LOA1");
    createIntitalObjects();
    Date startDate = offSetCurrentDate(0);
    try {
        loanOffering1.update((short) 1, "Loan Product1", "LOAP", productCategory, prdApplicableMaster, startDate, null, "Loan Product updated", PrdStatus.LOAN_ACTIVE, null, interestTypes, (short) 0, new Money(getCurrency(), "3000"), new Money(getCurrency(), "1000"), new Money(getCurrency(), "2000"), 12.0, 2.0, 3.0, (short) 20, (short) 1, (short) 12, false, false, false, null, null, null, (short) 2, RecurrenceType.WEEKLY, waiverInterest);
        Assert.fail();
    } catch (ProductDefinitionException e) {
    }
    TestObjectFactory.removeObject(loanOffering1);
}
Also used : Money(org.mifos.framework.util.helpers.Money) ProductDefinitionException(org.mifos.accounts.productdefinition.exceptions.ProductDefinitionException) Date(java.sql.Date) Test(org.junit.Test)

Example 10 with ProductDefinitionException

use of org.mifos.accounts.productdefinition.exceptions.ProductDefinitionException in project head by mifos.

the class LoanOfferingBOIntegrationTest method testUpdateDefInterestRateNotBetweenMinMaxRates.

@Test
public void testUpdateDefInterestRateNotBetweenMinMaxRates() {
    createIntitalObjects();
    Date startDate = offSetCurrentDate(0);
    product = createLoanOfferingBO("Loan Product", "LOAP");
    try {
        product.update((short) 1, "Loan Product", "LOAN", productCategory, prdApplicableMaster, startDate, null, "Loan Product updated", PrdStatus.LOAN_ACTIVE, null, interestTypes, (short) 0, new Money(getCurrency(), "3000"), new Money(getCurrency(), "1000"), new Money(getCurrency(), "1000"), 12.0, 2.0, 13.0, (short) 20, (short) 1, (short) 12, false, false, false, null, null, null, (short) 2, RecurrenceType.WEEKLY, waiverInterest);
        Assert.fail();
    } catch (ProductDefinitionException e) {
    }
}
Also used : Money(org.mifos.framework.util.helpers.Money) ProductDefinitionException(org.mifos.accounts.productdefinition.exceptions.ProductDefinitionException) Date(java.sql.Date) Test(org.junit.Test)

Aggregations

ProductDefinitionException (org.mifos.accounts.productdefinition.exceptions.ProductDefinitionException)65 Test (org.junit.Test)51 Date (java.sql.Date)50 Money (org.mifos.framework.util.helpers.Money)49 MeetingBO (org.mifos.application.meeting.business.MeetingBO)15 GLCodeEntity (org.mifos.accounts.financial.business.GLCodeEntity)13 PersistenceException (org.mifos.framework.exceptions.PersistenceException)9 ArrayList (java.util.ArrayList)5 InterestTypesEntity (org.mifos.application.master.business.InterestTypesEntity)5 LoanOfferingBO (org.mifos.accounts.productdefinition.business.LoanOfferingBO)4 PrdApplicableMasterEntity (org.mifos.accounts.productdefinition.business.PrdApplicableMasterEntity)4 PrdStatusEntity (org.mifos.accounts.productdefinition.business.PrdStatusEntity)4 ProductCategoryBO (org.mifos.accounts.productdefinition.business.ProductCategoryBO)4 PrdOfferingPersistence (org.mifos.accounts.productdefinition.persistence.PrdOfferingPersistence)4 MifosRuntimeException (org.mifos.core.MifosRuntimeException)4 GracePeriodTypeEntity (org.mifos.accounts.productdefinition.business.GracePeriodTypeEntity)3 AmountFeeBO (org.mifos.accounts.fees.business.AmountFeeBO)2 CategoryTypeEntity (org.mifos.accounts.fees.business.CategoryTypeEntity)2 FeeBO (org.mifos.accounts.fees.business.FeeBO)2 FeeFrequencyTypeEntity (org.mifos.accounts.fees.business.FeeFrequencyTypeEntity)2