@Test
public void testIsRestartRequiredAfterRackChange() throws Exception {

  String serviceInfoXml = "<metainfo>\n" +
      "  <schemaVersion>2.0</schemaVersion>\n" +
      "  <services>\n" +
      "    <service>\n" +
      "      <name>RESTART</name>\n" +
      "      <displayName>RESTART</displayName>\n" +
      "      <comment>Apache Hadoop Distributed File System</comment>\n" +
      "      <version>2.1.0.2.0</version>\n" +
      "      <restartRequiredAfterRackChange>true</restartRequiredAfterRackChange>\n" +
      "    </service>\n" +
      "    <service>\n" +
      "      <name>NO_RESTART</name>\n" +
      "      <displayName>NO_RESTART</displayName>\n" +
      "      <comment>Apache Hadoop Distributed File System</comment>\n" +
      "      <version>2.1.0.2.0</version>\n" +
      "      <restartRequiredAfterRackChange>false</restartRequiredAfterRackChange>\n" +
      "    </service>\n" +
      "    <service>\n" +
      "      <name>DEFAULT_RESTART</name>\n" +
      "      <displayName>DEFAULT_RESTART</displayName>\n" +
      "      <comment>Apache Hadoop Distributed File System</comment>\n" +
      "      <version>2.1.0.2.0</version>\n" +
      "    </service>\n" +
      "    <service>\n" +
      "      <name>HCFS_SERVICE</name>\n" +
      "      <displayName>HCFS_SERVICE</displayName>\n" +
      "      <comment>Hadoop Compatible File System</comment>\n" +
      "      <version>2.1.1.0</version>\n" +
      "      <serviceType>HCFS</serviceType>\n" +
      "    </service>\n" +
      "  </services>\n" +
      "</metainfo>\n";
  
  Map<String, ServiceInfo> serviceInfoMap = getServiceInfo(serviceInfoXml);
  assertTrue(serviceInfoMap.get("RESTART").isRestartRequiredAfterRackChange());
  assertFalse(serviceInfoMap.get("NO_RESTART").isRestartRequiredAfterRackChange());
  assertNull(serviceInfoMap.get("DEFAULT_RESTART").isRestartRequiredAfterRackChange());
  assertEquals(serviceInfoMap.get("HCFS_SERVICE").getServiceType(),"HCFS");
}