Skip to content

Commit

Permalink
symlink creation now broken on osx 10.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
twall committed May 1, 2013
1 parent 25d1b11 commit e359777
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
19 changes: 7 additions & 12 deletions contrib/platform/test/com/sun/jna/platform/FileUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void testMoveToTrash() throws Exception {
File tmpdir = new File(System.getProperty("java.io.tmpdir"));
File file = File.createTempFile(getName(), ".tmp", tmpdir);
try {
assertTrue("File should exist", file.exists());
assertTrue("Original source file missing: " + file, file.exists());
try {
utils.moveToTrash(new File[] { file });
}
Expand All @@ -38,9 +38,7 @@ public void testMoveToTrash() throws Exception {
assertFalse("File still exists after move to trash: " + file, file.exists());
}
finally {
if (file.exists()) {
file.delete();
}
file.delete();
}
}

Expand All @@ -55,9 +53,10 @@ public void testMoveSymlinkToTrash() throws Exception {
File tmpdir = new File(System.getProperty("java.io.tmpdir"));
File file = File.createTempFile(getName(), ".tmp", tmpdir);
File symlink = new File(tmpdir, file.getName() + ".link");
Runtime.getRuntime().exec(new String[] { "ln", "-s", file.getAbsolutePath(), symlink.getAbsolutePath() });
try {
assertTrue("File should exist", symlink.exists());
Runtime.getRuntime().exec(new String[] { "ln", "-s", file.getAbsolutePath(), symlink.getAbsolutePath() });
assertTrue("Original source file missing: " + file, file.exists());
assertTrue("Symlink creation failed (missing): " + symlink, symlink.exists());
try {
utils.moveToTrash(new File[] { symlink });
}
Expand All @@ -68,12 +67,8 @@ public void testMoveSymlinkToTrash() throws Exception {
assertTrue("Original file should still exist after move to trash: " + file, file.exists());
}
finally {
if (symlink.exists()) {
symlink.delete();
}
if (file.exists()) {
file.delete();
}
symlink.delete();
file.delete();
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/com/sun/jna/CallbacksTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ public void callback() {
1, threads.size());
}

// Thread object is never GC'd on linux-amd64 and (sometimes) win32-amd64
// Thread object is never GC'd on linux-amd64 and darwin-amd64 (w/openjdk7)
public void testAttachedThreadCleanupOnExit() throws Exception {
final Set threads = new HashSet();
final int[] called = { 0 };
Expand Down

0 comments on commit e359777

Please sign in to comment.