[JENKINS-26519] Attempting to improve diagnostics in case rename fails.

(cherry picked from commit 0633beef08)
This commit is contained in:
Jesse Glick committed 2015-01-30 10:08:42 -05:00
1 parent 1debf06fe6
commit 4a75e058ba
2 files changed
+56 -9

No files matched your search

@@ -27,6 +27,7 @@ package jenkins.model;
import hudson.Util;
import hudson.util.StreamTaskListener;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Map;
import java.util.TimeZone;
@@ -173,4 +174,17 @@ public class RunIdMigratorTest {
return m.toString();
}
@Test public void move() throws Exception {
File src = tmp.newFile();
File dest = new File(tmp.getRoot(), "dest");
RunIdMigrator.move(src, dest);
File dest2 = tmp.newFile();
try {
RunIdMigrator.move(dest, dest2);
fail();
} catch (IOException x) {
System.err.println("Got expected move exception: " + x);
}
}
}