[ofbiz-framework] branch trunk updated: Fixed: testIntegrations caused due to invalid cust request status 'CRQ_SUBMITTED', so loaded QuoteTestData.xml with proper status before executing CustRequestTests. Also fixed default dateValue for nowTimestamp as in case of overrided fromDate, entity-auto doesn't take care of it.

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

[ofbiz-framework] branch trunk updated: Fixed: testIntegrations caused due to invalid cust request status 'CRQ_SUBMITTED', so loaded QuoteTestData.xml with proper status before executing CustRequestTests. Also fixed default dateValue for nowTimestamp as in case of overrided fromDate, entity-auto doesn't take care of it.

surajk
This is an automated email from the ASF dual-hosted git repository.

surajk pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 0393ebe  Fixed: testIntegrations caused due to invalid cust request status 'CRQ_SUBMITTED', so loaded QuoteTestData.xml with proper status before executing CustRequestTests. Also fixed default dateValue for nowTimestamp as in case of overrided fromDate, entity-auto doesn't take care of it.
0393ebe is described below

commit 0393ebe994def0e3958c0d78f6e590e68ccdef88
Author: Suraj Khurana <[hidden email]>
AuthorDate: Wed May 6 12:16:12 2020 +0530

    Fixed: testIntegrations caused due to invalid cust request status 'CRQ_SUBMITTED', so loaded QuoteTestData.xml with proper status before executing CustRequestTests. Also fixed default dateValue for nowTimestamp as in case of overrided fromDate, entity-auto doesn't take care of it.
   
    Thanks: Jacques Le Roux for reporting.
---
 applications/order/minilang/request/CustRequestServices.xml | 2 --
 applications/order/servicedef/services_request.xml          | 8 ++++----
 applications/order/testdef/CustRequestTests.xml             | 7 +++++--
 applications/order/testdef/data/QuoteTestData.xml           | 4 ++--
 applications/workeffort/servicedef/services_timesheet.xml   | 7 ++++++-
 5 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/applications/order/minilang/request/CustRequestServices.xml b/applications/order/minilang/request/CustRequestServices.xml
index 5351438..3cf814c 100644
--- a/applications/order/minilang/request/CustRequestServices.xml
+++ b/applications/order/minilang/request/CustRequestServices.xml
@@ -186,9 +186,7 @@ under the License.
                 </else>
             </if-not-empty>
         </if-not-empty>
-
     </simple-method>
-
     <simple-method method-name="checkStatusCustRequest" short-description="Check StatusId CustRequest">
         <entity-one entity-name="CustRequest" value-field="custRequest"></entity-one>
         <if-empty field="custRequest">
diff --git a/applications/order/servicedef/services_request.xml b/applications/order/servicedef/services_request.xml
index 92610da..b7cc3f5 100644
--- a/applications/order/servicedef/services_request.xml
+++ b/applications/order/servicedef/services_request.xml
@@ -112,7 +112,7 @@ under the License.
         <description>Create a CustRequestParty record</description>
         <auto-attributes mode="IN" include="pk" optional="false"/>
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
-        <override name="fromDate" mode="IN" type="Timestamp" optional="true"/>
+        <override name="fromDate" mode="IN" type="Timestamp" optional="true" default-value="${date:nowTimestamp()}"/>
     </service>
     <service name="updateCustRequestParty" engine="entity-auto" default-entity-name="CustRequestParty" invoke="update" auth="true">
         <description>Update CustRequestParty record</description>
@@ -127,12 +127,12 @@ under the License.
         <description>Expires a CustRequestParty record</description>
         <auto-attributes mode="IN" include="pk" optional="false"/>
     </service>
-    <service name="checkStatusCustRequest" engine="simple" default-entity-name="CustRequestParty"
+    <service name="checkStatusCustRequest" engine="simple" default-entity-name="CustRequest"
              location="component://order/minilang/request/CustRequestServices.xml" invoke="checkStatusCustRequest" auth="true">
         <description>Check Status of Cust Request</description>
         <auto-attributes mode="IN" include="pk" optional="false"/>
     </service>
-    <service name="updateCustRequestLastModifiedDate" engine="simple" default-entity-name="CustRequestParty"
+    <service name="updateCustRequestLastModifiedDate" engine="simple" default-entity-name="CustRequest"
              location="component://order/minilang/request/CustRequestServices.xml" invoke="updateCustRequestLastModifiedDate" auth="true">
         <description>Update Cust Request Last Modified Date</description>
         <auto-attributes mode="IN" include="pk" optional="false"/>
@@ -221,7 +221,7 @@ under the License.
         <description>Create a Customer Request Content</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
-        <override name="fromDate" optional="true"/>
+        <override name="fromDate" optional="true" default-value="${date:nowTimestamp()}"/>
     </service>
     <service name="deleteCustRequestContent" engine="entity-auto" invoke="delete" default-entity-name="CustRequestContent" auth="true">
         <description>Delete a Customer Request Content</description>
diff --git a/applications/order/testdef/CustRequestTests.xml b/applications/order/testdef/CustRequestTests.xml
index bf313fb..b96c4a5 100644
--- a/applications/order/testdef/CustRequestTests.xml
+++ b/applications/order/testdef/CustRequestTests.xml
@@ -21,11 +21,14 @@ under the License.
 <test-suite suite-name="custrequesttests"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
-        
+
+    <!-- Required for proper cust request status -->
+    <test-case case-name="loadQuoteTestData">
+        <entity-xml action="load" entity-xml-url="component://order/testdef/data/QuoteTestData.xml"/>
+    </test-case>
     <test-case case-name="custrequest-tests">
         <simple-method-test location="component://order/minilang/test/CustRequestTests.xml"/>
     </test-case>
-
     <test-case case-name="test-cust-request-permission-check">
         <junit-test-suite class-name="org.apache.ofbiz.order.TestCustRequestPermissionCheck"/>
     </test-case>
diff --git a/applications/order/testdef/data/QuoteTestData.xml b/applications/order/testdef/data/QuoteTestData.xml
index f50b8f8..730595f 100644
--- a/applications/order/testdef/data/QuoteTestData.xml
+++ b/applications/order/testdef/data/QuoteTestData.xml
@@ -30,8 +30,8 @@ under the License.
     <QuoteItem quoteId="9001" quoteItemSeqId="00001" productId="GZ-1005" quantity="1"/>
     <QuoteAdjustment quoteAdjustmentId="9001" quoteId="9001" quoteItemSeqId="00001" quoteAdjustmentTypeId="SALES_TAX" amount="2"/>
     <PartyAcctgPreference partyId="DemoCustomer" quoteSeqCustMethId="QUOTE_HOOK_ENF_SEQ"/>
-    <CustRequest custRequestId="9000" custRequestDate="2008-07-28 09:45:31.928" custRequestTypeId="RF_QUOTE" statusId="CRQ_SUBMITTED" fromPartyId="DemoCustomer" priority="9" custRequestName="Customer Request Usage" description="Demo CustRequest" productStoreId="9000"/>
-    <CustRequestItem custRequestId="9000" statusId="CRQ_SUBMITTED" custRequestItemSeqId="00001" productId="GZ-1001" story="This can be the longer story of an item on the customer request."/>
+    <CustRequest custRequestId="9000" custRequestDate="2008-07-28 09:45:31.928" custRequestTypeId="RF_QUOTE" statusId="CRQ_ACCEPTED" fromPartyId="DemoCustomer" priority="9" custRequestName="Customer Request Usage" description="Demo CustRequest" productStoreId="9000"/>
+    <CustRequestItem custRequestId="9000" statusId="CRQ_ACCEPTED" custRequestItemSeqId="00001" productId="GZ-1001" story="This can be the longer story of an item on the customer request."/>
     <ShoppingList shoppingListId="9000" shoppingListTypeId="SLT_WISH_LIST" productStoreId="9000" currencyUom="USD" isActive="Y" isPublic="N" listName="Test Shopping List" partyId="DemoCustomer"/>
     <ShoppingListItem shoppingListId="9000" shoppingListItemSeqId="00001" productId="SV-1001" quantity="1.000000"/>
     <ProductPromo productPromoId="9010" promoName="Test Percent off product set " promoText="20% off any one item, either GZ-1005 (.NIT Gizmo) or GZ-1006 (Open Gizmo) with a limit of 1 per order" userEntered="Y" showToCustomer="Y" requireCode="N" useLimitPerOrder="1" createdDate="2001-05-13 12:00:00.0" createdByUserLogin="admin" lastModifiedDate="2001-05-13 12:00:00.0" lastModifiedByUserLogin="admin"/>
diff --git a/applications/workeffort/servicedef/services_timesheet.xml b/applications/workeffort/servicedef/services_timesheet.xml
index 014faeb..e7e232b 100644
--- a/applications/workeffort/servicedef/services_timesheet.xml
+++ b/applications/workeffort/servicedef/services_timesheet.xml
@@ -117,7 +117,12 @@ under the License.
         <permission-service service-name="workEffortGenericPermission" main-action="DELETE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
-
+    <!-- checkTimeSheetStatus -->
+    <service name="checkTimesheetStatus" default-entity-name="TimeEntry" engine="simple"
+         location="component://workeffort/minilang/timesheet/TimesheetServices.xml" auth="true" invoke="checkTimesheetStatus">
+        <description>Checks Timesheet status</description>
+        <auto-attributes include="pk" mode="IN" optional="true"/>
+    </service>
     <!-- TimeEntry Services -->
     <service name="createTimeEntry" default-entity-name="TimeEntry" engine="entity-auto" auth="true" invoke="create">
         <description>Creates TimeEntry</description>