You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2018/09/13 06:46:26 UTC

[GitHub] diecui1202 closed pull request #2497: fix stable problem for unit cases

diecui1202 closed pull request #2497: fix stable problem for unit cases
URL: https://github.com/apache/incubator-dubbo/pull/2497
 
 
   

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/.travis.yml b/.travis.yml
index acf5d48918..2b617a3e85 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,6 +6,10 @@ jdk:
   - oraclejdk9
   - oraclejdk8
 
+cache:
+  directories:
+    - $HOME/.m2
+
 install: true
 
 script:
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/UrlUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/UrlUtilsTest.java
index 7141c96bc0..3fc14c3a59 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/UrlUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/UrlUtilsTest.java
@@ -98,9 +98,9 @@ public void testParseFromParameter() {
 
     @Test
     public void testParseUrl2() {
-        String address = "127.0.0.1";
-        String backupAddress1 = "127.0.0.2";
-        String backupAddress2 = "127.0.0.3";
+        String address = "192.168.0.1";
+        String backupAddress1 = "192.168.0.2";
+        String backupAddress2 = "192.168.0.3";
 
         Map<String, String> parameters = new HashMap<String, String>();
         parameters.put("username", "root");
@@ -108,25 +108,25 @@ public void testParseUrl2() {
         parameters.put("port", "10000");
         parameters.put("protocol", "dubbo");
         URL url = UrlUtils.parseURL(address + "," + backupAddress1 + "," + backupAddress2, parameters);
-        assertEquals(localAddress + ":10000", url.getAddress());
+        assertEquals("192.168.0.1:10000", url.getAddress());
         assertEquals("root", url.getUsername());
         assertEquals("alibaba", url.getPassword());
         assertEquals(10000, url.getPort());
         assertEquals("dubbo", url.getProtocol());
-        assertEquals("127.0.0.2" + "," + "127.0.0.3", url.getParameter("backup"));
+        assertEquals("192.168.0.2" + "," + "192.168.0.3", url.getParameter("backup"));
     }
 
     @Test
     public void testParseUrls() {
-        String addresses = "127.0.0.1|127.0.0.2|127.0.0.3";
+        String addresses = "192.168.0.1|192.168.0.2|192.168.0.3";
         Map<String, String> parameters = new HashMap<String, String>();
         parameters.put("username", "root");
         parameters.put("password", "alibaba");
         parameters.put("port", "10000");
         parameters.put("protocol", "dubbo");
         List<URL> urls = UrlUtils.parseURLs(addresses, parameters);
-        assertEquals(localAddress + ":10000", urls.get(0).getAddress());
-        assertEquals("127.0.0.2" + ":10000", urls.get(1).getAddress());
+        assertEquals("192.168.0.1" + ":10000", urls.get(0).getAddress());
+        assertEquals("192.168.0.2" + ":10000", urls.get(1).getAddress());
     }
 
     @Test
@@ -330,7 +330,7 @@ public void testIsItemMatch() throws Exception {
 
     @Test
     public void testIsServiceKeyMatch() throws Exception {
-        URL url = URL.valueOf("test://127.0.0.0");
+        URL url = URL.valueOf("test://127.0.0.1");
         URL pattern = url.addParameter(Constants.GROUP_KEY, "test")
                 .addParameter(Constants.INTERFACE_KEY, "test")
                 .addParameter(Constants.VERSION_KEY, "test");
diff --git a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/GenericServiceTest.java b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/GenericServiceTest.java
index 6e746dbf43..f996f4109e 100644
--- a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/GenericServiceTest.java
+++ b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/GenericServiceTest.java
@@ -74,7 +74,7 @@ public void testGenericServiceException() {
             ReferenceConfig<DemoService> reference = new ReferenceConfig<DemoService>();
             reference.setApplication(new ApplicationConfig("generic-consumer"));
             reference.setInterface(DemoService.class);
-            reference.setUrl("dubbo://127.0.0.1:29581?generic=true");
+            reference.setUrl("dubbo://127.0.0.1:29581?generic=true&timeout=3000");
             DemoService demoService = reference.get();
             try {
                 // say name
@@ -113,7 +113,7 @@ public void testGenericReferenceException() {
             ReferenceConfig<GenericService> reference = new ReferenceConfig<GenericService>();
             reference.setApplication(new ApplicationConfig("generic-consumer"));
             reference.setInterface(DemoService.class);
-            reference.setUrl("dubbo://127.0.0.1:29581?scope=remote");
+            reference.setUrl("dubbo://127.0.0.1:29581?scope=remote&timeout=3000");
             reference.setGeneric(true);
             GenericService genericService = reference.get();
             try {
@@ -147,7 +147,7 @@ public void testGenericSerializationJava() throws Exception {
             ReferenceConfig<GenericService> reference = new ReferenceConfig<GenericService>();
             reference.setApplication(new ApplicationConfig("generic-consumer"));
             reference.setInterface(DemoService.class);
-            reference.setUrl("dubbo://127.0.0.1:29581?scope=remote");
+            reference.setUrl("dubbo://127.0.0.1:29581?scope=remote&timeout=3000");
             reference.setGeneric(Constants.GENERIC_SERIALIZATION_NATIVE_JAVA);
             GenericService genericService = reference.get();
             try {
@@ -216,7 +216,7 @@ public void testGenericInvokeWithBeanSerialization() throws Exception {
             reference = new ReferenceConfig<GenericService>();
             reference.setApplication(new ApplicationConfig("bean-consumer"));
             reference.setInterface(DemoService.class);
-            reference.setUrl("dubbo://127.0.0.1:29581?scope=remote");
+            reference.setUrl("dubbo://127.0.0.1:29581?scope=remote&timeout=3000");
             reference.setGeneric(Constants.GENERIC_SERIALIZATION_BEAN);
             GenericService genericService = reference.get();
             User user = new User();
@@ -270,7 +270,7 @@ public void testGenericImplementationWithBeanSerialization() throws Exception {
             ref = new ReferenceConfig<DemoService>();
             ref.setApplication(new ApplicationConfig("bean-consumer"));
             ref.setInterface(DemoService.class);
-            ref.setUrl("dubbo://127.0.0.1:29581?scope=remote&generic=bean");
+            ref.setUrl("dubbo://127.0.0.1:29581?scope=remote&generic=bean&timeout=3000");
             DemoService demoService = ref.get();
             User user = new User();
             user.setName("zhangsan");
diff --git a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/cache/CacheTest.java b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/cache/CacheTest.java
index 0cdcabdd71..d69eeb8677 100644
--- a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/cache/CacheTest.java
+++ b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/cache/CacheTest.java
@@ -46,7 +46,7 @@ private void testCache(String type) throws Exception {
         ServiceConfig<CacheService> service = new ServiceConfig<CacheService>();
         service.setApplication(new ApplicationConfig("cache-provider"));
         service.setRegistry(new RegistryConfig("N/A"));
-        service.setProtocol(new ProtocolConfig("dubbo", 29582));
+        service.setProtocol(new ProtocolConfig("injvm"));
         service.setInterface(CacheService.class.getName());
         service.setRef(new CacheServiceImpl());
         service.export();
@@ -54,7 +54,7 @@ private void testCache(String type) throws Exception {
             ReferenceConfig<CacheService> reference = new ReferenceConfig<CacheService>();
             reference.setApplication(new ApplicationConfig("cache-consumer"));
             reference.setInterface(CacheService.class);
-            reference.setUrl("dubbo://127.0.0.1:29582?scope=remote&cache=true");
+            reference.setUrl("injvm://127.0.0.1?scope=remote&cache=true");
 
             MethodConfig method = new MethodConfig();
             method.setName("findCache");
diff --git a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/ConfigTest.java b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/ConfigTest.java
index 5698277bdd..d9ac2f2f54 100644
--- a/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/ConfigTest.java
+++ b/dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/ConfigTest.java
@@ -96,7 +96,7 @@ public void testServiceClass() {
         ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(ConfigTest.class.getPackage().getName().replace('.', '/') + "/service-class.xml");
         ctx.start();
         try {
-            DemoService demoService = refer("dubbo://127.0.0.1:20887");
+            DemoService demoService = refer("dubbo://127.0.0.1:30887");
             String hello = demoService.sayName("hello");
             assertEquals("welcome:hello", hello);
         } finally {
diff --git a/dubbo-registry/dubbo-registry-api/src/test/java/org/apache/dubbo/registry/support/AbstractRegistryTest.java b/dubbo-registry/dubbo-registry-api/src/test/java/org/apache/dubbo/registry/support/AbstractRegistryTest.java
index b1debab285..16ffd8579d 100644
--- a/dubbo-registry/dubbo-registry-api/src/test/java/org/apache/dubbo/registry/support/AbstractRegistryTest.java
+++ b/dubbo-registry/dubbo-registry-api/src/test/java/org/apache/dubbo/registry/support/AbstractRegistryTest.java
@@ -47,9 +47,9 @@
 
     @Before
     public void init() {
-        URL url = URL.valueOf("dubbo://" + NetUtils.getLocalAddress().getHostName() + ":2233");
-        testUrl = URL.valueOf("http://1.2.3.4:9090/registry?check=false&file=N/A&interface=com.test");
-        mockUrl = new URL("dubbo", "127.0.0.0", 2200);
+        URL url = URL.valueOf("dubbo://192.168.0.2:2233");
+        testUrl = URL.valueOf("http://192.168.0.3:9090/registry?check=false&file=N/A&interface=com.test");
+        mockUrl = new URL("dubbo", "192.168.0.1", 2200);
 
         parametersConsumer.put("application", "demo-consumer");
         parametersConsumer.put("category", "consumer");
@@ -115,7 +115,7 @@ public void testRegisterIfURLNULL() throws Exception {
     @Test
     public void testUnregister() throws Exception {
         //test one unregister
-        URL url = new URL("dubbo", "127.0.0.0", 2200);
+        URL url = new URL("dubbo", "192.168.0.1", 2200);
         abstractRegistry.getRegistered().add(url);
         abstractRegistry.unregister(url);
         Assert.assertThat(false, Matchers.equalTo(abstractRegistry.getRegistered().contains(url)));
@@ -145,7 +145,7 @@ public void testSubscribeAndUnsubscribe() throws Exception {
         //test subscribe
         final AtomicReference<Boolean> notified = new AtomicReference<Boolean>(false);
         NotifyListener listener = urls -> notified.set(Boolean.TRUE);
-        URL url = new URL("dubbo", "127.0.0.0", 2200);
+        URL url = new URL("dubbo", "192.168.0.1", 2200);
         abstractRegistry.subscribe(url, listener);
         Set<NotifyListener> subscribeListeners = abstractRegistry.getSubscribed().get(url);
         Assert.assertThat(true, Matchers.equalTo(subscribeListeners.contains(listener)));
@@ -159,7 +159,7 @@ public void testSubscribeAndUnsubscribe() throws Exception {
     public void testSubscribeIfUrlNull() throws Exception {
         final AtomicReference<Boolean> notified = new AtomicReference<Boolean>(false);
         NotifyListener listener = urls -> notified.set(Boolean.TRUE);
-        URL url = new URL("dubbo", "127.0.0.0", 2200);
+        URL url = new URL("dubbo", "192.168.0.1", 2200);
         abstractRegistry.subscribe(null, listener);
         Assert.fail("subscribe url == null");
     }
@@ -168,7 +168,7 @@ public void testSubscribeIfUrlNull() throws Exception {
     public void testSubscribeIfListenerNull() throws Exception {
         final AtomicReference<Boolean> notified = new AtomicReference<Boolean>(false);
         NotifyListener listener = urls -> notified.set(Boolean.TRUE);
-        URL url = new URL("dubbo", "127.0.0.0", 2200);
+        URL url = new URL("dubbo", "192.168.0.1", 2200);
         abstractRegistry.subscribe(url, null);
         Assert.fail("listener url == null");
     }
@@ -184,7 +184,7 @@ public void testUnsubscribeIfUrlNull() throws Exception {
     @Test(expected = IllegalArgumentException.class)
     public void testUnsubscribeIfNotifyNull() throws Exception {
         final AtomicReference<Boolean> notified = new AtomicReference<Boolean>(false);
-        URL url = new URL("dubbo", "127.0.0.0", 2200);
+        URL url = new URL("dubbo", "192.168.0.1", 2200);
         abstractRegistry.unsubscribe(url, null);
         Assert.fail("unsubscribe listener == null");
     }
@@ -293,13 +293,13 @@ public void testRecover2() throws Exception {
     public void testNotify() throws Exception {
         final AtomicReference<Boolean> notified = new AtomicReference<Boolean>(false);
         NotifyListener listner1 = urls -> notified.set(Boolean.TRUE);
-        URL url1 = new URL("dubbo", "127.0.0.0", 2200, parametersConsumer);
+        URL url1 = new URL("dubbo", "192.168.0.1", 2200, parametersConsumer);
         abstractRegistry.subscribe(url1, listner1);
         NotifyListener listner2 = urls -> notified.set(Boolean.TRUE);
-        URL url2 = new URL("dubbo", "127.0.0.1", 2201, parametersConsumer);
+        URL url2 = new URL("dubbo", "192.168.0.2", 2201, parametersConsumer);
         abstractRegistry.subscribe(url2, listner2);
         NotifyListener listner3 = urls -> notified.set(Boolean.TRUE);
-        URL url3 = new URL("dubbo", "127.0.0.2", 2202, parametersConsumer);
+        URL url3 = new URL("dubbo", "192.168.0.3", 2202, parametersConsumer);
         abstractRegistry.subscribe(url3, listner3);
         List<URL> urls = new ArrayList<>();
         urls.add(url1);
@@ -319,13 +319,13 @@ public void testNotify() throws Exception {
     public void testNotifyList() throws Exception {
         final AtomicReference<Boolean> notified = new AtomicReference<Boolean>(false);
         NotifyListener listner1 = urls -> notified.set(Boolean.TRUE);
-        URL url1 = new URL("dubbo", "127.0.0.0", 2200, parametersConsumer);
+        URL url1 = new URL("dubbo", "192.168.0.1", 2200, parametersConsumer);
         abstractRegistry.subscribe(url1, listner1);
         NotifyListener listner2 = urls -> notified.set(Boolean.TRUE);
-        URL url2 = new URL("dubbo", "127.0.0.1", 2201, parametersConsumer);
+        URL url2 = new URL("dubbo", "192.168.0.2", 2201, parametersConsumer);
         abstractRegistry.subscribe(url2, listner2);
         NotifyListener listner3 = urls -> notified.set(Boolean.TRUE);
-        URL url3 = new URL("dubbo", "127.0.0.2", 2202, parametersConsumer);
+        URL url3 = new URL("dubbo", "192.168.0.3", 2202, parametersConsumer);
         abstractRegistry.subscribe(url3, listner3);
         List<URL> urls = new ArrayList<>();
         urls.add(url1);
@@ -342,13 +342,13 @@ public void testNotifyList() throws Exception {
     public void testNotifyIfURLNull() throws Exception {
         final AtomicReference<Boolean> notified = new AtomicReference<Boolean>(false);
         NotifyListener listner1 = urls -> notified.set(Boolean.TRUE);
-        URL url1 = new URL("dubbo", "127.0.0.0", 2200, parametersConsumer);
+        URL url1 = new URL("dubbo", "192.168.0.1", 2200, parametersConsumer);
         abstractRegistry.subscribe(url1, listner1);
         NotifyListener listner2 = urls -> notified.set(Boolean.TRUE);
-        URL url2 = new URL("dubbo", "127.0.0.1", 2201, parametersConsumer);
+        URL url2 = new URL("dubbo", "192.168.0.2", 2201, parametersConsumer);
         abstractRegistry.subscribe(url2, listner2);
         NotifyListener listner3 = urls -> notified.set(Boolean.TRUE);
-        URL url3 = new URL("dubbo", "127.0.0.2", 2202, parametersConsumer);
+        URL url3 = new URL("dubbo", "192.168.0.3", 2202, parametersConsumer);
         abstractRegistry.subscribe(url3, listner3);
         List<URL> urls = new ArrayList<>();
         urls.add(url1);
@@ -362,13 +362,13 @@ public void testNotifyIfURLNull() throws Exception {
     public void testNotifyIfNotifyNull() {
         final AtomicReference<Boolean> notified = new AtomicReference<Boolean>(false);
         NotifyListener listner1 = urls -> notified.set(Boolean.TRUE);
-        URL url1 = new URL("dubbo", "127.0.0.0", 2200, parametersConsumer);
+        URL url1 = new URL("dubbo", "192.168.0.1", 2200, parametersConsumer);
         abstractRegistry.subscribe(url1, listner1);
         NotifyListener listner2 = urls -> notified.set(Boolean.TRUE);
-        URL url2 = new URL("dubbo", "127.0.0.1", 2201, parametersConsumer);
+        URL url2 = new URL("dubbo", "192.168.0.2", 2201, parametersConsumer);
         abstractRegistry.subscribe(url2, listner2);
         NotifyListener listner3 = urls -> notified.set(Boolean.TRUE);
-        URL url3 = new URL("dubbo", "127.0.0.2", 2202, parametersConsumer);
+        URL url3 = new URL("dubbo", "192.168.0.3", 2202, parametersConsumer);
         abstractRegistry.subscribe(url3, listner3);
         List<URL> urls = new ArrayList<>();
         urls.add(url1);
@@ -507,9 +507,9 @@ public void allTest() throws Exception {
 
     private List<URL> getList() {
         List<URL> list = new ArrayList<>();
-        URL url1 = new URL("dubbo", "127.0.0.0", 1000);
-        URL url2 = new URL("dubbo", "127.0.0.1", 1001);
-        URL url3 = new URL("dubbo", "127.0.0.2", 1002);
+        URL url1 = new URL("dubbo", "192.168.0.1", 1000);
+        URL url2 = new URL("dubbo", "192.168.0.2", 1001);
+        URL url3 = new URL("dubbo", "192.168.0.3", 1002);
         list.add(url1);
         list.add(url2);
         list.add(url3);
diff --git a/dubbo-remoting/dubbo-remoting-netty/src/test/java/org/apache/dubbo/remoting/transport/netty/ClientReconnectTest.java b/dubbo-remoting/dubbo-remoting-netty/src/test/java/org/apache/dubbo/remoting/transport/netty/ClientReconnectTest.java
index b29b20c70f..1444f9bb6f 100644
--- a/dubbo-remoting/dubbo-remoting-netty/src/test/java/org/apache/dubbo/remoting/transport/netty/ClientReconnectTest.java
+++ b/dubbo-remoting/dubbo-remoting-netty/src/test/java/org/apache/dubbo/remoting/transport/netty/ClientReconnectTest.java
@@ -80,7 +80,7 @@ public void testReconnect() throws RemotingException, InterruptedException {
     public void testReconnectWarnLog() throws RemotingException, InterruptedException {
         int port = NetUtils.getAvailablePort();
         DubboAppender.doStart();
-        String url = "exchange://127.0.0.2:" + port + "/client.reconnect.test?check=false&client=netty3&"
+        String url = "exchange://127.0.0.1:" + port + "/client.reconnect.test?check=false&client=netty3&"
                 + Constants.RECONNECT_KEY + "=" + 1; //1ms reconnect, ensure that there is enough frequency to reconnect
         try {
             Exchangers.connect(url);
diff --git a/dubbo-remoting/dubbo-remoting-netty/src/test/java/org/apache/dubbo/remoting/transport/netty/NettyClientToServerTest.java b/dubbo-remoting/dubbo-remoting-netty/src/test/java/org/apache/dubbo/remoting/transport/netty/NettyClientToServerTest.java
index 56a9882276..a2cff1dcc2 100644
--- a/dubbo-remoting/dubbo-remoting-netty/src/test/java/org/apache/dubbo/remoting/transport/netty/NettyClientToServerTest.java
+++ b/dubbo-remoting/dubbo-remoting-netty/src/test/java/org/apache/dubbo/remoting/transport/netty/NettyClientToServerTest.java
@@ -33,7 +33,7 @@ protected ExchangeServer newServer(int port, Replier<?> receiver) throws Remotin
     }
 
     protected ExchangeChannel newClient(int port) throws RemotingException {
-        return Exchangers.connect(URL.valueOf("exchange://localhost:" + port + "?client=netty3"));
+        return Exchangers.connect(URL.valueOf("exchange://localhost:" + port + "?client=netty3&timeout=3000"));
     }
 
 }
\ No newline at end of file
diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/telnet/PortTelnetHandlerTest.java b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/telnet/PortTelnetHandlerTest.java
index 611008e49e..ff6ec433c3 100644
--- a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/telnet/PortTelnetHandlerTest.java
+++ b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/org/apache/dubbo/rpc/protocol/dubbo/telnet/PortTelnetHandlerTest.java
@@ -27,7 +27,9 @@
 import org.apache.dubbo.rpc.protocol.dubbo.support.ProtocolUtils;
 
 import org.junit.After;
+import org.junit.AfterClass;
 import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
@@ -41,11 +43,11 @@
 public class PortTelnetHandlerTest {
 
     private static TelnetHandler port = new PortTelnetHandler();
-    private Invoker<DemoService> mockInvoker;
+    private static Invoker<DemoService> mockInvoker;
 
     @SuppressWarnings("unchecked")
-    @Before
-    public void before() {
+    @BeforeClass
+    public static void before() {
         mockInvoker = mock(Invoker.class);
         given(mockInvoker.getInterface()).willReturn(DemoService.class);
         given(mockInvoker.getUrl()).willReturn(URL.valueOf("dubbo://127.0.0.1:20887/demo"));
@@ -53,8 +55,8 @@ public void before() {
         DubboProtocol.getDubboProtocol().export(mockInvoker);
     }
 
-    @After
-    public void after() {
+    @AfterClass
+    public static void after() {
         ProtocolUtils.closeAll();
     }
 
diff --git a/dubbo-rpc/dubbo-rpc-webservice/src/test/java/org/apache/dubbo/rpc/protocol/webservice/WebserviceProtocolTest.java b/dubbo-rpc/dubbo-rpc-webservice/src/test/java/org/apache/dubbo/rpc/protocol/webservice/WebserviceProtocolTest.java
index e668bcbd63..576302642c 100644
--- a/dubbo-rpc/dubbo-rpc-webservice/src/test/java/org/apache/dubbo/rpc/protocol/webservice/WebserviceProtocolTest.java
+++ b/dubbo-rpc/dubbo-rpc-webservice/src/test/java/org/apache/dubbo/rpc/protocol/webservice/WebserviceProtocolTest.java
@@ -37,7 +37,7 @@
     public void testDemoProtocol() throws Exception {
         DemoService service = new DemoServiceImpl();
         protocol.export(proxy.getInvoker(service, DemoService.class, URL.valueOf("webservice://127.0.0.1:9019/" + DemoService.class.getName() + "?codec=exchange")));
-        service = proxy.getProxy(protocol.refer(DemoService.class, URL.valueOf("webservice://127.0.0.1:9019/" + DemoService.class.getName() + "?codec=exchange")));
+        service = proxy.getProxy(protocol.refer(DemoService.class, URL.valueOf("webservice://127.0.0.1:9019/" + DemoService.class.getName() + "?codec=exchange&timeout=3000")));
         assertEquals(service.getSize(new String[]{"", "", ""}), 3);
     }
 
@@ -45,7 +45,7 @@ public void testDemoProtocol() throws Exception {
     public void testWebserviceProtocol() throws Exception {
         DemoService service = new DemoServiceImpl();
         protocol.export(proxy.getInvoker(service, DemoService.class, URL.valueOf("webservice://127.0.0.1:9019/" + DemoService.class.getName())));
-        service = proxy.getProxy(protocol.refer(DemoService.class, URL.valueOf("webservice://127.0.0.1:9019/" + DemoService.class.getName())));
+        service = proxy.getProxy(protocol.refer(DemoService.class, URL.valueOf("webservice://127.0.0.1:9019/" + DemoService.class.getName() + "?timeout=3000")));
         assertEquals(service.create(1,"kk").getName(), "kk");
         assertEquals(service.getSize(null), -1);
         assertEquals(service.getSize(new String[]{"", "", ""}), 3);


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org