Author: deepak
Date: Sat Nov 5 13:37:02 2016 New Revision: 1768214 URL: http://svn.apache.org/viewvc?rev=1768214&view=rev Log: Improved: Added unit test case for following order related services - SetCustRequestStatus - GetRequirementsForSupplier - GetNextQuoteId - GetCustRequestsByRole - CreateRequirementRole - CreateRequirementFromItemATP - CreateCustRequestContent - CreateCustRequestAttribute - CreateAutoRequirementsForOrder - CreateATPRequirementsForOrder - CopyQuoteItem - CopyCustRequestItem (OFBIZ-8962)(OFBIZ-8961)(OFBIZ-8960)(OFBIZ-8959)(OFBIZ-8957)(OFBIZ-8956)(OFBIZ-8945)(OFBIZ-8944)(OFBIZ-8943)(OFBIZ-8942)(OFBIZ-8941)(OFBIZ-8940) Thanks Avnindra Sharma for your contribution. Modified: ofbiz/trunk/applications/order/minilang/test/CustRequestTests.xml ofbiz/trunk/applications/order/minilang/test/OrderTests.xml ofbiz/trunk/applications/order/minilang/test/QuoteTests.xml ofbiz/trunk/applications/order/testdef/OrderTest.xml ofbiz/trunk/applications/order/testdef/data/OrderTestData.xml Modified: ofbiz/trunk/applications/order/minilang/test/CustRequestTests.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/minilang/test/CustRequestTests.xml?rev=1768214&r1=1768213&r2=1768214&view=diff ============================================================================== --- ofbiz/trunk/applications/order/minilang/test/CustRequestTests.xml (original) +++ ofbiz/trunk/applications/order/minilang/test/CustRequestTests.xml Sat Nov 5 13:37:02 2016 @@ -81,9 +81,9 @@ under the License. </entity-one> <set-current-user-login value-field="userLogin"/> <set field="serviceCtx.custRequestId" value="9000"/> - <set field="serviceCtx.custRequestItemSeqId" value="00001"/ - <set field="serviceCtx.noteInfo" value="Test"/> - <call-service service-name="createCustRequestNote" in-map-name="serviceCtx"> + <set field="serviceCtx.custRequestItemSeqId" value="00001"/> + <set field="serviceCtx.note" value="Test"/> + <call-service service-name="createCustRequestItemNote" in-map-name="serviceCtx"> <results-to-map map-name="noteId"/> </call-service> <assert> @@ -139,5 +139,79 @@ under the License. </assert> <check-errors/> </simple-method> - + <simple-method method-name="testSetCustRequestStatus" short-description="Set Cust Request Status" login-required="false"> + <entity-one entity-name="UserLogin" value-field="userLogin"> + <field-map field-name="userLoginId" value="system"/> + </entity-one> + <set-current-user-login value-field="userLogin"/> + <set field="serviceCtx.custRequestId" value="9000"/> + <set field="serviceCtx.statusId" value="CRQ_ACCEPTED"/> + <call-service service-name="setCustRequestStatus" in-map-name="serviceCtx"> + <results-to-map map-name="oldStatusId"/> + </call-service> + <assert> + <not><if-empty field="oldStatusId"/></not> + </assert> + <check-errors/> + </simple-method> + <simple-method method-name="testGetCustRequestsByRole" short-description="Get Cust Requests By Role" login-required="false"> + <entity-one entity-name="UserLogin" value-field="userLogin"> + <field-map field-name="userLoginId" value="system"/> + </entity-one> + <set-current-user-login value-field="userLogin"/> + <set field="serviceCtx.roleTypeId" value="OWNER"/> + <call-service service-name="getCustRequestsByRole" in-map-name="serviceCtx"> + <results-to-map map-name="serviceResult"/> + </call-service> + <assert> + <not><if-empty field="serviceResult"/></not> + </assert> + <check-errors/> + </simple-method> + <simple-method method-name="testCreateCustRequestContent" short-description="Create Cust Request Content" login-required="false"> + <entity-one entity-name="UserLogin" value-field="userLogin"> + <field-map field-name="userLoginId" value="system"/> + </entity-one> + <set-current-user-login value-field="userLogin"/> + <set field="serviceCtx.custRequestId" value="9000"/> + <set field="serviceCtx.contentId" value="100-ALT"/> + <call-service service-name="createCustRequestContent" in-map-name="serviceCtx"> + <results-to-map map-name="custRequestStatusId"/> + </call-service> + <assert> + <not><if-empty field="custRequestStatusId"/></not> + </assert> + <check-errors/> + </simple-method> + <simple-method method-name="testCreateCustRequestAttribute" short-description="Create Cust Request Attribute" login-required="false"> + <entity-one entity-name="UserLogin" value-field="userLogin"> + <field-map field-name="userLoginId" value="system"/> + </entity-one> + <set-current-user-login value-field="userLogin"/> + <set field="serviceCtx.attrName" value="Test Name"/> + <set field="serviceCtx.attrValue" value="Test Value"/> + <set field="serviceCtx.custRequestId" value="9000"/> + <call-service service-name="createCustRequestAttribute" in-map-name="serviceCtx"> + <results-to-map map-name="serviceResult"/> + </call-service> + <assert> + <not><if-empty field="serviceResult"/></not> + </assert> + <check-errors/> + </simple-method> + <simple-method method-name="testCopyCustRequestItem" short-description="Copy Cust Request Item" login-required="false"> + <entity-one entity-name="UserLogin" value-field="userLogin"> + <field-map field-name="userLoginId" value="system"/> + </entity-one> + <set-current-user-login value-field="userLogin"/> + <set field="serviceCtx.custRequestId" value="9000"/> + <set field="serviceCtx.custRequestItemSeqId" value="00001"/> + <call-service service-name="copyCustRequestItem" in-map-name="serviceCtx"> + <results-to-map map-name="serviceResult"/> + </call-service> + <assert> + <not><if-empty field="serviceResult"/></not> + </assert> + <check-errors/> + </simple-method> </simple-methods> Modified: ofbiz/trunk/applications/order/minilang/test/OrderTests.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/minilang/test/OrderTests.xml?rev=1768214&r1=1768213&r2=1768214&view=diff ============================================================================== --- ofbiz/trunk/applications/order/minilang/test/OrderTests.xml (original) +++ ofbiz/trunk/applications/order/minilang/test/OrderTests.xml Sat Nov 5 13:37:02 2016 @@ -98,4 +98,78 @@ under the License. </assert> <check-errors/> </simple-method> + <simple-method method-name="testGetRequirementsForSupplier" short-description="Get Requirements For Supplier" login-required="false"> + <entity-one entity-name="UserLogin" value-field="userLogin"> + <field-map field-name="userLoginId" value="system"/> + </entity-one> + <set-current-user-login value-field="userLogin"/> + <set field="serviceCtx.partyId" value="Company"/> + <call-service service-name="getRequirementsForSupplier" in-map-name="serviceCtx"> + <results-to-map map-name="serviceResult"/> + </call-service> + <assert> + <not><if-empty field="serviceResult"/></not> + </assert> + <check-errors/> + </simple-method> + <simple-method method-name="testCreateRequirementRole" short-description="Create Requirement Role" login-required="false"> + <entity-one entity-name="UserLogin" value-field="userLogin"> + <field-map field-name="userLoginId" value="system"/> + </entity-one> + <set-current-user-login value-field="userLogin"/> + <set field="serviceCtx.requirementId" value="1000"/> + <set field="serviceCtx.roleTypeId" value="OWNER"/> + <set field="serviceCtx.partyId" value="Company"/> + <call-service service-name="createRequirementRole" in-map-name="serviceCtx"> + <results-to-map map-name="serviceResult"/> + </call-service> + <assert> + <not><if-empty field="serviceResult"/></not> + </assert> + <check-errors/> + </simple-method> + <simple-method method-name="testCreateRequirementFromItemATP" short-description="Create Requirement From Item ATP" login-required="false"> + <entity-one entity-name="UserLogin" value-field="userLogin"> + <field-map field-name="userLoginId" value="system"/> + </entity-one> + <set-current-user-login value-field="userLogin"/> + <set field="serviceCtx.orderId" value="TEST_DEMO10090"/> + <set field="serviceCtx.orderItemSeqId" value="00001"/> + <set field="serviceCtx.shipGroupSeqId" value="00001"/> + <call-service service-name="createRequirementFromItemATP" in-map-name="serviceCtx"> + <results-to-map map-name="serviceResult"/> + </call-service> + <assert> + <not><if-empty field="serviceResult"/></not> + </assert> + <check-errors/> + </simple-method> + <simple-method method-name="testCreateAutoRequirementsForOrder" short-description="Create AutoRequirements For Order" login-required="false"> + <entity-one entity-name="UserLogin" value-field="userLogin"> + <field-map field-name="userLoginId" value="system"/> + </entity-one> + <set-current-user-login value-field="userLogin"/> + <set field="serviceCtx.orderId" value="TEST_DEMO10090"/> + <call-service service-name="createAutoRequirementsForOrder" in-map-name="serviceCtx"> + <results-to-map map-name="serviceResult"/> + </call-service> + <assert> + <not><if-empty field="serviceResult"/></not> + </assert> + <check-errors/> + </simple-method> + <simple-method method-name="testCreateATPRequirementsForOrder" short-description="Create ATP Requirements For Order" login-required="false"> + <entity-one entity-name="UserLogin" value-field="userLogin"> + <field-map field-name="userLoginId" value="system"/> + </entity-one> + <set-current-user-login value-field="userLogin"/> + <set field="serviceCtx.orderId" value="TEST_DEMO10090"/> + <call-service service-name="createATPRequirementsForOrder" in-map-name="serviceCtx"> + <results-to-map map-name="serviceResult"/> + </call-service> + <assert> + <not><if-empty field="serviceResult"/></not> + </assert> + <check-errors/> + </simple-method> </simple-methods> \ No newline at end of file Modified: ofbiz/trunk/applications/order/minilang/test/QuoteTests.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/minilang/test/QuoteTests.xml?rev=1768214&r1=1768213&r2=1768214&view=diff ============================================================================== --- ofbiz/trunk/applications/order/minilang/test/QuoteTests.xml (original) +++ ofbiz/trunk/applications/order/minilang/test/QuoteTests.xml Sat Nov 5 13:37:02 2016 @@ -272,4 +272,33 @@ under the License. </assert> <check-errors/> </simple-method> + <simple-method method-name="testGetNextQuoteId" short-description="Get Next Quote Id" login-required="false"> + <entity-one entity-name="UserLogin" value-field="userLogin"> + <field-map field-name="userLoginId" value="system"/> + </entity-one> + <set-current-user-login value-field="userLogin"/> + <set field="serviceCtx.partyId" value="DemoCustomer-1"/> + <call-service service-name="getNextQuoteId" in-map-name="serviceCtx"> + <results-to-map map-name="quoteId"/> + </call-service> + <assert> + <not><if-empty field="quoteId"/></not> + </assert> + <check-errors/> + </simple-method> + <simple-method method-name="testCopyQuoteItem" short-description="Copy Quote Item" login-required="false"> + <entity-one entity-name="UserLogin" value-field="userLogin"> + <field-map field-name="userLoginId" value="system"/> + </entity-one> + <set-current-user-login value-field="userLogin"/> + <set field="serviceCtx.quoteId" value="CQ0001"/> + <set field="serviceCtx.quoteItemSeqId" value="00001"/> + <call-service service-name="copyQuoteItem" in-map-name="serviceCtx"> + <results-to-map map-name="serviceResult"/> + </call-service> + <assert> + <not><if-empty field="serviceResult"/></not> + </assert> + <check-errors/> + </simple-method> </simple-methods> Modified: ofbiz/trunk/applications/order/testdef/OrderTest.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/testdef/OrderTest.xml?rev=1768214&r1=1768213&r2=1768214&view=diff ============================================================================== --- ofbiz/trunk/applications/order/testdef/OrderTest.xml (original) +++ ofbiz/trunk/applications/order/testdef/OrderTest.xml Sat Nov 5 13:37:02 2016 @@ -33,7 +33,4 @@ under the License. <test-case case-name="order-test"> <simple-method-test location="component://order/minilang/test/OrderTests.xml"/> </test-case> - <test-case case-name="custRequest-Test"> - <simple-method-test location="component://order/minilang/test/CustRequestTests.xml"/> - </test-case> </test-suite> Modified: ofbiz/trunk/applications/order/testdef/data/OrderTestData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/testdef/data/OrderTestData.xml?rev=1768214&r1=1768213&r2=1768214&view=diff ============================================================================== --- ofbiz/trunk/applications/order/testdef/data/OrderTestData.xml (original) +++ ofbiz/trunk/applications/order/testdef/data/OrderTestData.xml Sat Nov 5 13:37:02 2016 @@ -53,4 +53,6 @@ under the License. <OrderRole orderId="TEST_DEMO10090" partyId="TestDemoCustomer" roleTypeId="PLACING_CUSTOMER"/> <OrderRole orderId="TEST_DEMO10090" partyId="TestDemoCustomer" roleTypeId="SHIP_TO_CUSTOMER"/> <OrderContactMech orderId="TEST_DEMO10090" contactMechPurposeTypeId="ORDER_EMAIL" contactMechId="TestContactMech"/> + <Requirement requirementId="1000" requirementTypeId="CUSTOMER_REQUIREMENT"/> + </entity-engine-xml> |
Free forum by Nabble | Edit this page |