This commit is contained in:
Roman Shevchenko
2012-02-07 17:24:10 +01:00
parent 4e07e68865
commit 90ceb3e0e7
4 changed files with 11 additions and 16 deletions
@@ -1101,7 +1101,7 @@ public class PersistentFS extends ManagingFS implements ApplicationComponent {
}
@TestOnly
public void cleanPersistedContents() {
public static void cleanPersistedContents() {
try {
final int[] roots = FSRecords.listRoots();
for (int root : roots) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2011 JetBrains s.r.o.
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,10 +20,7 @@ import com.intellij.ide.GeneralSettings;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.SafeWriteRequestor;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.*;
import com.intellij.openapi.vfs.newvfs.ManagingFS;
import com.intellij.openapi.vfs.newvfs.persistent.PersistentFS;
import com.intellij.testFramework.PlatformLangTestCase;
@@ -269,13 +266,13 @@ public class LocalFileSystemTest extends PlatformLangTestCase {
FileUtil.writeToFile(file, "hello");
VirtualFile virtualFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file);
assertNotNull(virtualFile);
String s = VfsUtil.loadText(virtualFile);
String s = VfsUtilCore.loadText(virtualFile);
assertEquals("hello", s);
assertEquals(5, virtualFile.getLength());
FileUtil.writeToFile(file, "new content");
((PersistentFS)ManagingFS.getInstance()).cleanPersistedContents();
s = VfsUtil.loadText(virtualFile);
PersistentFS.cleanPersistedContents();
s = VfsUtilCore.loadText(virtualFile);
assertEquals("new content", s);
assertEquals(11, virtualFile.getLength());
}
@@ -307,7 +304,7 @@ public class LocalFileSystemTest extends PlatformLangTestCase {
final VirtualFile check = LocalFileSystem.getInstance().findFileByIoFile(hardLinkFile);
assertNotNull(check);
assertEquals("hello", VfsUtil.loadText(check));
assertEquals("hello", VfsUtilCore.loadText(check));
}
finally {
GeneralSettings.getInstance().setUseSafeWrite(safeWrite);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -75,7 +75,6 @@ import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.openapi.vfs.encoding.EncodingManager;
import com.intellij.openapi.vfs.encoding.EncodingManagerImpl;
import com.intellij.openapi.vfs.newvfs.ManagingFS;
import com.intellij.openapi.vfs.newvfs.persistent.PersistentFS;
import com.intellij.profile.codeInspection.InspectionProfileManager;
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
@@ -184,7 +183,7 @@ public abstract class LightPlatformTestCase extends UsefulTestCase implements Da
}
private static void cleanPersistedVFSContent() {
((PersistentFS)ManagingFS.getInstance()).cleanPersistedContents();
PersistentFS.cleanPersistedContents();
}
public static boolean isLight(Project project) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -55,7 +55,6 @@ import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.impl.VirtualFilePointerManagerImpl;
import com.intellij.openapi.vfs.impl.local.LocalFileSystemImpl;
import com.intellij.openapi.vfs.newvfs.ManagingFS;
import com.intellij.openapi.vfs.newvfs.impl.VirtualDirectoryImpl;
import com.intellij.openapi.vfs.newvfs.persistent.PersistentFS;
import com.intellij.openapi.vfs.pointers.VirtualFilePointerManager;
@@ -154,7 +153,7 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro
}
private static void cleanPersistedVFSContent() {
((PersistentFS)ManagingFS.getInstance()).cleanPersistedContents();
PersistentFS.cleanPersistedContents();
}
@Override