Exemplo n.º 1
0
 @Test
 public void testWrite() throws Exception {
   try {
     fileManager_.write(TEST_FILE_COPY, Files.readAllBytes(TEST_FILE), true);
     assertTrue(Files.exists(TEST_FILE_COPY));
   } finally {
     if (Files.exists(TEST_FILE_COPY)) {
       Files.delete(TEST_FILE_COPY);
     }
   }
 }
Exemplo n.º 2
0
 @Test
 public void testDelete() throws Exception {
   try {
     Files.copy(TEST_FILE, TEST_FILE_COPY);
     fileManager_.delete(TEST_FILE_COPY);
     assertTrue(!Files.exists(TEST_FILE_COPY));
   } finally {
     if (Files.exists(TEST_FILE_COPY)) {
       Files.delete(TEST_FILE_COPY);
     }
   }
 }
Exemplo n.º 3
0
 @Test
 public void testResolve() {
   Path resolved = fileManager_.resolve(TEST_FILE_RELATIVE.toString()).toAbsolutePath();
   assertEquals(TEST_FILE.toAbsolutePath(), resolved);
 }
Exemplo n.º 4
0
 @Test
 public void testEnsureRelative() {
   Path relative = fileManager_.ensureRelative(TEST_FILE);
   assertEquals(TEST_FILE_RELATIVE, relative);
 }
Exemplo n.º 5
0
 @Test
 public void testExists() {
   assertTrue(fileManager_.exists(TEST_FILE));
 }