Author: mrisaliti
Date: Fri Mar 28 13:40:44 2008
New Revision: 642370
URL:
http://svn.apache.org/viewvc?rev=642370&view=revLog:
A patch from Shubham Goyal "JUnit Test Case for Physical Inventory Adjustment" (OFBIZ-1466)
Modified:
ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml
ofbiz/trunk/applications/product/testdef/FacilityTest.xml
Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml?rev=642370&r1=642369&r2=642370&view=diff==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml Fri Mar 28 13:40:44 2008
@@ -1219,4 +1219,25 @@
<entity-one entity-name="InventoryItemLabelAppl" value-name="lookedUpValue"/>
<remove-value value-name="lookedUpValue"/>
</simple-method>
+
+ <!-- Test Physical Inventory Adjustment -->
+ <simple-method method-name="testPhysicalInventoryAdjustment" short-description="Test to create physical inventory and variance" login-required="false">
+ <log level="info" message="====================Create physical inventory and variance test case================================"/>
+ <set field="createPhysicalInventoryAndVarianceMap.inventoryItemId" value="9024"/>
+ <set field="createPhysicalInventoryAndVarianceMap.varianceReasonId" value="VAR_LOST"/>
+ <entity-one entity-name="UserLogin" value-name="createPhysicalInventoryAndVarianceMap.userLogin">
+ <field-map field-name="userLoginId" value="system"/>
+ </entity-one>
+ <call-service service-name="createPhysicalInventoryAndVariance" in-map-name="createPhysicalInventoryAndVarianceMap">
+ <result-to-field result-name="physicalInventoryId" field-name="physicalInventoryId"/>
+ </call-service>
+ <assert>
+ <not>
+ <if-empty field-name="physicalInventoryId">
+ <log level="info" message="========physicalInventoryId ${physicalInventoryId} found null============================"/>
+ </if-empty>
+ </not>
+ </assert>
+ <check-errors/>
+ </simple-method>
</simple-methods>
Modified: ofbiz/trunk/applications/product/testdef/FacilityTest.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/testdef/FacilityTest.xml?rev=642370&r1=642369&r2=642370&view=diff==============================================================================
--- ofbiz/trunk/applications/product/testdef/FacilityTest.xml (original)
+++ ofbiz/trunk/applications/product/testdef/FacilityTest.xml Fri Mar 28 13:40:44 2008
@@ -27,4 +27,8 @@
<test-case case-name="inventoryItemTransfer-test">
<junit-test-suite class-name="org.ofbiz.product.test.InventoryItemTransferTest"/>
</test-case>
+ <!-- Physical Inventory Adjustment test -->
+ <test-case case-name="physicalInventoryAdjustment-test">
+ <simple-method-test location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" name="testPhysicalInventoryAdjustment"/>
+ </test-case>
</test-suite>