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

pgil 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 687bb364d6 Fixed: Partymgr Groovy tests (OFBIZ-12998)
687bb364d6 is described below

commit 687bb364d60307a17f8ec8af27c856ebb4037bf7
Author: Gil Portenseigne <gil.portensei...@nereide.fr>
AuthorDate: Fri Apr 5 14:41:45 2024 +0200

    Fixed: Partymgr Groovy tests (OFBIZ-12998)
    
    Fix error that make test unable to be loaded.
---
 .../party/party/ContactMechWorkerTests.groovy      | 18 ++---
 .../party/party/PartyContactMechTests.groovy       | 86 +++++++++++-----------
 .../party/party/PartyStatusChangeTests.groovy      | 19 +++--
 .../apache/ofbiz}/party/party/PartyTests.groovy    | 21 +++---
 .../party/testdef/PartyContactMechTests.xml        |  4 +-
 .../party/testdef/PartyStatusChangeTests.xml       |  2 +-
 applications/party/testdef/PartyTests.xml          |  2 +-
 7 files changed, 73 insertions(+), 79 deletions(-)

diff --git 
a/applications/party/src/test/groovy/org/apache/party/party/ContactMechWorkerTests.groovy
 
b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/ContactMechWorkerTests.groovy
similarity index 96%
rename from 
applications/party/src/test/groovy/org/apache/party/party/ContactMechWorkerTests.groovy
rename to 
applications/party/src/main/groovy/org/apache/ofbiz/party/party/ContactMechWorkerTests.groovy
index 3eef0d482b..c25b4259c0 100644
--- 
a/applications/party/src/test/groovy/org/apache/party/party/ContactMechWorkerTests.groovy
+++ 
b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/ContactMechWorkerTests.groovy
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  
*******************************************************************************/
-package org.apache.party.party
+package org.apache.ofbiz.party.party
 
 import org.apache.ofbiz.base.util.UtilDateTime
 import org.apache.ofbiz.party.contact.ContactMechWorker
@@ -34,10 +34,9 @@ class ContactMechWorkerTests extends OFBizTestCase {
         assert partyContactMechValueMaps
         assert partyContactMechValueMaps.size() == 7
         boolean foundPostalAddress = false, foundTelecom = false, 
foundEmailAddress = false, foundFtpAddress = false
-        partyContactMechValueMaps.forEach {
-            Map partyContactMechValueMap ->
-                switch (partyContactMechValueMap?.contactMech?.contactMechId) {
-                    case '9015':
+        partyContactMechValueMaps.forEach { Map partyContactMechValueMap ->
+            switch (partyContactMechValueMap?.contactMech?.contactMechId) {
+                case '9015':
                     foundPostalAddress = true
                     assert 
partyContactMechValueMap.contactMech.contactMechTypeId == 'POSTAL_ADDRESS'
                     assert partyContactMechValueMap.partyContactMech
@@ -48,7 +47,7 @@ class ContactMechWorkerTests extends OFBizTestCase {
                     assert 
partyContactMechValueMap.postalAddress.contactMechId == '9015'
                     assert partyContactMechValueMap.postalAddress.address1 == 
'2004 Factory Blvd'
                     break
-                    case '9027':
+                case '9027':
                     foundTelecom = true
                     assert 
partyContactMechValueMap.contactMech.contactMechTypeId == 'TELECOM_NUMBER'
                     assert partyContactMechValueMap.partyContactMech
@@ -59,7 +58,7 @@ class ContactMechWorkerTests extends OFBizTestCase {
                     assert 
partyContactMechValueMap.telecomNumber.contactMechId == '9027'
                     assert 
partyContactMechValueMap.telecomNumber.contactNumber == '444-4444'
                     break
-                    case '9126':
+                case '9126':
                     foundEmailAddress = true
                     assert 
partyContactMechValueMap.contactMech.contactMechTypeId == 'EMAIL_ADDRESS'
                     assert partyContactMechValueMap.contactMech.infoString == 
'ofbizt...@foo.com'
@@ -68,7 +67,7 @@ class ContactMechWorkerTests extends OFBizTestCase {
                     assert partyContactMechValueMap.partyContactMechPurposes
                     assert 
partyContactMechValueMap.partyContactMechPurposes.size() == 2
                     break
-                    case '9127':
+                case '9127':
                     foundFtpAddress = true
                     assert 
partyContactMechValueMap.contactMech.contactMechTypeId == 'FTP_ADDRESS'
                     assert partyContactMechValueMap.partyContactMech
@@ -77,7 +76,7 @@ class ContactMechWorkerTests extends OFBizTestCase {
                     assert partyContactMechValueMap.ftpAddress
                     assert partyContactMechValueMap.ftpAddress.hostname == 
'ftp://apacheofbiz.foo.com'
                     break
-                }
+            }
         }
         assert foundPostalAddress && foundTelecom && foundEmailAddress && 
foundFtpAddress
 
@@ -177,5 +176,4 @@ class ContactMechWorkerTests extends OFBizTestCase {
         }
         assert foundPostalAddress && foundEmail && foundPhone
     }
-
 }
diff --git 
a/applications/party/src/test/groovy/org/apache/party/party/PartyContactMechTests.groovy
 
b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyContactMechTests.groovy
similarity index 89%
rename from 
applications/party/src/test/groovy/org/apache/party/party/PartyContactMechTests.groovy
rename to 
applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyContactMechTests.groovy
index 00e42177f2..28efb2e42e 100644
--- 
a/applications/party/src/test/groovy/org/apache/party/party/PartyContactMechTests.groovy
+++ 
b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyContactMechTests.groovy
@@ -16,10 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.party.party
+package org.apache.ofbiz.party.party
 
 import org.apache.ofbiz.entity.GenericValue
-import org.apache.ofbiz.party.party.PartyWorker
 import org.apache.ofbiz.service.ModelService
 import org.apache.ofbiz.service.ServiceUtil
 import org.apache.ofbiz.service.testtools.OFBizTestCase
@@ -37,11 +36,11 @@ class PartyContactMechTests extends OFBizTestCase {
 
         // first try with just updating without changing the email address
         Map serviceCtx = [
-                partyId: partyId,
-                contactMechTypeId: contactMechTypeId,
-                emailAddress: emailAddress,
-                contactMechId: '9026',
-                userLogin: userLogin
+            partyId: partyId,
+            contactMechTypeId: contactMechTypeId,
+            emailAddress: emailAddress,
+            contactMechId: '9026',
+            userLogin: userLogin
         ]
         Map serviceResult = dispatcher.runSync('updatePartyEmailAddress', 
serviceCtx)
         assert ServiceUtil.isSuccess(serviceResult)
@@ -77,12 +76,12 @@ class PartyContactMechTests extends OFBizTestCase {
 
         // first try with just updating without changing the email address
         Map serviceCtx = [
-                partyId: partyId,
-                contactMechId: '9025',
-                countryCode: '1',
-                areaCode: '801',
-                contactNumber: '555-5555',
-                userLogin: userLogin
+            partyId: partyId,
+            contactMechId: '9025',
+            countryCode: '1',
+            areaCode: '801',
+            contactNumber: '555-5555',
+            userLogin: userLogin
         ]
         Map serviceResult = dispatcher.runSync('updatePartyTelecomNumber', 
serviceCtx)
         assert ServiceUtil.isSuccess(serviceResult)
@@ -185,10 +184,10 @@ class PartyContactMechTests extends OFBizTestCase {
         String contactMechPurposeTypeId = 'PRIMARY_EMAIL'
 
         Map serviceCtx = [
-                partyId: partyId,
-                contactMechPurposeTypeId: contactMechPurposeTypeId,
-                emailAddress: emailAddress,
-                userLogin: userLogin
+            partyId: partyId,
+            contactMechPurposeTypeId: contactMechPurposeTypeId,
+            emailAddress: emailAddress,
+            userLogin: userLogin
         ]
         Map serviceResult = dispatcher.runSync('createPartyEmailAddress', 
serviceCtx)
         assert ServiceUtil.isSuccess(serviceResult)
@@ -224,11 +223,11 @@ class PartyContactMechTests extends OFBizTestCase {
         String contactMechPurposeTypeId = 'PRIMARY_PHONE'
 
         Map serviceCtx = [
-                partyId: partyId,
-                contactMechPurposeTypeId: contactMechPurposeTypeId,
-                areaCode: areaCode,
-                contactNumber: contactNumber,
-                userLogin: userLogin
+            partyId: partyId,
+            contactMechPurposeTypeId: contactMechPurposeTypeId,
+            areaCode: areaCode,
+            contactNumber: contactNumber,
+            userLogin: userLogin
         ]
         Map serviceResult = dispatcher.runSync('createPartyTelecomNumber', 
serviceCtx)
         assert ServiceUtil.isSuccess(serviceResult)
@@ -268,12 +267,12 @@ class PartyContactMechTests extends OFBizTestCase {
         String extension = '444'
 
         Map serviceCtx = [
-                partyId: partyId,
-                contactMechPurposeTypeId: contactMechPurposeTypeId,
-                areaCode: areaCode,
-                contactNumber: contactNumber,
-                extension: extension,
-                userLogin: userLogin
+            partyId: partyId,
+            contactMechPurposeTypeId: contactMechPurposeTypeId,
+            areaCode: areaCode,
+            contactNumber: contactNumber,
+            extension: extension,
+            userLogin: userLogin
         ]
         Map serviceResult = 
dispatcher.runSync('createUpdatePartyTelecomNumber', serviceCtx)
         assert ServiceUtil.isSuccess(serviceResult)
@@ -313,12 +312,12 @@ class PartyContactMechTests extends OFBizTestCase {
         String contactNumber = '555-5555'
 
         Map serviceCtx = [
-                partyId: partyId,
-                contactMechId: '9125',
-                contactMechPurposeTypeId: contactMechPurposeTypeId,
-                areaCode: areaCode,
-                contactNumber: contactNumber,
-                userLogin: userLogin
+            partyId: partyId,
+            contactMechId: '9125',
+            contactMechPurposeTypeId: contactMechPurposeTypeId,
+            areaCode: areaCode,
+            contactNumber: contactNumber,
+            userLogin: userLogin
         ]
         Map serviceResult = 
dispatcher.runSync('createUpdatePartyTelecomNumber', serviceCtx)
         assert ServiceUtil.isSuccess(serviceResult)
@@ -361,10 +360,10 @@ class PartyContactMechTests extends OFBizTestCase {
         String emailAddress = 'demo.custo...@foo.com'
 
         Map serviceCtx = [
-                partyId: partyId,
-                contactMechPurposeTypeId: contactMechPurposeTypeId,
-                emailAddress: emailAddress,
-                userLogin: userLogin
+            partyId: partyId,
+            contactMechPurposeTypeId: contactMechPurposeTypeId,
+            emailAddress: emailAddress,
+            userLogin: userLogin
         ]
         Map serviceResult = 
dispatcher.runSync('createUpdatePartyEmailAddress', serviceCtx)
         assert ServiceUtil.isSuccess(serviceResult)
@@ -395,11 +394,11 @@ class PartyContactMechTests extends OFBizTestCase {
         String emailAddress = 'demo.custo...@foo.com'
 
         Map serviceCtx = [
-                partyId: partyId,
-                contactMechId: '9126',
-                contactMechPurposeTypeId: contactMechPurposeTypeId,
-                emailAddress: emailAddress,
-                userLogin: userLogin
+            partyId: partyId,
+            contactMechId: '9126',
+            contactMechPurposeTypeId: contactMechPurposeTypeId,
+            emailAddress: emailAddress,
+            userLogin: userLogin
         ]
         Map serviceResult = 
dispatcher.runSync('createUpdatePartyEmailAddress', serviceCtx)
         assert ServiceUtil.isSuccess(serviceResult)
@@ -431,5 +430,4 @@ class PartyContactMechTests extends OFBizTestCase {
                 .filterByDate().queryFirst()
         assert partyContactMechPurpose
     }
-
 }
diff --git 
a/applications/party/src/test/groovy/org/apache/party/party/PartyStatusChangeTests.groovy
 
b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyStatusChangeTests.groovy
similarity index 86%
rename from 
applications/party/src/test/groovy/org/apache/party/party/PartyStatusChangeTests.groovy
rename to 
applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyStatusChangeTests.groovy
index ce56cf19d0..442f3bad9e 100644
--- 
a/applications/party/src/test/groovy/org/apache/party/party/PartyStatusChangeTests.groovy
+++ 
b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyStatusChangeTests.groovy
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.party.party
+package org.apache.ofbiz.party.party
 
 import org.apache.ofbiz.base.util.UtilDateTime
 import org.apache.ofbiz.entity.GenericValue
@@ -35,10 +35,10 @@ class PartyStatusChangeTests extends OFBizTestCase {
         String statusId = 'PARTY_DISABLED'
 
         Map serviceCtx = [
-                partyId: partyId,
-                statusId: statusId,
-                statusDate: UtilDateTime.nowTimestamp(),
-                userLogin: userLogin
+            partyId: partyId,
+            statusId: statusId,
+            statusDate: UtilDateTime.nowTimestamp(),
+            userLogin: userLogin
         ]
         Map serviceResult = dispatcher.runSync('setPartyStatus', serviceCtx)
         assert ServiceUtil.isSuccess(serviceResult)
@@ -57,10 +57,10 @@ class PartyStatusChangeTests extends OFBizTestCase {
         String statusId = 'PARTY_ENABLED'
 
         Map serviceCtx = [
-                partyId: partyId,
-                statusId: statusId,
-                statusDate: UtilDateTime.nowTimestamp(),
-                userLogin: userLogin
+            partyId: partyId,
+            statusId: statusId,
+            statusDate: UtilDateTime.nowTimestamp(),
+            userLogin: userLogin
         ]
         Map serviceResult = dispatcher.runSync('setPartyStatus', serviceCtx)
         assert ServiceUtil.isSuccess(serviceResult)
@@ -72,5 +72,4 @@ class PartyStatusChangeTests extends OFBizTestCase {
         assert statusId == party.statusId
         assert serviceResult.oldStatusId == 'PARTY_DISABLED'
     }
-
 }
diff --git 
a/applications/party/src/test/groovy/org/apache/party/party/PartyTests.groovy 
b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyTests.groovy
similarity index 78%
rename from 
applications/party/src/test/groovy/org/apache/party/party/PartyTests.groovy
rename to 
applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyTests.groovy
index 6027680fc0..a2894818b6 100644
--- 
a/applications/party/src/test/groovy/org/apache/party/party/PartyTests.groovy
+++ 
b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyTests.groovy
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.party.party
+package org.apache.ofbiz.party.party
 
 import org.apache.ofbiz.entity.GenericValue
 import org.apache.ofbiz.service.ServiceUtil
@@ -30,15 +30,15 @@ class PartyTests extends OFBizTestCase {
 
     void testCreatePartyPostalAddress() {
         Map serviceCtx = [
-                contactMechId: 'TestPostalAddress',
-                partyId: 'TestCustomer',
-                toName: 'Test Address',
-                address1: '2004 Factory Blvd',
-                city: 'City of Industry',
-                countryGeoId: 'USA',
-                stateProvinceGeoId: 'CA',
-                postalCode: '90000',
-                userLogin: userLogin
+            contactMechId: 'TestPostalAddress',
+            partyId: 'TestCustomer',
+            toName: 'Test Address',
+            address1: '2004 Factory Blvd',
+            city: 'City of Industry',
+            countryGeoId: 'USA',
+            stateProvinceGeoId: 'CA',
+            postalCode: '90000',
+            userLogin: userLogin
         ]
         Map serviceResult = dispatcher.runSync('createPartyPostalAddress', 
serviceCtx)
         assert ServiceUtil.isSuccess(serviceResult)
@@ -47,5 +47,4 @@ class PartyTests extends OFBizTestCase {
         assert postalAddress != null
         postalAddress.city = 'City of Industry'
     }
-
 }
diff --git a/applications/party/testdef/PartyContactMechTests.xml 
b/applications/party/testdef/PartyContactMechTests.xml
index efc79368a2..aa6634386c 100644
--- a/applications/party/testdef/PartyContactMechTests.xml
+++ b/applications/party/testdef/PartyContactMechTests.xml
@@ -25,10 +25,10 @@
         <entity-xml action="load" 
entity-xml-url="component://party/testdef/data/PartyContactMechTestData.xml"/>
     </test-case>
     <test-case case-name="ContactMechWorker-tests">
-        <junit-test-suite 
class-name="org.apache.ofbiz.party.ContactMechWorkerTests"/>
+        <junit-test-suite 
class-name="org.apache.ofbiz.party.party.ContactMechWorkerTests"/>
     </test-case>
     <test-case case-name="partyContactMech-tests">
-        <junit-test-suite 
class-name="org.apache.ofbiz.party.PartyContactMechTests"/>
+        <junit-test-suite 
class-name="org.apache.ofbiz.party.party.PartyContactMechTests"/>
     </test-case>
 
 
diff --git a/applications/party/testdef/PartyStatusChangeTests.xml 
b/applications/party/testdef/PartyStatusChangeTests.xml
index 3633525bf0..a9e3f01d68 100644
--- a/applications/party/testdef/PartyStatusChangeTests.xml
+++ b/applications/party/testdef/PartyStatusChangeTests.xml
@@ -26,7 +26,7 @@
     </test-case>
 
     <test-case case-name="partystatuschangetest">
-        <junit-test-suite 
class-name="org.apache.ofbiz.party.PartyStatusChangeTests"/>
+        <junit-test-suite 
class-name="org.apache.ofbiz.party.party.PartyStatusChangeTests"/>
     </test-case>
 
 </test-suite>
diff --git a/applications/party/testdef/PartyTests.xml 
b/applications/party/testdef/PartyTests.xml
index 23d3767e93..897c0ac3f3 100644
--- a/applications/party/testdef/PartyTests.xml
+++ b/applications/party/testdef/PartyTests.xml
@@ -27,6 +27,6 @@
 
     <test-group case-name="party-tests">
         <simple-method-test 
location="component://party/minilang/test/PartyTests.xml"/>
-        <junit-test-suite class-name="org.apache.ofbiz.party.PartyTests"/>
+        <junit-test-suite 
class-name="org.apache.ofbiz.party.party.PartyTests"/>
     </test-group>
 </test-suite>

Reply via email to