Author: ashish
Date: Sun Jul 12 11:57:55 2009 New Revision: 793336 URL: http://svn.apache.org/viewvc?rev=793336&view=rev Log: Applied patch from jira issue OFBIZ-2715 - (Accounting - AP)Junit test case to test the service which creates payment group for given invoices along with its payment and application. Thanks Chirag, Sumit for the contribution. Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml ofbiz/trunk/applications/accounting/testdef/paymenttests.xml Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml?rev=793336&r1=793335&r2=793336&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml (original) +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml Sun Jul 12 11:57:55 2009 @@ -142,4 +142,48 @@ </iterate> <check-errors/> </simple-method> + + <simple-method method-name="testCreatePaymentAndPaymentGroupForInvoices" short-description="Test case for validate service which is creating payment and payment group" login-required="false"> + <!-- Precondition : Invoice is in ready status. + Invoice outstanding amount should be greater than zero --> + + <!-- Following process is tested by test case: + This will call createPaymentAndPaymentGroupForInvoices service and return a paymentGroupId; + 1. Checked for paymentGroupId for not empty + 2. Checked for associated paymentGroupMembers for not empty --> + + <!-- Post condition : Invoice status should be changed to paid. + Payment should be created with PaymentApplications. + PaymentGroup and PaymentGroupMembers should be created. --> + + <entity-one entity-name="UserLogin" value-field="createPaymentAndPaymentGroupForInvoicesMap.userLogin"> + <field-map field-name="userLoginId" value="system"/> + </entity-one> + <set field="createPaymentAndPaymentGroupForInvoicesMap.organizationPartyId" value="Company"/> + <set field="createPaymentAndPaymentGroupForInvoicesMap.checkStartNumber" type="Long" value="100101"/> + <string-to-list string="demo10001" list="invoiceIds"/> + <string-to-list string="8000" list="invoiceIds"/> + <string-to-list string="8001" list="invoiceIds"/> + <set field="createPaymentAndPaymentGroupForInvoicesMap.invoiceIds" from-field="invoiceIds"/> + <set field="createPaymentAndPaymentGroupForInvoicesMap.paymentMethodTypeId" value="COMPANY_CHECK"/> + <call-service service-name="createPaymentAndPaymentGroupForInvoices" in-map-name="createPaymentAndPaymentGroupForInvoicesMap"> + <result-to-field result-name="paymentGroupId"/> + </call-service> + <assert> + <not> + <if-empty field="paymentGroupId"/> + </not> + </assert> + <check-errors/> + <entity-condition entity-name="PaymentGroupMember" list="paymentGroupMembers"> + <condition-expr field-name="paymentGroupId" from-field="paymentGroupId"/> + </entity-condition> + <assert> + <not> + <if-empty field="paymentGroupMembers"/> + </not> + </assert> + <check-errors/> + <log level="info" message="Test case ran successfully for input - invoiceIds : ${invoiceIds} and output - paymentGroupId : ${paymentGroupId}"/> + </simple-method> </simple-methods> \ No newline at end of file Modified: ofbiz/trunk/applications/accounting/testdef/paymenttests.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/testdef/paymenttests.xml?rev=793336&r1=793335&r2=793336&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/testdef/paymenttests.xml (original) +++ ofbiz/trunk/applications/accounting/testdef/paymenttests.xml Sun Jul 12 11:57:55 2009 @@ -35,4 +35,9 @@ <test-case case-name="auto-test-cancelInvoice"> <simple-method-test location="component://accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml" name="testCancelInvoice"/> </test-case> + + <!--Test case for process mass check run--> + <test-case case-name="auto-tests-createPaymentAndPaymentGroupForInvoices"> + <simple-method-test location="component://accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml" name="testCreatePaymentAndPaymentGroupForInvoices"/> + </test-case> </test-suite> \ No newline at end of file |
Free forum by Nabble | Edit this page |