hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/node/TestNodeManager.java
@Test
  public void testScmHealthyNodeCount() throws IOException,
      InterruptedException, TimeoutException {
    OzoneConfiguration conf = getConf();
    final int count = 10;

    try (SCMNodeManager nodeManager = createNodeManager(conf)) {

      for (int x = 0; x < count; x++) {
        DatanodeDetails datanodeDetails = TestUtils.getDatanodeDetails(
            nodeManager);
        nodeManager.sendHeartbeat(datanodeDetails.getProtoBufMessage(),
            null, reportState);
      }
      GenericTestUtils.waitFor(() -> nodeManager.waitForHeartbeatProcessed(),
          100, 4 * 1000);
      assertEquals(count, nodeManager.getNodeCount(HEALTHY));
    }
  }
/**
   * Asserts that we detect as many healthy nodes as we have generated heartbeat
   * for.
   *
   * @throws IOException
   * @throws InterruptedException
   * @throws TimeoutException
   */
Asserts that we detect as many healthy nodes as we have generated heartbeat
for.


Asserts that we detect as many healthy nodes as we have generated heartbeat for .
@Test
  public void testScmHealthyNodeCount() throws IOException,
      InterruptedException, TimeoutException {
    OzoneConfiguration conf = getConf();
    final int count = 10;
    try (SCMNodeManager nodeManager = createNodeManager(conf)) {
      for (int x = 0; x < count; x++) {
        DatanodeDetails datanodeDetails = TestUtils.getDatanodeDetails(
            nodeManager);
        nodeManager.sendHeartbeat(datanodeDetails.getProtoBufMessage(),
            null, reportState);
      }
      GenericTestUtils.waitFor(() -> nodeManager.waitForHeartbeatProcessed(),
          100, 4 * 1000);
      assertEquals(count, nodeManager.getNodeCount(HEALTHY));
    }
  }
@ Test public void testScmHealthyNodeCount ( ) throws IOException , InterruptedException , TimeoutException { OzoneConfiguration conf = getConf ( ) ; final int count = 10 ; try ( SCMNodeManager nodeManager = createNodeManager ( conf ) ) { for ( int x = 0 ; x < count ; x ++ ) { DatanodeDetails datanodeDetails = TestUtils . getDatanodeDetails ( nodeManager ) ; nodeManager . sendHeartbeat ( datanodeDetails . getProtoBufMessage ( ) , null , reportState ) ; } GenericTestUtils . waitFor ( ( ) -> nodeManager . waitForHeartbeatProcessed ( ) , 100 , 4 * 1000 ) ; assertEquals ( count , nodeManager . getNodeCount ( HEALTHY ) ) ; } }
Asserts that we detect as many healthy nodes as we have generated heartbeat
 for.
Asserts that we detect as many healthy nodes as we have generated heartbeat for .