@Test
public void testStringToPath() throws IOException {

  Configuration conf = new Configuration();
  JobResourceUploader uploader =
      new JobResourceUploader(FileSystem.getLocal(conf), false);
  Assert.assertEquals("Failed: absolute, no scheme, with fragment",
      "/testWithFragment.txt",
      uploader.stringToPath("/testWithFragment.txt#fragment.txt").toString());
  Assert.assertEquals("Failed: absolute, with scheme, with fragment",
      "file:/testWithFragment.txt",
      uploader.stringToPath("file:///testWithFragment.txt#fragment.txt")
          .toString());
  Assert.assertEquals("Failed: relative, no scheme, with fragment",
      "testWithFragment.txt",
      uploader.stringToPath("testWithFragment.txt#fragment.txt").toString());
  Assert.assertEquals("Failed: relative, no scheme, no fragment",
      "testWithFragment.txt",
      uploader.stringToPath("testWithFragment.txt").toString());
  Assert.assertEquals("Failed: absolute, with scheme, no fragment",
      "file:/testWithFragment.txt",
      uploader.stringToPath("file:///testWithFragment.txt").toString());
}