コード例 #1
0
 @Test
 public void testDestroy_WithDestroyRegistry() {
   RegistryDirectory registryDirectory = getRegistryDirectory();
   CountDownLatch latch = new CountDownLatch(1);
   registryDirectory.setRegistry(new MockRegistry(latch));
   registryDirectory.subscribe(
       URL.valueOf("consumer://" + NetUtils.getLocalHost() + "/DemoService?category=providers"));
   registryDirectory.destroy();
   Assert.assertEquals(0, latch.getCount());
 }
コード例 #2
0
 @Test
 public void testDestroy_WithDestroyRegistry_WithError() {
   RegistryDirectory registryDirectory = getRegistryDirectory();
   registryDirectory.setRegistry(new MockRegistry(true));
   registryDirectory.destroy();
 }