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/02 15:50:15 UTC

[GitHub] carryxyh commented on a change in pull request #2409: [Dubbo-2348 ] AbstractRegistry util test enhancement

carryxyh commented on a change in pull request #2409: [Dubbo-2348 ] AbstractRegistry util test enhancement
URL: https://github.com/apache/incubator-dubbo/pull/2409#discussion_r214545166
 
 

 ##########
 File path: dubbo-registry/dubbo-registry-api/src/test/java/org/apache/dubbo/registry/support/AbstractRegistryTest.java
 ##########
 @@ -515,4 +518,19 @@ public void allTest() throws Exception {
         list.add(url3);
         return list;
     }
+
+    @Test
+    public void getCacheUrlsTest(){
+        List<URL> urls = new ArrayList<>();
+        urls.add(testUrl);
+        // check if notify successfully
+        Assert.assertFalse(notifySuccess);
+        abstractRegistry.notify(testUrl, listener, urls);
+        Assert.assertTrue(notifySuccess);
+        List<URL> cacheUrl = abstractRegistry.getCacheUrls( testUrl );
+        Assert.assertTrue( cacheUrl.size() == 1 );
+        URL nullUrl = URL.valueOf("http://1.2.3.4:9090/registry?check=false&file=N/A&interface=com.testa");
+        cacheUrl = abstractRegistry.getCacheUrls( nullUrl );
+        Assert.assertTrue( Objects.isNull( cacheUrl ) );
 
 Review comment:
   Here, too.

----------------------------------------------------------------
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