From 4ba6304f2cc90d3816f7a170eddd8dd80ba19d64 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Wed, 18 Jul 2012 12:18:18 +0200 Subject: [PATCH] Cleanup after file watcher subst test --- .../intellij/openapi/vfs/local/FileWatcherTest.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/FileWatcherTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/FileWatcherTest.java index 35ba78569a92..050a4f179b69 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/FileWatcherTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/FileWatcherTest.java @@ -25,6 +25,7 @@ import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vfs.*; import com.intellij.openapi.vfs.impl.local.FileWatcher; import com.intellij.openapi.vfs.newvfs.BulkFileListener; +import com.intellij.openapi.vfs.newvfs.NewVirtualFile; import com.intellij.openapi.vfs.newvfs.events.VFileContentChangeEvent; import com.intellij.openapi.vfs.newvfs.events.VFileCreateEvent; import com.intellij.openapi.vfs.newvfs.events.VFileDeleteEvent; @@ -393,8 +394,7 @@ public class FileWatcherTest extends PlatformLangTestCase { } */ - @SuppressWarnings("UnusedDeclaration") - public void _testSubst() throws Exception { + public void testSubst() throws Exception { if (!SystemInfo.isWindows) { System.err.println("Ignored: Windows required"); return; @@ -421,9 +421,12 @@ public class FileWatcherTest extends PlatformLangTestCase { final int rv = new GeneralCommandLine("subst", subst + ":", targetDir.getAbsolutePath()).createProcess().waitFor(); assertEquals(0, rv); - final String substRoot = (subst + ":\\").toUpperCase(Locale.US); + final String substRoot = (subst + ":").toUpperCase(Locale.US); VirtualDirectoryImpl.allowRootAccess(substRoot); + final VirtualFile vfsRoot = myFileSystem.findFileByPath(substRoot); + assertNotNull(substRoot, vfsRoot); + try { final File substDir = new File(substRoot, subDir.getName()); final File substFile = new File(substDir, file.getName()); @@ -457,6 +460,7 @@ public class FileWatcherTest extends PlatformLangTestCase { finally { delete(targetDir); new GeneralCommandLine("subst", subst + ":", "/d").createProcess().waitFor(); + ((NewVirtualFile)vfsRoot).markDirty(); myFileSystem.refresh(false); VirtualDirectoryImpl.disallowRootAccess(substRoot); }