svn commit: r1768206 - in /ofbiz/trunk/applications/order: minilang/test/CustRequestTests.xml minilang/test/OrderTests.xml minilang/test/QuoteTests.xml testdef/OrderTest.xml

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

svn commit: r1768206 - in /ofbiz/trunk/applications/order: minilang/test/CustRequestTests.xml minilang/test/OrderTests.xml minilang/test/QuoteTests.xml testdef/OrderTest.xml

Deepak Dixit-5
Author: deepak
Date: Sat Nov  5 12:18:05 2016
New Revision: 1768206

URL: http://svn.apache.org/viewvc?rev=1768206&view=rev
Log:
Improved: Added unit test case for following order related services
- CreateCustRequestItem
- CreateCustRequestItemNote
- CreateCustRequestNote
- CreateCustRequestParty
- CreateCustRequestStatus
- CreateOrderDeliverySchedule
- CreateOrderItemChange
- CreateOrderPaymentApplication
- CreateQuote
- CreateQuoteAttribute
- CreateQuoteCoefficient
- CreateQuoteRole
- CreateRequirement

 (OFBIZ-8947)(OFBIZ-8946)(OFBIZ-8948)(OFBIZ-8949)(OFBIZ-8950)(OFBIZ-8854)(OFBIZ-8855)(OFBIZ-8856)(OFBIZ-8951)(OFBIZ-8952)(OFBIZ-8963)(OFBIZ-8954)(OFBIZ-8955)

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

Modified: ofbiz/trunk/applications/order/minilang/test/CustRequestTests.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/minilang/test/CustRequestTests.xml?rev=1768206&r1=1768205&r2=1768206&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/minilang/test/CustRequestTests.xml (original)
+++ ofbiz/trunk/applications/order/minilang/test/CustRequestTests.xml Sat Nov  5 12:18:05 2016
@@ -61,5 +61,83 @@ under the License.
         <call-service service-name="updateCustRequest" in-map-name="updateRequestMap"/>
         <check-errors/>
     </simple-method>
+    <simple-method method-name="testCreateCustRequestItem" short-description="Create 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"/>
+        <call-service service-name="createCustRequestItem" in-map-name="serviceCtx">
+            <results-to-map map-name="custRequestId"/>
+        </call-service>
+        <assert>
+            <not><if-empty field="custRequestId"/></not>
+        </assert>
+        <check-errors/>
+    </simple-method>
+    <simple-method method-name="testCreateCustRequestItemNote" short-description="Create Cust Request Item Note" 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"/
+        <set field="serviceCtx.noteInfo" value="Test"/>
+        <call-service service-name="createCustRequestNote" in-map-name="serviceCtx">
+            <results-to-map map-name="noteId"/>
+        </call-service>
+        <assert>
+            <not><if-empty field="noteId"/></not>
+        </assert>
+        <check-errors/>
+    </simple-method>
+    <simple-method method-name="testCreateCustRequestNote" short-description="Create Cust Request Note" 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.noteInfo" value="Test"/>
+        <call-service service-name="createCustRequestNote" in-map-name="serviceCtx">
+            <results-to-map map-name="serviceResult"/>
+        </call-service>
+        <assert>
+            <not><if-empty field="serviceResult"/></not>
+            <if-compare operator="equals" field="serviceResult.fromPartyId" value="DemoCustomer"/>
+        </assert>
+        <check-errors/>
+    </simple-method>
+    <simple-method method-name="testCreateCustRequestParty" short-description="Create Cust Request Party" 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.partyId" value="Company"/>
+        <set field="serviceCtx.roleTypeId" value="OWNER"/>
+        <call-service service-name="createCustRequestParty" 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="testCreateCustRequestStatus" short-description="Create 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.custRequestItemSeqId" value="00001"/>
+        <set field="serviceCtx.statusId" value="CRQ_ACCEPTED"/>
+        <call-service service-name="createCustRequestStatus" 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-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=1768206&r1=1768205&r2=1768206&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/minilang/test/OrderTests.xml (original)
+++ ofbiz/trunk/applications/order/minilang/test/OrderTests.xml Sat Nov  5 12:18:05 2016
@@ -39,4 +39,63 @@ under the License.
         </assert>
         <check-errors/>
     </simple-method>
+    <simple-method method-name="testCreateOrderDeliverySchedule" short-description="Create Order Delivery Schedule" 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="createOrderDeliverySchedule" 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="testCreateOrderItemChange" short-description="create Order Item Change" 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.changeTypeEnumId" value="ODR_ITM_APPEND"/>
+        <set field="serviceCtx.orderId" value="TEST_DEMO10090"/>
+        <set field="serviceCtx.orderItemSeqId" value="00001"/>
+        <call-service service-name="createOrderItemChange" in-map-name="serviceCtx">
+            <results-to-map map-name="orderItemChangeId"/>
+        </call-service>
+        <assert>
+            <not><if-empty field="orderItemChangeId"/></not>
+        </assert>
+        <check-errors/>
+    </simple-method>
+    <simple-method method-name="testCreateOrderPaymentApplication" short-description="create Order Payment Application" 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.paymentId" value="1014"/>
+        <call-service service-name="createOrderPaymentApplication" 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="testCreateRequirement" short-description="Create Requirement" 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.requirementTypeId" value="CUSTOMER_REQUIREMENT"/>
+        <call-service service-name="createRequirement" 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=1768206&r1=1768205&r2=1768206&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/minilang/test/QuoteTests.xml (original)
+++ ofbiz/trunk/applications/order/minilang/test/QuoteTests.xml Sat Nov  5 12:18:05 2016
@@ -61,7 +61,7 @@ under the License.
         <set field="serviceCtx.quoteId" value="9000"/>
         <set field="serviceCtx.workEffortId" value="9007"/>
 
-        <!-- Execute the service, note break-on-error is false so that the test itself doesn't
+        <!-- Execute the service, note break-on-error is false so that the test itself doesn't
              fail and we also need a separate transaction so our lookup below doesn't fail due to the rollback -->
         <call-service service-name="createQuoteWorkEffort" in-map-name="serviceCtx"
             break-on-error="false" require-new-transaction="true">
@@ -212,4 +212,64 @@ under the License.
         </assert>
         <check-errors/>
     </simple-method>
+    <simple-method method-name="testCreateQuote" short-description="Create Quote" 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="createQuote" 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="testCreateQuoteAttribute" short-description="Create Quote 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.quoteId" value="CQ0001"/>
+        <set field="serviceCtx.attrName" value="Test"/>
+        <call-service service-name="createQuoteAttribute" 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="testCreateQuoteRole" short-description="Create Quote 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.partyId" value="DemoCustomer-1"/>
+        <set field="serviceCtx.quoteId" value="CQ0001"/>
+        <set field="serviceCtx.roleTypeId" value="OWNER"/>
+        <call-service service-name="createQuoteRole" 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="testCreateQuoteCoefficient" short-description="Create Quote Coefficient" 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.coeffName" value="Test"/>
+        <call-service service-name="createQuoteCoefficient" 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=1768206&r1=1768205&r2=1768206&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/testdef/OrderTest.xml (original)
+++ ofbiz/trunk/applications/order/testdef/OrderTest.xml Sat Nov  5 12:18:05 2016
@@ -33,4 +33,7 @@ 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>