7 Replies Latest reply on Jun 30, 2008 3:54 PM by Scott Stark

    VFS locking

    Scott Stark Master

      Related to the profileservice tests on win32, I started adding an hdscanner/profileservice repository mock up. However, I see that there are some tests that don't validate file deletion when run on win32, for example this FileVFSUnitTestCase test where the assertion is 'tmp.delete() || isWindowsOS()':

       public void testFileExists()
       throws Exception
       File tmpRoot = File.createTempFile("vfs", ".root");
       File tmp = File.createTempFile("testFileExists", null, tmpRoot);
       log.info("+++ testFileExists, tmp="+tmp.getCanonicalPath());
       URL rootURL = tmpRoot.toURL();
       VFS vfs = VFS.getVFS(rootURL);
       VirtualFile tmpVF = vfs.findChild(tmp.getName());
       assertTrue(tmpVF.getPathName()+".exists()", tmpVF.exists());
       assertTrue("tmp.delete()", tmp.delete() || isWindowsOS());
       assertFalse(tmpVF.getPathName()+".exists()", tmpVF.exists() && isWindowsOS() == false);
       assertTrue(tmpRoot+".delete()", tmpRoot.delete() || isWindowsOS());

      What is the point of not checking the delete return value under win32?