Author: mor
Date: Sat Apr 26 05:07:41 2008 New Revision: 651818 URL: http://svn.apache.org/viewvc?rev=651818&view=rev Log: Applied patch for testing packing process from Jira OFBIZ-1680 (https://issues.apache.org/jira/browse/OFBIZ-1680), Thanks Ratnesh Upadhyay for providing the patch and also thanks to Mridul Pathak and Alok Agnihotri for their help in review Added: ofbiz/trunk/applications/ecommerce/data/DemoOrderTestData.xml (with props) ofbiz/trunk/applications/product/script/org/ofbiz/shipment/test/ ofbiz/trunk/applications/product/script/org/ofbiz/shipment/test/TestServices.xml (with props) Modified: ofbiz/trunk/applications/ecommerce/ofbiz-component.xml ofbiz/trunk/applications/product/testdef/FacilityTest.xml Added: ofbiz/trunk/applications/ecommerce/data/DemoOrderTestData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/data/DemoOrderTestData.xml?rev=651818&view=auto ============================================================================== --- ofbiz/trunk/applications/ecommerce/data/DemoOrderTestData.xml (added) +++ ofbiz/trunk/applications/ecommerce/data/DemoOrderTestData.xml Sat Apr 26 05:07:41 2008 @@ -0,0 +1,59 @@ +<?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> + <!--Demo data for a sales order --> + <OrderHeader orderId="DEMO10090" orderTypeId="SALES_ORDER" orderName="" salesChannelEnumId="WEB_SALES_CHANNEL" orderDate="2008-04-23 16:49:27.392" entryDate="2008-04-23 16:49:27.392" visitId="10002" statusId="ORDER_APPROVED" createdBy="admin" currencyUom="USD" webSiteId="OrderEntry" productStoreId="9000" remainingSubTotal="12.45" grandTotal="12.45" lastUpdatedStamp="2008-04-23 16:49:33.196" lastUpdatedTxStamp="2008-04-23 16:49:33.118" createdStamp="2008-04-23 16:49:27.716" createdTxStamp="2008-04-23 16:49:27.349"/> + <OrderItem orderId="DEMO10090" orderItemSeqId="00001" orderItemTypeId="PRODUCT_ORDER_ITEM" productId="GZ-2644" prodCatalogId="DemoCatalog" isPromo="N" quantity="1.0" selectedAmount="0.0" unitPrice="38.4" unitListPrice="48.0" isModifiedPrice="N" itemDescription="Round Gizmo" correspondingPoId="" statusId="ITEM_APPROVED" lastUpdatedStamp="2008-04-23 16:49:33.514" lastUpdatedTxStamp="2008-04-23 16:49:33.484" createdStamp="2008-04-23 16:49:28.128" createdTxStamp="2008-04-23 16:49:27.349"/> + <OrderItemPriceInfo orderItemPriceInfoId="9000" orderId="DEMO10090" orderItemSeqId="00001" productPriceRuleId="9000" productPriceActionSeqId="01" modifyAmount="-9.600000000000001" description="[PRODUCT_CATEGORY_IDIsPROMOTIONS] [list:48.0;avgCost:48.0;margin:0.0] [type:PRICE_POL]" lastUpdatedStamp="2008-04-23 16:49:28.682" lastUpdatedTxStamp="2008-04-23 16:49:27.349" createdStamp="2008-04-23 16:49:28.682" createdTxStamp="2008-04-23 16:49:27.349"/> + + <PartyRole partyId="DemoCustomer" roleTypeId="END_USER_CUSTOMER"/> + <PartyRole partyId="DemoCustomer" roleTypeId="SHIP_TO_CUSTOMER"/> + <PartyRole partyId="DemoCustomer" roleTypeId="PLACING_CUSTOMER"/> + + <OrderRole orderId="DEMO10090" partyId="Company" roleTypeId="BILL_FROM_VENDOR" lastUpdatedStamp="2008-04-23 16:49:28.808" lastUpdatedTxStamp="2008-04-23 16:49:27.349" createdStamp="2008-04-23 16:49:28.808" createdTxStamp="2008-04-23 16:49:27.349"/> + <OrderRole orderId="DEMO10090" partyId="DemoCustomer" roleTypeId="BILL_TO_CUSTOMER" lastUpdatedStamp="2008-04-23 16:49:28.807" lastUpdatedTxStamp="2008-04-23 16:49:27.349" createdStamp="2008-04-23 16:49:28.807" createdTxStamp="2008-04-23 16:49:27.349"/> + <OrderRole orderId="DEMO10090" partyId="DemoCustomer" roleTypeId="END_USER_CUSTOMER" lastUpdatedStamp="2008-04-23 16:49:28.816" lastUpdatedTxStamp="2008-04-23 16:49:27.349" createdStamp="2008-04-23 16:49:28.816" createdTxStamp="2008-04-23 16:49:27.349"/> + <OrderRole orderId="DEMO10090" partyId="DemoCustomer" roleTypeId="PLACING_CUSTOMER" lastUpdatedStamp="2008-04-23 16:49:28.799" lastUpdatedTxStamp="2008-04-23 16:49:27.349" createdStamp="2008-04-23 16:49:28.799" createdTxStamp="2008-04-23 16:49:27.349"/> + <OrderRole orderId="DEMO10090" partyId="DemoCustomer" roleTypeId="SHIP_TO_CUSTOMER" lastUpdatedStamp="2008-04-23 16:49:28.812" lastUpdatedTxStamp="2008-04-23 16:49:27.349" createdStamp="2008-04-23 16:49:28.812" createdTxStamp="2008-04-23 16:49:27.349"/> + + <OrderItemShipGroup orderId="DEMO10090" shipGroupSeqId="00001" shipmentMethodTypeId="NEXT_DAY" carrierPartyId="UPS" carrierRoleTypeId="CARRIER" contactMechId="9015" maySplit="N" giftMessage="" isGift="N" lastUpdatedStamp="2008-04-23 16:49:28.412" lastUpdatedTxStamp="2008-04-23 16:49:27.349" createdStamp="2008-04-23 16:49:28.412" createdTxStamp="2008-04-23 16:49:27.349"/> + <OrderItemShipGroupAssoc orderId="DEMO10090" orderItemSeqId="00001" shipGroupSeqId="00001" quantity="1.0" lastUpdatedStamp="2008-04-23 16:49:28.454" lastUpdatedTxStamp="2008-04-23 16:49:27.349" createdStamp="2008-04-23 16:49:28.454" createdTxStamp="2008-04-23 16:49:27.349"/> + <OrderItemShipGrpInvRes orderId="DEMO10090" shipGroupSeqId="00001" orderItemSeqId="00001" inventoryItemId="9001" reserveOrderEnumId="INVRO_FIFO_REC" quantity="1.0" quantityNotAvailable="0.0" reservedDatetime="2008-04-23 16:49:31.474" createdDatetime="2008-04-23 16:49:31.474" promisedDatetime="2008-05-08 16:49:27.392" lastUpdatedStamp="2008-04-23 16:49:31.474" lastUpdatedTxStamp="2008-04-23 16:49:27.349" createdStamp="2008-04-23 16:49:31.474" createdTxStamp="2008-04-23 16:49:27.349"/> + + <OrderAdjustment orderAdjustmentId="9000" orderAdjustmentTypeId="PROMOTION_ADJUSTMENT" orderId="DEMO10090" orderItemSeqId="00001" shipGroupSeqId="_NA_" amount="-38.4" productPromoId="9016" productPromoRuleId="01" productPromoActionSeqId="01" createdDate="2008-04-23 16:49:27.866" createdByUserLogin="admin" lastUpdatedStamp="2008-04-23 16:49:28.271" lastUpdatedTxStamp="2008-04-23 16:49:27.349" createdStamp="2008-04-23 16:49:28.271" createdTxStamp="2008-04-23 16:49:27.349"/> + <OrderAdjustment orderAdjustmentId="9001" orderAdjustmentTypeId="SHIPPING_CHARGES" orderId="DEMO10090" orderItemSeqId="_NA_" shipGroupSeqId="00001" amount="12.45" createdDate="2008-04-23 16:49:27.866" createdByUserLogin="admin" lastUpdatedStamp="2008-04-23 16:49:28.431" lastUpdatedTxStamp="2008-04-23 16:49:27.349" createdStamp="2008-04-23 16:49:28.431" createdTxStamp="2008-04-23 16:49:27.349"/> + + <OrderPaymentPreference orderPaymentPreferenceId="9000" orderId="DEMO10090" paymentMethodTypeId="CREDIT_CARD" paymentMethodId="9015" presentFlag="N" swipedFlag="N" overflowFlag="N" maxAmount="12.45" processAttempt="1" statusId="PAYMENT_AUTHORIZED" needsNsfRetry="N" createdDate="2008-04-23 16:49:27.966" createdByUserLogin="admin" lastUpdatedStamp="2008-04-23 16:49:33.08" lastUpdatedTxStamp="2008-04-23 16:49:32.415" createdStamp="2008-04-23 16:49:28.844" createdTxStamp="2008-04-23 16:49:27.349"/> + + <OrderStatus orderStatusId="9000" statusId="ORDER_CREATED" orderId="DEMO10090" statusDatetime="2008-04-23 16:49:27.392" statusUserLogin="admin" lastUpdatedStamp="2008-04-23 16:49:28.025" lastUpdatedTxStamp="2008-04-23 16:49:27.349" createdStamp="2008-04-23 16:49:28.025" createdTxStamp="2008-04-23 16:49:27.349"/> + <OrderStatus orderStatusId="9001" statusId="ITEM_CREATED" orderId="DEMO10090" orderItemSeqId="00001" statusDatetime="2008-04-23 16:49:27.392" statusUserLogin="admin" lastUpdatedStamp="2008-04-23 16:49:28.203" lastUpdatedTxStamp="2008-04-23 16:49:27.349" createdStamp="2008-04-23 16:49:28.203" createdTxStamp="2008-04-23 16:49:27.349"/> + <OrderStatus orderStatusId="9002" statusId="PAYMENT_NOT_AUTH" orderId="DEMO10090" orderPaymentPreferenceId="9000" statusDatetime="2008-04-23 16:49:29.008" statusUserLogin="admin" lastUpdatedStamp="2008-04-23 16:49:29.008" lastUpdatedTxStamp="2008-04-23 16:49:27.349" createdStamp="2008-04-23 16:49:29.008" createdTxStamp="2008-04-23 16:49:27.349"/> + <OrderStatus orderStatusId="9003" statusId="PAYMENT_NOT_AUTH" orderId="DEMO10090" orderPaymentPreferenceId="9000" statusDatetime="2008-04-23 16:49:32.498" statusUserLogin="admin" lastUpdatedStamp="2008-04-23 16:49:32.498" lastUpdatedTxStamp="2008-04-23 16:49:32.415" createdStamp="2008-04-23 16:49:32.498" createdTxStamp="2008-04-23 16:49:32.415"/> + <OrderStatus orderStatusId="9004" statusId="PAYMENT_AUTHORIZED" orderId="DEMO10090" orderPaymentPreferenceId="9000" statusDatetime="2008-04-23 16:49:33.094" statusUserLogin="admin" lastUpdatedStamp="2008-04-23 16:49:33.094" lastUpdatedTxStamp="2008-04-23 16:49:32.415" createdStamp="2008-04-23 16:49:33.094" createdTxStamp="2008-04-23 16:49:32.415"/> + <OrderStatus orderStatusId="9005" statusId="ORDER_APPROVED" orderId="DEMO10090" statusDatetime="2008-04-23 16:49:33.196" statusUserLogin="admin" lastUpdatedStamp="2008-04-23 16:49:33.199" lastUpdatedTxStamp="2008-04-23 16:49:33.118" createdStamp="2008-04-23 16:49:33.199" createdTxStamp="2008-04-23 16:49:33.118"/> + <OrderStatus orderStatusId="9006" statusId="ITEM_APPROVED" orderId="DEMO10090" orderItemSeqId="00001" statusDatetime="2008-04-23 16:49:33.513" statusUserLogin="admin" lastUpdatedStamp="2008-04-23 16:49:33.525" lastUpdatedTxStamp="2008-04-23 16:49:33.484" createdStamp="2008-04-23 16:49:33.525" createdTxStamp="2008-04-23 16:49:33.484"/> + + <OrderContactMech orderId="DEMO10090" contactMechPurposeTypeId="BILLING_LOCATION" contactMechId="9015" lastUpdatedStamp="2008-04-23 16:49:28.817" lastUpdatedTxStamp="2008-04-23 16:49:27.349" createdStamp="2008-04-23 16:49:28.817" createdTxStamp="2008-04-23 16:49:27.349"/> + <OrderContactMech orderId="DEMO10090" contactMechPurposeTypeId="ORDER_EMAIL" contactMechId="9023" lastUpdatedStamp="2008-04-23 16:49:32.181" lastUpdatedTxStamp="2008-04-23 16:49:32.164" createdStamp="2008-04-23 16:49:32.181" createdTxStamp="2008-04-23 16:49:32.164"/> + <OrderContactMech orderId="DEMO10090" contactMechPurposeTypeId="ORDER_EMAIL" contactMechId="9026" lastUpdatedStamp="2008-04-23 16:49:32.173" lastUpdatedTxStamp="2008-04-23 16:49:32.164" createdStamp="2008-04-23 16:49:32.173" createdTxStamp="2008-04-23 16:49:32.164"/> + <OrderContactMech orderId="DEMO10090" contactMechPurposeTypeId="SHIPPING_LOCATION" contactMechId="9015" lastUpdatedStamp="2008-04-23 16:49:28.332" lastUpdatedTxStamp="2008-04-23 16:49:27.349" createdStamp="2008-04-23 16:49:28.332" createdTxStamp="2008-04-23 16:49:27.349"/> + +</entity-engine-xml> \ No newline at end of file Propchange: ofbiz/trunk/applications/ecommerce/data/DemoOrderTestData.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/ecommerce/data/DemoOrderTestData.xml ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/applications/ecommerce/data/DemoOrderTestData.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Modified: ofbiz/trunk/applications/ecommerce/ofbiz-component.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/ofbiz-component.xml?rev=651818&r1=651817&r2=651818&view=diff ============================================================================== --- ofbiz/trunk/applications/ecommerce/ofbiz-component.xml (original) +++ ofbiz/trunk/applications/ecommerce/ofbiz-component.xml Sat Apr 26 05:07:41 2008 @@ -41,6 +41,7 @@ <entity-resource type="data" reader-name="demo" loader="main" location="data/DemoRentalProduct.xml"/> <entity-resource type="data" reader-name="demo" loader="main" location="data/DemoTaxAuthority.xml"/> <entity-resource type="data" reader-name="demo" loader="main" location="data/DemoOrderPeopleData.xml"/> + <entity-resource type="data" reader-name="demo" loader="main" location="data/DemoOrderTestData.xml"/> <entity-resource type="data" reader-name="demo" loader="main" location="data/DemoMarketing.xml"/> <entity-resource type="data" reader-name="demo" loader="main" location="data/DemoPurchasing.xml"/> <entity-resource type="data" reader-name="demo" loader="main" location="data/DemoStandardCosting.xml"/> Added: ofbiz/trunk/applications/product/script/org/ofbiz/shipment/test/TestServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/test/TestServices.xml?rev=651818&view=auto ============================================================================== --- ofbiz/trunk/applications/product/script/org/ofbiz/shipment/test/TestServices.xml (added) +++ ofbiz/trunk/applications/product/script/org/ofbiz/shipment/test/TestServices.xml Sat Apr 26 05:07:41 2008 @@ -0,0 +1,108 @@ +<?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. +--> + +<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd"> + <simple-method method-name="testPackingServices" short-description="test packing services" login-required="false"> + + <set field="packSingleItemInMap.productId" value="GZ-2644"/> + <set field="packSingleItemInMap.orderId" value="DEMO10090"/> + <set field="packSingleItemInMap.shipGroupSeqId" value="00001"/> + <set field="packSingleItemInMap.quantity" value="1" type="Double"/> + <set field="packSingleItemInMap.packageSeq" value="1" type="Integer"/> + <set field="packSingleItemInMap.pickerPartyId" value="DemoCustomer"/> + <set field="packSingleItemInMap.handlingInstructions" value="Handle with care"/> + <entity-one entity-name="UserLogin" value-name="userLogin" auto-field-map="false"> + <field-map field-name="userLoginId" value="system"/> + </entity-one> + <set field="packSingleItemInMap.userLogin" from-field="userLogin"/> + <create-object class-name="org.ofbiz.shipment.packing.PackingSession" field-name="packingSession"> + <field field-name="dispatcher" type="org.ofbiz.service.LocalDispatcher"/> + <field field-name="userLogin" type="org.ofbiz.entity.GenericValue"/> + </create-object> + <set field="packSingleItemInMap.packingSession" from-field="packingSession"/> + <call-service service-name="packSingleItem" in-map-name="packSingleItemInMap"> + <results-to-map map-name="packSingleItemOutMap"/> + </call-service> + + <log level="info" message="=====packSingleItemOutMap========${packSingleItemOutMap}========="/> + + <set field="packBulkItemInMap.updateQuantity" value="Y" type="Boolean"/> + <set field="packBulkItemInMap.orderId" value="DEMO10090"/> + <set field="packBulkItemInMap.shipGroupSeqId" value="00001"/> + <set field="packBulkItemInMap.pickerPartyId" value="DemoCustomer"/> + <set field="packBulkItemInMap.handlingInstructions" value="Handle with care"/> + <set field="packBulkItemInMap.nextPackageSeq" value="1" type="Integer"/> + <set field="packBulkItemInMap.userLogin" from-field="userLogin"/> + <set field="packBulkItemInMap.packingSession" from-field="packingSession"/> + + <call-service service-name="packBulkItems" in-map-name="packBulkItemInMap"> + <results-to-map map-name="packBulkItemsResponseMap"/> + </call-service> + + <log level="info" message="=====packBulkItemsResponseMap=======${packBulkItemsResponseMap}======"/> + + <set field="completePackInMap.packingSession" from-field="packingSession"/> + <set field="completePackInMap.handlingInstructions" value="Handle with care"/> + <set field="completePackInMap.pickerPartyId" value="DemoCustomer"/> + <set field="completePackInMap.additionalShippingCharge" value="10.0" type="Double"/> + <set field="completePackInMap.forceComplete" value="Y" type="Boolean"/> + <set field="completePackInMap.userLogin" from-field="userLogin"/> + + <call-service service-name="completePack" in-map-name="completePackInMap"> + <results-to-map map-name="completePackOutMap"/> + </call-service> + + <log level="info" message="=======ShipmentId=======${completePackOutMap.shipmentId}===="/> + + <entity-one entity-name="Shipment" value-name="shipment"> + <field-map field-name="shipmentId" env-name="completePackOutMap.shipmentId"/> + </entity-one> + + <assert> + <not><if-empty field-name="shipment"/></not> + <if-compare-field field-name="shipment.shipmentId" operator="equals" to-field-name="completePackOutMap.shipmentId"/> + </assert> + <check-errors/> + + <set field="createInvFrmShipmentInMap.shipmentId" value="${completePackOutMap.shipmentId}"/> + <set field="createInvFrmShipmentInMap.userLogin" from-field="userLogin"/> + <call-service service-name="createInvoicesFromShipment" in-map-name="createInvFrmShipmentInMap"> + <results-to-map map-name="createInvFrmShipmentOutMap"/> + </call-service> + + <log level="info" message="=============createInvFrmShipmentOutMap===========${createInvFrmShipmentOutMap}====="/> + + <set field="invoicesCreated" from-field="createInvFrmShipmentOutMap.invoicesCreated"/> + <iterate list-name="invoicesCreated" entry-name="invoiceCreated"> + <entity-one entity-name="Invoice" value-name="invoice"> + <field-map field-name="invoiceId" env-name="invoiceCreated"/> + </entity-one> + + <assert> + <not><if-empty field-name="invoice"/></not> + </assert> + <check-errors/> + </iterate> + + <log level="info" message="=============Test case completed===================================="/> + + </simple-method> +</simple-methods> \ No newline at end of file Propchange: ofbiz/trunk/applications/product/script/org/ofbiz/shipment/test/TestServices.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/product/script/org/ofbiz/shipment/test/TestServices.xml ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/applications/product/script/org/ofbiz/shipment/test/TestServices.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Modified: ofbiz/trunk/applications/product/testdef/FacilityTest.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/testdef/FacilityTest.xml?rev=651818&r1=651817&r2=651818&view=diff ============================================================================== --- ofbiz/trunk/applications/product/testdef/FacilityTest.xml (original) +++ ofbiz/trunk/applications/product/testdef/FacilityTest.xml Sat Apr 26 05:07:41 2008 @@ -31,4 +31,9 @@ <test-case case-name="physicalInventoryAdjustment-test"> <simple-method-test location="component://product/script/org/ofbiz/product/inventory/InventoryServices.xml" name="testPhysicalInventoryAdjustment"/> </test-case> + + <!-- Packing process test --> + <test-case case-name="testPackingServices-test"> + <simple-method-test location="component://product/script/org/ofbiz/shipment/test/TestServices.xml" name="testPackingServices"/> + </test-case> </test-suite> |
Free forum by Nabble | Edit this page |