@Test
public void testGetApplicationMetainfo() throws Exception {

  String zipFileName = TestUtility.createAppPackage(
      folder,
      "testpkg",
      "test.zip",
      "target/test-classes/org/apache/slider/common/tools/test");
  Configuration configuration = new Configuration();
  FileSystem fs = FileSystem.getLocal(configuration);
  log.info("fs working dir is {}", fs.getWorkingDirectory().toString());
  SliderFileSystem sliderFileSystem = new SliderFileSystem(fs, configuration);
  // Without accompany metainfo file, read metainfo from the zip file
  Metainfo metainfo = AgentUtils.getApplicationMetainfo(
      sliderFileSystem, zipFileName, false);
  Assert.assertNotNull(metainfo.getApplication());
  Assert.assertEquals("STORM", metainfo.getApplication().getName());
  // With accompany metainfo file, read metainfo from the accompany file
  String acompanyFileName = zipFileName + ".metainfo.xml";
  File f = new File(acompanyFileName);
  try (BufferedWriter writer = new BufferedWriter(new FileWriter(f))) {
    writer.write(metainfo_str);
  }
  metainfo = AgentUtils.getApplicationMetainfo(
      sliderFileSystem, zipFileName, false);
  Assert.assertNotNull(metainfo.getApplication());
  Assert.assertEquals("MYTESTAPPLICATION", metainfo.getApplication().getName());
}