svn commit: r1768183 - in /ofbiz/trunk/applications/accounting: minilang/test/AutoAcctgInvoiceTests.xml testdef/data/AccountingTestsData.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1768183 - in /ofbiz/trunk/applications/accounting: minilang/test/AutoAcctgInvoiceTests.xml testdef/data/AccountingTestsData.xml

Deepak Dixit-5
Author: deepak
Date: Sat Nov  5 10:33:56 2016
New Revision: 1768183

URL: http://svn.apache.org/viewvc?rev=1768183&view=rev
Log:
Improved: Added test cases for following invoice related servicse.
- createInvoiceItem
- createInvoiceStatus
- createInvoiceRole
- createInvoiceTerm
- cancelInvoice
(OFBIZ-8896)(OFBIZ-8898)(OFBIZ-8900)(OFBIZ-89001)

Thanks Deepak Nigam for your contribution

Modified:
    ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgInvoiceTests.xml
    ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml

Modified: ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgInvoiceTests.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgInvoiceTests.xml?rev=1768183&r1=1768182&r2=1768183&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgInvoiceTests.xml (original)
+++ ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgInvoiceTests.xml Sat Nov  5 10:33:56 2016
@@ -105,4 +105,98 @@ under the License.
         </assert>
         <check-errors/>
     </simple-method>
+    <simple-method method-name="testCreateInvoiceItem" short-description="Test case for service createInvoiceItem" login-required="false">
+        <set field="serviceCtx.invoiceId" value="1003"/>
+        <set field="serviceCtx.invoiceItemTypeId" value="PINV_FXASTPRD_ITEM"/>
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set field="serviceCtx.userLogin" from-field="userLogin"/>
+        <call-service service-name="createInvoiceItem" in-map-name="serviceCtx">
+            <results-to-map map-name="serviceResult"/>
+        </call-service>
+        <assert>
+            <not><if-empty field="serviceResult"/></not>
+            <not><if-empty field="serviceResult.invoiceItemSeqId"/></not>
+        </assert>
+        <check-errors/>
+    </simple-method>
+    <simple-method method-name="testCreateInvoiceStatus" short-description="Test case for service createInvoiceStatus" login-required="false">
+        <now-timestamp field="nowTimestamp"/>
+        <set field="serviceCtx.invoiceId" value="1004"/>
+        <set field="serviceCtx.statusId" value="INVOICE_IN_PROCESS"/>
+        <set field="serviceCtx.statusDate" from-field="nowTimestamp"/>
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set field="serviceCtx.userLogin" from-field="userLogin"/>
+        <call-service service-name="createInvoiceStatus" in-map-name="serviceCtx"/>
+        <entity-one entity-name="InvoiceStatus" value-field="invoiceStatus">
+            <field-map field-name="invoiceId" value="1004"/>
+            <field-map field-name="statusId" value="INVOICE_IN_PROCESS"/>
+            <field-map field-name="statusDate" from-field="nowTimestamp"/>
+        </entity-one>
+        <assert>
+            <not><if-empty field="invoiceStatus"/></not>
+        </assert>
+        <check-errors/>
+    </simple-method>
+    <simple-method method-name="testCreateInvoiceStatus" short-description="Test case for service createInvoiceRole" login-required="false">
+        <set field="serviceCtx.invoiceId" value="1005"/>
+        <set field="serviceCtx.partyId" value="DEMO_COMPANY"/>
+        <set field="serviceCtx.roleTypeId" value="INTERNAL_ORGANIZATIO"/>
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set field="serviceCtx.userLogin" from-field="userLogin"/>
+        <call-service service-name="createInvoiceRole" in-map-name="serviceCtx"/>
+        <entity-one entity-name="InvoiceRole" value-field="invoiceRole">
+            <field-map field-name="invoiceId" value="1005"/>
+            <field-map field-name="partyId" value="DEMO_COMPANY"/>
+            <field-map field-name="roleTypeId" value="INTERNAL_ORGANIZATIO"/>
+        </entity-one>
+        <assert>
+            <not><if-empty field="invoiceRole"/></not>
+        </assert>
+        <check-errors/>
+    </simple-method>
+    <simple-method method-name="testCreateInvoiceTerm" short-description="Test case for service createInvoiceTerm" login-required="false">
+        <set field="serviceCtx.invoiceId" value="1006"/>
+        <set field="serviceCtx.invoiceItemSeqId" value="00001"/>
+        <set field="serviceCtx.termTypeId" value="FINANCIAL_TERM"/>
+        <set field="serviceCtx.termValue" value="50.00"/>
+        <set field="serviceCtx.termDays" value="10"/>
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set field="serviceCtx.userLogin" from-field="userLogin"/>
+        <call-service service-name="createInvoiceTerm" in-map-name="serviceCtx">
+            <results-to-map map-name="serviceResult"/>
+        </call-service>
+        <entity-one entity-name="InvoiceTerm" value-field="invoiceTerm">
+            <field-map field-name="invoiceTermId" from-field="serviceResult.invoiceTermId"/>
+        </entity-one>
+        <assert>
+            <not><if-empty field="invoiceTerm"/></not>
+            <if-compare operator="equals" value="1006" field="invoiceTerm.invoiceId"></if-compare>
+            <if-compare operator="equals" value="00001" field="invoiceTerm.invoiceItemSeqId"></if-compare>
+            <if-compare operator="equals" value="50.00" field="invoiceTerm.termValue"></if-compare>
+        </assert>
+        <check-errors/>
+    </simple-method>
+    <simple-method method-name="testCancelInvoice" short-description="Test case for service cancelInvoice" login-required="false">
+        <set field="serviceCtx.invoiceId" value="1007"/>
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set field="serviceCtx.userLogin" from-field="userLogin"/>
+        <call-service service-name="cancelInvoice" in-map-name="serviceCtx">
+            <results-to-map map-name="serviceResult"/>
+        </call-service>
+        <assert>
+            <not><if-empty field="serviceResult"/></not>
+            <not><if-empty field="serviceResult.invoiceTypeId"/></not>
+        </assert>
+        <check-errors/>
+    </simple-method>
 </simple-methods>
\ No newline at end of file

Modified: ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml?rev=1768183&r1=1768182&r2=1768183&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml (original)
+++ ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml Sat Nov  5 10:33:56 2016
@@ -90,5 +90,10 @@ under the License.
     <Invoice invoiceId="1002" invoiceTypeId="PURCHASE_INVOICE" statusId="INVOICE_IN_PROCESS" partyIdFrom="DEMO_COMPANY" partyId="DEMO_COMPANY1" invoiceDate="2016-11-03 00:00:00"/>
     <!-- For Testing service setInvoiceStatus -->
     <Invoice invoiceId="1002" invoiceTypeId="PURCHASE_INVOICE" statusId="INVOICE_IN_PROCESS" partyIdFrom="DEMO_COMPANY" partyId="DEMO_COMPANY1" invoiceDate="2016-11-03 00:00:00"/>
-
+    <Invoice invoiceId="1003" invoiceTypeId="PURCHASE_INVOICE" statusId="INVOICE_IN_PROCESS" partyIdFrom="DEMO_COMPANY" partyId="DEMO_COMPANY1" invoiceDate="2016-11-03 00:00:00"/>
+    <Invoice invoiceId="1004" invoiceTypeId="PURCHASE_INVOICE" partyIdFrom="DEMO_COMPANY" partyId="DEMO_COMPANY1" invoiceDate="2016-11-03 00:00:00"/>
+    <Invoice invoiceId="1005" invoiceTypeId="PURCHASE_INVOICE" statusId="INVOICE_IN_PROCESS" partyIdFrom="DEMO_COMPANY" partyId="DEMO_COMPANY1" invoiceDate="2016-11-03 00:00:00"/>
+    <Invoice invoiceId="1006" invoiceTypeId="PURCHASE_INVOICE" statusId="INVOICE_IN_PROCESS" partyIdFrom="DEMO_COMPANY" partyId="DEMO_COMPANY1" invoiceDate="2016-11-03 00:00:00"/>
+    <InvoiceItem invoiceId="1006" invoiceItemSeqId="00001" invoiceItemTypeId="PINV_FXASTPRD_ITEM"/>
+    <Invoice invoiceId="1007" invoiceTypeId="PURCHASE_INVOICE" statusId="INVOICE_IN_PROCESS" partyIdFrom="DEMO_COMPANY" partyId="DEMO_COMPANY1" invoiceDate="2016-11-03 00:00:00"/>
 </entity-engine-xml>