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

albumenj pushed a commit to branch 3.2
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.2 by this push:
     new 9d37c4e083 Add pond test cases (#13646)
9d37c4e083 is described below

commit 9d37c4e08310576e4a8032b9bd02bf7c6493365e
Author: Albumen Kevin <jhq0...@gmail.com>
AuthorDate: Wed Jan 17 16:55:23 2024 +0800

    Add pond test cases (#13646)
---
 .../org/apache/dubbo/common/URLStrParserTest.java  | 24 ++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git 
a/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java 
b/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java
index 4c4c218c35..a16c5f9e19 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java
@@ -38,8 +38,11 @@ class URLStrParserTest {
         testCases.add("dubbo://192.168.1.1");
         testCases.add("dubbo://192.168.1.1?");
         testCases.add("dubbo://127.0.0.1?test=中文测试");
-        testCases.add(
-                
"dubbo://admin:admin123@192.168.1.41:28113/org.test.api.DemoService$Iface?anyhost=true&application=demo-service&dubbo=2.6.1&generic=false&interface=org.test.api.DemoService$Iface&methods=orbCompare,checkText,checkPicture&pid=65557&revision=1.4.17&service.filter=bootMetrics&side=provider&status=server&threads=200&timestamp=1583136298859&version=1.0.0");
+        testCases.add("dubbo://admin:admin123@192.168.1.41:28113/org.test.api"
+                + 
".DemoService$Iface?anyhost=true&application=demo-service&dubbo=2.6.1&generic=false&interface=org"
+                + 
".test.api.DemoService$Iface&methods=orbCompare,checkText,checkPicture&pid=65557&revision=1.4"
+                + 
".17&service.filter=bootMetrics&side=provider&status=server&threads=200&timestamp=1583136298859"
+                + "&version=1.0.0");
         // super long text test
         testCases.add("dubbo://192.168.1.1/" + RandomString.make(10240));
         testCases.add("file:/path/to/file.txt");
@@ -57,8 +60,8 @@ class URLStrParserTest {
         errorEncodedCases.add("dubbo%3a192.168.1.1%3fabc%3dabc");
         errorEncodedCases.add("%3a%2f%2f192.168.1.1%3fabc%3dabc");
         errorEncodedCases.add("%3a%2f192.168.1.1%3fabc%3dabc");
-        errorEncodedCases.add(
-                
"dubbo%3a%2f%2f127.0.0.1%3ftest%3d%e2%96%b2%e2%96%bc%e2%97%80%e2%96%b6%e2%86%90%e2%86%91%e2%86%92%e2%86%93%e2%86%94%e2%86%95%e2%88%9e%c2%b1%e9%be%98%e9%9d%90%e9%bd%89%9%d%b");
+        
errorEncodedCases.add("dubbo%3a%2f%2f127.0.0.1%3ftest%3d%e2%96%b2%e2%96%bc%e2%97%80%e2%96%b6%e2%86%90%e2%86"
+                + 
"%91%e2%86%92%e2%86%93%e2%86%94%e2%86%95%e2%88%9e%c2%b1%e9%be%98%e9%9d%90%e9%bd%89%9%d%b");
     }
 
     @Test
@@ -93,4 +96,17 @@ class URLStrParserTest {
         assertThat(url2.getParameter("timeout"), equalTo("5678"));
         assertThat(url2.getParameter("default.timeout"), equalTo("5678"));
     }
+
+    @Test
+    void testPond() {
+        String str = "https://a#@b";;
+
+        URL url1 = URL.valueOf(str);
+        URL url2 = URLStrParser.parseDecodedStr(str);
+
+        Assertions.assertEquals("https", url1.getProtocol());
+        Assertions.assertEquals("https", url2.getProtocol());
+        Assertions.assertEquals("a", url1.getHost());
+        Assertions.assertEquals("a", url2.getHost());
+    }
 }

Reply via email to