test_class.file: dubbo-remoting/dubbo-remoting-p2p/src/test/java/org/apache/dubbo/remoting/p2p/exchange/support/MulticastExchangeNetworkerTest.java
test_class.identifier: MulticastExchangeNetworkerTest
test_case.body: @Test
      public void testJoin() throws RemotingException, InterruptedException {
          final String groupURL = "multicast://224.5.6.7:1234";
  
          MulticastExchangeNetworker multicastExchangeNetworker = new MulticastExchangeNetworker();
  
          final CountDownLatch countDownLatch = new CountDownLatch(1);
          Peer peer1 = multicastExchangeNetworker.lookup(URL.valueOf(groupURL))
                  .join(URL.valueOf("exchange://0.0.0.0:" + NetUtils.getAvailablePort() + "?exchanger=header"), new ExchangeHandlerAdapter() {
                      @Override
                      public CompletableFuture<Object> reply(ExchangeChannel channel, Object msg) throws RemotingException {
                          countDownLatch.countDown();
                          return super.reply(channel, msg);
                      }
                  });
          Peer peer2 = multicastExchangeNetworker.lookup(URL.valueOf(groupURL))
                  .join(URL.valueOf("exchange://0.0.0.0:" + NetUtils.getAvailablePort() + "?exchanger=header"), mock(ExchangeHandler.class));
  
          while (true) {
              for (Channel channel : peer1.getChannels()) {
                  channel.send("hello multicast exchange network!");
              }
              TimeUnit.MILLISECONDS.sleep(50);
  
              long count = countDownLatch.getCount();
              if (count > 0) {
                  break;
              }
          }
  
          Group lookup = Networkers.lookup(groupURL);
          assertThat(lookup, not(nullValue()));
  
          assertThat(peer1, instanceOf(ExchangeServerPeer.class));
  
          peer1.close();
          peer2.close();
      }
test_case.class_method_signature: MulticastExchangeNetworkerTest.testJoin()
test_case.full_signature: @Test public void testJoin()
test_case.identifier: testJoin
test_case.invocations: join lookup valueOf valueOf getAvailablePort countDown reply join lookup valueOf valueOf getAvailablePort mock getChannels send sleep getCount lookup assertThat not nullValue assertThat instanceOf close close
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testJoin()
focal_class.file: dubbo-remoting/dubbo-remoting-p2p/src/main/java/org/apache/dubbo/remoting/p2p/exchange/support/MulticastExchangeNetworker.java
focal_class.identifier: MulticastExchangeNetworker
focal_class.interfaces: implements ExchangeNetworker
focal_class.class_method_signature: MulticastExchangeNetworker.lookup(URL url)
focal_class.full_signature: @Override public ExchangeGroup lookup(URL url)
focal_class.identifier: lookup
focal_class.modifiers: @Override public
focal_class.parameters: (URL url)
focal_class.return: ExchangeGroup
focal_class.signature: ExchangeGroup lookup(URL url)
focal_method.body: @Override
      public ExchangeGroup lookup(URL url) throws RemotingException {
          return new MulticastExchangeGroup(url);
      }
focal_method.class_method_signature: MulticastExchangeNetworker.lookup(URL url)
focal_method.full_signature: @Override public ExchangeGroup lookup(URL url)
focal_method.identifier: lookup
focal_method.modifiers: @Override public
focal_method.parameters: (URL url)
focal_method.return: ExchangeGroup
focal_method.signature: ExchangeGroup lookup(URL url)