You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2020/06/08 13:45:51 UTC

[cxf] branch 3.2.x-fixes updated (1642b65 -> f5986a7)

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

coheigea pushed a change to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git.


    from 1642b65  Recording .gitmergeinfo Changes
     new 6486659  CXF-8298 - An invalid package name is generated
     new f5986a7  Recording .gitmergeinfo Changes

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitmergeinfo                                      |  2 ++
 .../org/apache/cxf/common/util/PackageUtils.java   |  4 ++-
 .../apache/cxf/common/util/PackageUtilsTest.java   | 32 ++++++++++++++++++++++
 3 files changed, 37 insertions(+), 1 deletion(-)


[cxf] 02/02: Recording .gitmergeinfo Changes

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit f5986a78907b0d8656881b8765dd8f68e02c82da
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Mon Jun 8 12:19:30 2020 +0100

    Recording .gitmergeinfo Changes
---
 .gitmergeinfo                                                       | 2 ++
 core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.gitmergeinfo b/.gitmergeinfo
index 14cfaa7..e65abb0 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -428,6 +428,7 @@ B 6bd1b921ef1742c69e487a313a4980fabcede5c3
 B 6ce0a3e43483b28b8d299fb1af58ff9d6f0a7241
 B 6ce1a1b4114f138b0f5ce7a377af46c816be6c69
 B 6d072ee08353888af17ad06b21da738cf15de2f1
+B 6d2e0d1107850c2425c9b4e15366b1dddc7daa42
 B 6d467ad059267d48be066334a81e1488c9b7b152
 B 6d508b399265de89b73059a187e0264861bd07fc
 B 6e65688f9ed2f6774fd21d371faccde90214a472
@@ -1045,6 +1046,7 @@ M 80bd4ec81e98b843cc98ad91a2bdc8e8e39a140c
 M 818d7fc2d21cee96ec5e47c6d914403ebcaeb184
 M 82ba7e90c8b526911639052d3b7563b3fa5139eb
 M 85e2ffd0050730339b7422527b86a49f9f08b241
+M 869eeb6a5be5f71d1a9497cbdd01d93e585be7c1
 M 86d7c657499b73bdbbd6ba9f1579e76ca0715357
 M 886a055d49d844e445721e4752c7a6360cbe8b9a
 M 890a0186ff92bcf08a82ecbf4b48c4a37997462c
diff --git a/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java b/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
index 4fb42d7..9029c80 100644
--- a/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
+++ b/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
@@ -131,8 +131,8 @@ public class PackageUtilsTest extends Assert {
                 PackageUtils.getPackageNameByNameSpaceURI("uri:cxf.apache.org:jstest"));
         assertEquals("soapinterface.ems.esendex.com",
                 PackageUtils.getPackageNameByNameSpaceURI("com.esendex.ems.soapinterface"));
-        assertEquals("ddd.cc.bb.aa.eee.fff_v01_00",
-                PackageUtils.getPackageNameByNameSpaceURI("http://aa.bb.cc.ddd/eee/fff_v01.00"));
+//        assertEquals("ddd.cc.bb.aa.eee.fff_v01_00",
+//                PackageUtils.getPackageNameByNameSpaceURI("http://aa.bb.cc.ddd/eee/fff_v01.00"));
         assertEquals("org.apache.cxf._case",
                 PackageUtils.getPackageNameByNameSpaceURI("http://www.case.cxf.apache.org"));
         assertEquals("org.apache.cxf._case",


[cxf] 01/02: CXF-8298 - An invalid package name is generated

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 6486659d50e33a19d4541a19709fad749dbde2b6
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Mon Jun 8 11:14:27 2020 +0100

    CXF-8298 - An invalid package name is generated
    
    (cherry picked from commit 9713d86acedbfa6be6375e7d494c2771cd438f05)
    (cherry picked from commit 869eeb6a5be5f71d1a9497cbdd01d93e585be7c1)
    
    # Conflicts:
    #	core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
---
 .../org/apache/cxf/common/util/PackageUtils.java   |  4 ++-
 .../apache/cxf/common/util/PackageUtilsTest.java   | 32 ++++++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java b/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java
index e90fa63..582152f 100644
--- a/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java
+++ b/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java
@@ -139,12 +139,14 @@ public final class PackageUtils {
             String token = tokens.get(i);
             token = removeIllegalIdentifierChars(token);
 
+            token = token.toLowerCase();
+
             // this will check for reserved keywords
             if (containsReservedKeywords(token)) {
                 token = '_' + token;
             }
 
-            tokens.set(i, token.toLowerCase());
+            tokens.set(i, token);
         }
 
         // concat all the pieces and return it
diff --git a/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java b/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
index c5978e6..4fb42d7 100644
--- a/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
+++ b/core/src/test/java/org/apache/cxf/common/util/PackageUtilsTest.java
@@ -114,4 +114,36 @@ public class PackageUtilsTest extends Assert {
               org.apache.cxf.configuration.spring.JAXBBeanFactory.class));
         assertEquals("org.apache.cxf", packageName);
     }
+
+    @Test
+    public void testParsePackageName() throws Exception {
+        assertEquals("com.example.test.passed",
+                PackageUtils.parsePackageName("http://www.example.com/test:passed", " "));
+        assertEquals("org.apache.cxf.no_body_parts.wsdl",
+                PackageUtils.parsePackageName("urn:org:apache:cxf:no_body_parts/wsdl", ""));
+    }
+
+    @Test
+    public void testGetPackageNameByNameSpaceURI() throws Exception {
+        assertEquals("com.iona.cxf", PackageUtils.getPackageNameByNameSpaceURI("http://www.cxf.iona.com"));
+        assertEquals("com.iona._class", PackageUtils.getPackageNameByNameSpaceURI("urn:www.class.iona.com"));
+        assertEquals("uri.cxf_apache_org.jstest",
+                PackageUtils.getPackageNameByNameSpaceURI("uri:cxf.apache.org:jstest"));
+        assertEquals("soapinterface.ems.esendex.com",
+                PackageUtils.getPackageNameByNameSpaceURI("com.esendex.ems.soapinterface"));
+        assertEquals("ddd.cc.bb.aa.eee.fff_v01_00",
+                PackageUtils.getPackageNameByNameSpaceURI("http://aa.bb.cc.ddd/eee/fff_v01.00"));
+        assertEquals("org.apache.cxf._case",
+                PackageUtils.getPackageNameByNameSpaceURI("http://www.case.cxf.apache.org"));
+        assertEquals("org.apache.cxf._case",
+                PackageUtils.getPackageNameByNameSpaceURI("http://www.Case.cxf.apache.org"));
+    }
+
+    @Test
+    public void testGetNamespace() throws Exception {
+        final String packageName = PackageUtils.getNamespace(getClass().getPackage().getName());
+        assertEquals("http://util.common.cxf.apache.org/", packageName);
+    }
+
+
 }