public void testMoveFailures() throws IOException { File temp1 = createTempFile(); File temp2 = createTempFile(); moveHelper(false, new UnmovableFile(temp1, false, false), temp2); moveHelper( false, new UnmovableFile(temp1, false, false), new UnmovableFile(temp2, true, false)); try { File asciiFile = getTestFile("ascii.txt"); moveHelper(false, asciiFile, asciiFile); fail("expected exception"); } catch (IllegalArgumentException expected) { } }
public void testMove() throws IOException { File i18nFile = getTestFile("i18n.txt"); File temp1 = createTempFile(); File temp2 = createTempFile(); Files.copy(i18nFile, temp1); moveHelper(true, temp1, temp2); assertTrue(Files.equal(temp2, i18nFile)); }
public void testMoveViaCopy() throws IOException { File i18nFile = getTestFile("i18n.txt"); File temp1 = createTempFile(); File temp2 = createTempFile(); Files.copy(i18nFile, temp1); moveHelper(true, new UnmovableFile(temp1, false, true), temp2); assertTrue(Files.equal(temp2, i18nFile)); }
public void testMoveFailures() throws IOException { File temp1 = createTempFile(); File temp2 = createTempFile(); moveHelper(false, new UnmovableFile(temp1, false, false), temp2); moveHelper(false, new UnmovableFile(temp1, false, false), new UnmovableFile(temp2, true, false)); try { File asciiFile = getTestFile("ascii.txt"); moveHelper(false, asciiFile, asciiFile); fail("expected exception"); } catch (IllegalArgumentException expected) { } }
public void testMove() throws IOException { File i18nFile = getTestFile("i18n.txt"); File temp1 = createTempFile(); File temp2 = createTempFile(); Files.copy(i18nFile, temp1); moveHelper(true, temp1, temp2); assertTrue(Files.equal(temp2, i18nFile)); }
public void testMoveViaCopy() throws IOException { File i18nFile = getTestFile("i18n.txt"); File temp1 = createTempFile(); File temp2 = createTempFile(); Files.copy(i18nFile, temp1); moveHelper(true, new UnmovableFile(temp1, false, true), temp2); assertTrue(Files.equal(temp2, i18nFile)); }