mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
revoke access after the test
This commit is contained in:
+9
-2
@@ -186,8 +186,15 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
}
|
||||
|
||||
VirtualFile result;
|
||||
final String path = fromFile.getPath();
|
||||
if (myTempDirFixture instanceof LightTempDirTestFixtureImpl) {
|
||||
VfsRootAccess.allowRootAccess(fromFile.getPath());
|
||||
VfsRootAccess.allowRootAccess(path);
|
||||
Disposer.register(myTestRootDisposable, new Disposable() {
|
||||
@Override
|
||||
public void dispose() {
|
||||
VfsRootAccess.disallowRootAccess(path);
|
||||
}
|
||||
});
|
||||
VirtualFile fromVFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(fromFile);
|
||||
if (fromVFile == null) {
|
||||
fromVFile = myTempDirFixture.getFile(sourceFilePath);
|
||||
@@ -219,7 +226,7 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
assert file != null : targetFile;
|
||||
result = file;
|
||||
}
|
||||
result.putUserData(VfsTestUtil.TEST_DATA_FILE_PATH, fromFile.getPath());
|
||||
result.putUserData(VfsTestUtil.TEST_DATA_FILE_PATH, path);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user