Code example for File

Methods: getName

0
    // exists 
    Assert.assertFalse("Node health script should start",
        NodeHealthScriptRunner.shouldRun(conf));
    // Create script path. 
    conf.writeXml(new FileOutputStream(nodeHealthConfigFile));
    conf.addResource(nodeHealthConfigFile.getName());
    writeNodeHealthScriptFile("", false); 
    // Node health script should not start if the node health script is not 
    // executable. 
    Assert.assertFalse("Node health script should start",
        NodeHealthScriptRunner.shouldRun(conf));
    writeNodeHealthScriptFile("", true); 
    Assert.assertTrue("Node health script should start",
        NodeHealthScriptRunner.shouldRun(conf));
  } 
 
  private void setHealthStatus(NodeHealthStatus healthStatus, boolean isHealthy,
      String healthReport, long lastHealthReportTime) {
    healthStatus.setHealthReport(healthReport);
    healthStatus.setIsNodeHealthy(isHealthy);