You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/06/24 07:51:22 UTC
[dubbo] branch 3.0 updated: Fix NettyServerTest test case problem
(#8106)
This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.0 by this push:
new 0db6fe2 Fix NettyServerTest test case problem (#8106)
0db6fe2 is described below
commit 0db6fe237933405992ec4f6a51fb6b88fcb007cb
Author: xiaoheng1 <20...@qq.com>
AuthorDate: Thu Jun 24 15:51:04 2021 +0800
Fix NettyServerTest test case problem (#8106)
---
...{NettyServerTest.java => PortUnificationServerTest.java} | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/api/NettyServerTest.java b/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/api/PortUnificationServerTest.java
similarity index 75%
rename from dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/api/NettyServerTest.java
rename to dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/api/PortUnificationServerTest.java
index bac9c2f..98ee317 100644
--- a/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/api/NettyServerTest.java
+++ b/dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/api/PortUnificationServerTest.java
@@ -17,17 +17,22 @@
package org.apache.dubbo.remoting.api;
import org.apache.dubbo.common.URL;
+import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.common.url.component.ServiceConfigURL;
import org.apache.dubbo.remoting.Constants;
import org.apache.dubbo.remoting.RemotingException;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
-public class NettyServerTest {
+public class PortUnificationServerTest {
- public static void main(String[] args) throws RemotingException {
- URL url = new ServiceConfigURL("transport", "localhost", 8898,
+ @Test
+ public void testBind() throws RemotingException {
+ URL url = new ServiceConfigURL(CommonConstants.TRIPLE, "localhost", 8898,
new String[]{Constants.BIND_PORT_KEY, String.valueOf(8898)});
final PortUnificationServer server = new PortUnificationServer(url);
- System.out.println(server.isBound());
+ server.bind();
+ Assertions.assertTrue(server.isBound());
}
}