[jboss-dev-forums] [Design the new POJO MicroContainer] - VFS locking
scott.stark@jboss.org
do-not-reply at jboss.com
Fri Jun 20 10:21:39 EDT 2008
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");
| tmpRoot.delete();
| tmpRoot.mkdir();
| 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?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159578#4159578
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159578
More information about the jboss-dev-forums
mailing list