Search in sources :

Example 1 with TempFileSystem

use of com.intellij.openapi.vfs.ex.temp.TempFileSystem in project intellij-community by JetBrains.

the class PyResolveTestCase method assertResolveResult.

public static <T extends PsiElement> T assertResolveResult(PsiElement element, Class<T> aClass, String name, @Nullable String containingFilePath) {
    assertInstanceOf(element, aClass);
    assertEquals(name, ((PsiNamedElement) element).getName());
    if (containingFilePath != null) {
        VirtualFile virtualFile = element.getContainingFile().getVirtualFile();
        if (virtualFile.getFileSystem() instanceof TempFileSystem) {
            assertEquals(containingFilePath, virtualFile.getPath());
        } else {
            assertEquals(containingFilePath, virtualFile.getName());
        }
    }
    return (T) element;
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) TempFileSystem(com.intellij.openapi.vfs.ex.temp.TempFileSystem)

Example 2 with TempFileSystem

use of com.intellij.openapi.vfs.ex.temp.TempFileSystem in project intellij-community by JetBrains.

the class PersistentFsTest method testLocalRoots.

public void testLocalRoots() {
    VirtualFile tempRoot = VirtualFileManager.getInstance().findFileByUrl("temp:///");
    assertNotNull(tempRoot);
    VirtualFile[] roots = myFs.getLocalRoots();
    for (VirtualFile root : roots) {
        assertTrue("root=" + root, root.isInLocalFileSystem());
        VirtualFileSystem fs = root.getFileSystem();
        assertTrue("fs=" + fs, fs instanceof LocalFileSystem);
        assertFalse("fs=" + fs, fs instanceof TempFileSystem);
    }
}
Also used : NewVirtualFile(com.intellij.openapi.vfs.newvfs.NewVirtualFile) TempFileSystem(com.intellij.openapi.vfs.ex.temp.TempFileSystem)

Aggregations

TempFileSystem (com.intellij.openapi.vfs.ex.temp.TempFileSystem)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 NewVirtualFile (com.intellij.openapi.vfs.newvfs.NewVirtualFile)1