svn commit: r795831 - in /ofbiz/trunk/applications/accounting: data/DemoFinAccountData.xml script/org/ofbiz/accounting/test/AutoPaymentTests.xml testdef/paymenttests.xml

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

svn commit: r795831 - in /ofbiz/trunk/applications/accounting: data/DemoFinAccountData.xml script/org/ofbiz/accounting/test/AutoPaymentTests.xml testdef/paymenttests.xml

apatel-2
Author: apatel
Date: Mon Jul 20 13:32:11 2009
New Revision: 795831

URL: http://svn.apache.org/viewvc?rev=795831&view=rev
Log:
Tests for setFinAccountTransStatus. Thanks Surya and Sumit for working on it.

Modified:
    ofbiz/trunk/applications/accounting/data/DemoFinAccountData.xml
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml
    ofbiz/trunk/applications/accounting/testdef/paymenttests.xml

Modified: ofbiz/trunk/applications/accounting/data/DemoFinAccountData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/DemoFinAccountData.xml?rev=795831&r1=795830&r2=795831&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/data/DemoFinAccountData.xml (original)
+++ ofbiz/trunk/applications/accounting/data/DemoFinAccountData.xml Mon Jul 20 13:32:11 2009
@@ -6,7 +6,7 @@
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
+with the License.<option key="cutomTimePeriod.cutomTimePeriodId" description="${cutomTimePeriod.fromDate} - ${cutomTimePeriod.thruDate}"/>  You may obtain a copy of the License at
 
 http://www.apache.org/licenses/LICENSE-2.0
 
@@ -30,5 +30,7 @@
     <FinAccountStatus finAccountId="9001" statusId="FNACT_ACTIVE" statusDate="2009-04-01 00:00:01.000"/>
     <FinAccountTrans finAccountTransId="9101" finAccountTransTypeId="DEPOSIT" finAccountId="9001" amount="75000.00"
             partyId="Company" transactionDate="2009-04-01 00:00:01.000" entryDate="2009-04-01 00:00:01.000" performedByPartyId="admin" statusId="FINACT_TRNS_APPROVED"/>
-
+    <FinAccountTrans finAccountTransId="9102" finAccountTransTypeId="DEPOSIT" finAccountId="9001" amount="500.00"
+            partyId="Company" transactionDate="2009-07-18 00:00:01.000" entryDate="2009-07-18 00:00:01.000" performedByPartyId="admin" statusId="FINACT_TRNS_CREATED" paymentId="8001"/>
+    <Payment paymentId="8001" finAccountTransId="9102"/>
 </entity-engine-xml>
\ No newline at end of file

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=795831&r1=795830&r2=795831&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 Mon Jul 20 13:32:11 2009
@@ -292,4 +292,32 @@
         </iterate>
         <log level="info" message="fin Account Trans has been created with Id ${finAccountTransId}"/>
     </simple-method>
+
+    <simple-method method-name="testSetFinAccountTransStatus" short-description="test case for setFinAccountTransStatus service" login-required="false">
+        <!-- Precondition : FinAccountTrans should be in CREATED status -->
+
+        <!-- Post condition : FinAccountTrans status changes to CANCELED
+                              Clear finAccountTransId field and update associated Payment record  -->
+        <set field="finAccountTransId" value="9102"/>
+        <set field="statusId" value="FINACT_TRNS_CANCELED"/>
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set field="setFinAccountTransStatusMap.finAccountTransId" from-field="finAccountTransId"/>
+        <set field="setFinAccountTransStatusMap.statusId" from-field="statusId"/>
+        <set field="setFinAccountTransStatusMap.userLogin" from-field="userLogin"/>
+        <call-service service-name="setFinAccountTransStatus" in-map-name="setFinAccountTransStatusMap"/>    
+        <entity-one entity-name="FinAccountTrans" value-field="finAccountTrans"/>
+        <assert>
+            <if-compare-field field="finAccountTrans.statusId" operator="equals" to-field="statusId"/>
+        </assert>
+        <check-errors/>
+        <get-related-one relation-name="Payment" value-field="finAccountTrans" to-value-field="payment"/>
+        <if-not-empty field="payment">
+            <assert>
+                <if-empty field="payment.finAccountTransId"/>
+            </assert>
+            <check-errors/>            
+        </if-not-empty>
+    </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=795831&r1=795830&r2=795831&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/testdef/paymenttests.xml (original)
+++ ofbiz/trunk/applications/accounting/testdef/paymenttests.xml Mon Jul 20 13:32:11 2009
@@ -53,4 +53,9 @@
     <test-case case-name="auto-tests-deposit-withdraw-payments-In-single-trans">
         <simple-method-test location="component://accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml" name="testDepositWithdrawPaymentsInSingleTrans"/>
     </test-case>
+
+    <!--Test case for fin account trans-->
+    <test-case case-name="auto-tests-setFinAccountTransStatus">
+        <simple-method-test location="component://accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml" name="testSetFinAccountTransStatus"/>
+    </test-case>    
 </test-suite>
\ No newline at end of file