qinliujie closed pull request #2034: [Dubbo- unit test class not found] fix 
class not found "hi"
URL: https://github.com/apache/incubator-dubbo/pull/2034
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/DubboInvokerAvilableTest.java
 
b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/DubboInvokerAvilableTest.java
index f38f2490f1..f06b65b884 100644
--- 
a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/DubboInvokerAvilableTest.java
+++ 
b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/DubboInvokerAvilableTest.java
@@ -21,16 +21,14 @@
 import org.apache.dubbo.common.URL;
 import org.apache.dubbo.common.extension.ExtensionLoader;
 import org.apache.dubbo.common.utils.ConfigUtils;
+import org.apache.dubbo.common.utils.NetUtils;
 import org.apache.dubbo.remoting.exchange.ExchangeClient;
-import org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeServer;
 import org.apache.dubbo.rpc.Exporter;
 import org.apache.dubbo.rpc.ProxyFactory;
 import org.apache.dubbo.rpc.protocol.dubbo.support.ProtocolUtils;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import java.lang.reflect.Field;
@@ -54,7 +52,7 @@ public void setUp() throws Exception {
 
     @Test
     public void test_Normal_available() {
-        URL url = URL.valueOf("dubbo://127.0.0.1:20883/hi");
+        URL url = 
URL.valueOf("dubbo://127.0.0.1:20883/org.apache.dubbo.rpc.protocol.dubbo.IDemoService");
         ProtocolUtils.export(new DemoServiceImpl(), IDemoService.class, url);
 
         DubboInvoker<?> invoker = (DubboInvoker<?>) 
protocol.refer(IDemoService.class, url);
@@ -65,7 +63,7 @@ public void test_Normal_available() {
 
     @Test
     public void test_Normal_ChannelReadOnly() throws Exception {
-        URL url = URL.valueOf("dubbo://127.0.0.1:20883/hi");
+        URL url = 
URL.valueOf("dubbo://127.0.0.1:20883/org.apache.dubbo.rpc.protocol.dubbo.IDemoService");
         ProtocolUtils.export(new DemoServiceImpl(), IDemoService.class, url);
 
         DubboInvoker<?> invoker = (DubboInvoker<?>) 
protocol.refer(IDemoService.class, url);
@@ -81,7 +79,8 @@ public void test_Normal_ChannelReadOnly() throws Exception {
 
     @Test
     public void test_normal_channel_close_wait_gracefully() throws Exception {
-        URL url = 
URL.valueOf("dubbo://127.0.0.1:20883/hi?scope=true&lazy=false");
+        int testPort = NetUtils.getAvailablePort();
+        URL url = URL.valueOf("dubbo://127.0.0.1:" + testPort + 
"/org.apache.dubbo.rpc.protocol.dubbo.IDemoService?scope=true&lazy=false");
         Exporter<IDemoService> exporter = ProtocolUtils.export(new 
DemoServiceImpl(), IDemoService.class, url);
         Exporter<IDemoService> exporter0 = ProtocolUtils.export(new 
DemoServiceImpl0(), IDemoService.class, url);
 
@@ -105,7 +104,7 @@ public void test_normal_channel_close_wait_gracefully() 
throws Exception {
 
     @Test
     public void test_NoInvokers() throws Exception {
-        URL url = URL.valueOf("dubbo://127.0.0.1:20883/hi?connections=1");
+        URL url = 
URL.valueOf("dubbo://127.0.0.1:20883/org.apache.dubbo.rpc.protocol.dubbo.IDemoService?connections=1");
         ProtocolUtils.export(new DemoServiceImpl(), IDemoService.class, url);
 
         DubboInvoker<?> invoker = (DubboInvoker<?>) 
protocol.refer(IDemoService.class, url);
@@ -118,7 +117,7 @@ public void test_NoInvokers() throws Exception {
 
     @Test
     public void test_Lazy_ChannelReadOnly() throws Exception {
-        URL url = 
URL.valueOf("dubbo://127.0.0.1:20883/hi?lazy=true&connections=1");
+        URL url = 
URL.valueOf("dubbo://127.0.0.1:20883/org.apache.dubbo.rpc.protocol.dubbo.IDemoService?lazy=true&connections=1&timeout=10000");
         ProtocolUtils.export(new DemoServiceImpl(), IDemoService.class, url);
 
         DubboInvoker<?> invoker = (DubboInvoker<?>) 
protocol.refer(IDemoService.class, url);
@@ -148,10 +147,6 @@ public void test_Lazy_ChannelReadOnly() throws Exception {
         return clients;
     }
 
-    public interface IDemoService {
-        public String get();
-    }
-
     public class DemoServiceImpl implements IDemoService {
         public String get() {
             return "ok";
diff --git 
a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/DubboLazyConnectTest.java
 
b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/DubboLazyConnectTest.java
index b89ce5c1d4..4efad6f9af 100644
--- 
a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/DubboLazyConnectTest.java
+++ 
b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/DubboLazyConnectTest.java
@@ -22,7 +22,6 @@
 import org.apache.dubbo.common.utils.NetUtils;
 import org.apache.dubbo.rpc.RpcException;
 import org.apache.dubbo.rpc.protocol.dubbo.support.ProtocolUtils;
-
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -43,19 +42,19 @@ public void setUp() throws Exception {
 
     @Test(expected = RpcException.class)
     public void testSticky1() {
-        URL url = URL.valueOf("dubbo://127.0.0.1:9090/hi");
+        URL url = 
URL.valueOf("dubbo://127.0.0.1:9090/org.apache.dubbo.rpc.protocol.dubbo.IDemoService");
         ProtocolUtils.refer(IDemoService.class, url);
     }
 
     @Test
     public void testSticky2() {
-        URL url = URL.valueOf("dubbo://127.0.0.1:9090/hi?" + 
Constants.LAZY_CONNECT_KEY + "=true");
+        URL url = 
URL.valueOf("dubbo://127.0.0.1:9090/org.apache.dubbo.rpc.protocol.dubbo.IDemoService?"
 + Constants.LAZY_CONNECT_KEY + "=true");
         ProtocolUtils.refer(IDemoService.class, url);
     }
 
     @Test(expected = RpcException.class)
     public void testSticky3() {
-        URL url = URL.valueOf("dubbo://127.0.0.1:9090/hi?" + 
Constants.LAZY_CONNECT_KEY + "=true");
+        URL url = 
URL.valueOf("dubbo://127.0.0.1:9090/org.apache.dubbo.rpc.protocol.dubbo.IDemoService?"
 + Constants.LAZY_CONNECT_KEY + "=true");
         IDemoService service = (IDemoService) 
ProtocolUtils.refer(IDemoService.class, url);
         service.get();
     }
@@ -63,7 +62,7 @@ public void testSticky3() {
     @Test
     public void testSticky4() {
         int port = NetUtils.getAvailablePort();
-        URL url = URL.valueOf("dubbo://127.0.0.1:" + port + "/hi?" + 
Constants.LAZY_CONNECT_KEY + "=true");
+        URL url = URL.valueOf("dubbo://127.0.0.1:" + port + 
"/org.apache.dubbo.rpc.protocol.dubbo.IDemoService?" + 
Constants.LAZY_CONNECT_KEY + "=true&timeout=20000");
 
         ProtocolUtils.export(new DemoServiceImpl(), IDemoService.class, url);
 
@@ -71,10 +70,6 @@ public void testSticky4() {
         Assert.assertEquals("ok", service.get());
     }
 
-    public interface IDemoService {
-        public String get();
-    }
-
     public class DemoServiceImpl implements IDemoService {
         public String get() {
             return "ok";
diff --git 
a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/IDemoService.java
 
b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/IDemoService.java
new file mode 100644
index 0000000000..ed1774b0cd
--- /dev/null
+++ 
b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/IDemoService.java
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.dubbo.rpc.protocol.dubbo;
+
+public interface IDemoService {
+    public String get();
+}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to