svn commit: r881584 - in /ofbiz/trunk/applications/accounting: script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml testdef/accountingtests.xml testdef/data/ 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: r881584 - in /ofbiz/trunk/applications/accounting: script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml testdef/accountingtests.xml testdef/data/ testdef/data/AccountingTestsData.xml

lektran
Author: lektran
Date: Tue Nov 17 22:38:20 2009
New Revision: 881584

URL: http://svn.apache.org/viewvc?rev=881584&view=rev
Log:
Got the auto-accounting-transaction-tests-MaterialIssuance test working, it was assuming that a production run was created but that isn't the case so I've added some test data inventory and code to create the needed production run

Added:
    ofbiz/trunk/applications/accounting/testdef/data/
    ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml   (with props)
Modified:
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml
    ofbiz/trunk/applications/accounting/testdef/accountingtests.xml

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml?rev=881584&r1=881583&r2=881584&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTests.xml Tue Nov 17 22:38:20 2009
@@ -397,7 +397,7 @@
                  productId = MAT_A_COST, quantity = 4, facilityId = Web Store Warehouse
                  productId = MAT_B_COST, quantity = 6, facilityId = Web Store Warehouse
              then new production run is created and then started for following product
-                 productId = PROD_COST, quantity = 2, facilityId = Web Store Warehouse
+                 productId = PROD_MANUF, quantity = 2, facilityId = Web Store Warehouse
 
             Post condition:- In entity "AcctgTransEntry" at least two entries will be created for MAT_A_COST
                  * Credit; in account 141000 - "RAW MATERIALS INVENTORY"; amount: 36$
@@ -406,12 +406,32 @@
                  * Credit; in account 141000 - "RAW MATERIALS INVENTORY"; amount: 42$
                  * Debit; in account 142000 - "WORK IN PROGRESS INVENTORY"; amount: 42$ -->
 
-        <set field="workEffortId" value="10001"/>
+        <!-- Create a production run, TODO: move this to test data so we only have to do the issuance -->
+        <entity-one entity-name="UserLogin" value-field="serviceCtx.userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set field="serviceCtx.userLogin" from-field="userLogin"/>
+        <set field="serviceCtx.facilityId" value="WebStoreWarehouse"/>
+        <set field="serviceCtx.pRQuantity" value="2" type="BigDecimal"/>
+        <set field="serviceCtx.productId" value="PROD_MANUF"/>
+        <set field="serviceCtx.startDate" value="${date:nowTimestamp()}" type="Timestamp"/>
+        <call-service service-name="createProductionRun" in-map-name="serviceCtx">
+            <result-to-field result-name="productionRunId"/>
+        </call-service>
+
+        <entity-and list="prodTasks" entity-name="WorkEffort">
+            <field-map field-name="workEffortParentId" from-field="productionRunId"/>
+        </entity-and>
+        <first-from-list entry="taskWorkEffort" list="prodTasks"/>
+        <set field="workEffortId" from-field="taskWorkEffort.workEffortId"/>
+        <clear-field field="serviceCtx"/>
         <set field="serviceCtx.workEffortId" from-field="workEffortId"/>
         <entity-one entity-name="UserLogin" value-field="serviceCtx.userLogin">
             <field-map field-name="userLoginId" value="system"/>
         </entity-one>
         <call-service service-name="issueProductionRunTask" in-map-name="serviceCtx"/>
+        <entity-condition entity-name="WorkEffortAndInventoryAssign" list="workEffortAndInventoryAssigns"/>
+        <iterate entry="workEffortAndInventoryAssign" list="workEffortAndInventoryAssigns"><log level="always" message="${workEffortAndInventoryAssign}"></log></iterate>
 
         <entity-condition entity-name="WorkEffortAndInventoryAssign" list="workEffortAndInventoryAssigns">
             <condition-list combine="and">
@@ -471,7 +491,7 @@
                 <else>
                     <if-compare field="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
                         <assert>
-                            <if-compare field="acctgTransEntry.productId" operator="equals" value="PROD_COST"/>
+                            <if-compare field="acctgTransEntry.productId" operator="equals" value="PROD_MANUF"/>
                             <if-compare field="acctgTransEntry.glAccountTypeId" operator="equals" value="WIP_INVENTORY"/>
                             <if-compare field="acctgTransEntry.glAccountId" operator="equals" value="142000"/>
                         </assert>

Modified: ofbiz/trunk/applications/accounting/testdef/accountingtests.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/testdef/accountingtests.xml?rev=881584&r1=881583&r2=881584&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/testdef/accountingtests.xml (original)
+++ ofbiz/trunk/applications/accounting/testdef/accountingtests.xml Tue Nov 17 22:38:20 2009
@@ -20,6 +20,12 @@
 <test-suite suite-name="accountingtests"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
+
+    <test-case case-name="accounting-tests-data-load">
+        <entity-xml action="load" entity-xml-url="component://accounting/testdef/data/AccountingTestsData.xml"/>
+    </test-case>
+
+
     <test-case case-name="accounting-tests"><junit-test-suite class-name="org.ofbiz.accounting.test.FinAccountTests"/></test-case>
 
     <!-- Test case for Accounting Transaction on Purchase -->

Added: ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml?rev=881584&view=auto
==============================================================================
--- ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml (added)
+++ ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml Tue Nov 17 22:38:20 2009
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+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
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<entity-engine-xml>
+    <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLLL01"
+        inventoryItemId="TEST_9000" inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="MAT_A_COST" ownerPartyId="Company" currencyUomId="USD" unitCost="36"/>
+    <InventoryItemDetail inventoryItemId="TEST_9000" inventoryItemDetailSeqId="0001" effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="4" quantityOnHandDiff="4"/>
+    <InventoryItem facilityId="WebStoreWarehouse" locationSeqId="TLTLTLLL01"
+        inventoryItemId="TEST_9001" inventoryItemTypeId="NON_SERIAL_INV_ITEM" productId="MAT_B_COST" ownerPartyId="Company" currencyUomId="USD" unitCost="42"/>
+    <InventoryItemDetail inventoryItemId="TEST_9001" inventoryItemDetailSeqId="0001" effectiveDate="2001-05-13 12:00:00.0" availableToPromiseDiff="6" quantityOnHandDiff="6"/>
+
+</entity-engine-xml>
\ No newline at end of file

Propchange: ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml