svn commit: r1768175 - in /ofbiz/trunk/applications/accounting: minilang/test/AutoAcctgFinAccountTests.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: r1768175 - in /ofbiz/trunk/applications/accounting: minilang/test/AutoAcctgFinAccountTests.xml testdef/data/AccountingTestsData.xml

Deepak Dixit-5
Author: deepak
Date: Sat Nov  5 10:00:52 2016
New Revision: 1768175

URL: http://svn.apache.org/viewvc?rev=1768175&view=rev
Log:
Improved: Added test cases for  createFinAccountAuth  and setFinAccountTransStatus service.
(OFBIZ-8832)(8833)

Thanks Deepak Nigam for your contribution.

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

Modified: ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgFinAccountTests.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgFinAccountTests.xml?rev=1768175&r1=1768174&r2=1768175&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgFinAccountTests.xml (original)
+++ ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgFinAccountTests.xml Sat Nov  5 10:00:52 2016
@@ -179,6 +179,47 @@ under the License.
         </assert>
         <check-errors/>
     </simple-method>
-
-
+    <simple-method method-name="testCreateFinAccountAuth" short-description="Test case for service createFinAccountAuth" login-required="false">
+        <now-timestamp field="nowTimestamp"/>
+        <set field="serviceCtx.finAccountId" value="1004"/>
+        <set field="serviceCtx.amount" value="100.00" type="BigDecimal"/>
+        <set field="serviceCtx.currencyUomId" value="USD" />
+        <set field="serviceCtx.authorizationDate" from-field="nowTimestamp"/>
+        <set field="serviceCtx.fromDate" 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="createFinAccountAuth" in-map-name="serviceCtx">
+            <results-to-map map-name="finAccountAuthResult"/>
+        </call-service>
+        <assert>
+            <not><if-empty field="finAccountAuthResult"/></not>
+            <not><if-empty field="finAccountAuthResult.finAccountAuthId"/></not>
+        </assert>
+        <check-errors/>
+    </simple-method>
+    <simple-method method-name="setFinAccountTransStatus" short-description="Test case for service setFinAccountTransStatus" login-required="false">
+        <now-timestamp field="nowTimestamp"/>
+        <set field="serviceCtx.finAccountTransId" value="1010"/>
+        <set field="serviceCtx.statusId" value="FINACT_TRNS_APPROVED"/>
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set field="serviceCtx.userLogin" from-field="userLogin">
+            <results-to-map map-name="finAccountAuthResult"/>
+        </set>
+        <call-service service-name="setFinAccountTransStatus" in-map-name="serviceCtx">
+            <results-to-map map-name="serviceResult"/>
+        </call-service>
+        <entity-one entity-name="FinAccountTrans" value-field="finAccountTrans">
+            <field-map field-name="finAccountTransId" value="1010"/>
+        </entity-one>
+        <assert>
+            <not><if-empty field="finAccountTrans"/></not>
+            <if-compare operator="equals" value="FINACT_TRNS_APPROVED" field="finAccountTrans.statusId"></if-compare>
+            <if-compare operator="equals" value="FINACT_TRNS_CREATED" field="serviceResult.oldStatusId"></if-compare>
+        </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=1768175&r1=1768174&r2=1768175&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml (original)
+++ ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml Sat Nov  5 10:00:52 2016
@@ -77,4 +77,7 @@ under the License.
     <!-- For Testing service updateFinAccountRole -->
     <FinAccount finAccountId="1004" finAccountTypeId="DEPOSIT_ACCOUNT" finAccountName="Deposit Account" finAccountCode="1001" currencyUomId="USD" organizationPartyId="DEMO_COMPANY" fromDate="2016-11-03 00:00:00" actualBalance="2000.00" availableBalance="1500.00"/>
     <FinAccountRole finAccountId="1004" partyId="DEMO_COMPANY" roleTypeId="SUPPLIER" fromDate="2016-11-03 00:00:00"/>
+    <!-- For Testing service setFinAccountTransStatus -->
+    <FinAccount finAccountId="1005" finAccountTypeId="DEPOSIT_ACCOUNT" finAccountName="Deposit Account" finAccountCode="1001" currencyUomId="USD" organizationPartyId="DEMO_COMPANY" fromDate="2016-11-03 00:00:00" actualBalance="2000.00" availableBalance="1500.00"/>
+    <FinAccountTransType finAccountTransId="1010" finAccountTransTypeId="ADJUSTMENT" finAccountId="1005" statusId="FINACT_TRNS_CREATED" />
 </entity-engine-xml>