diff --git a/platform/testFramework/src/com/intellij/testFramework/PsiTestUtil.java b/platform/testFramework/src/com/intellij/testFramework/PsiTestUtil.java index 8a4a7c977c59..480dc6312069 100644 --- a/platform/testFramework/src/com/intellij/testFramework/PsiTestUtil.java +++ b/platform/testFramework/src/com/intellij/testFramework/PsiTestUtil.java @@ -257,7 +257,12 @@ import java.util.Collection; jar = "/" + jar; } final String path = libPath + jar; - final VirtualFile root = JarFileSystem.getInstance().refreshAndFindFileByPath(path + "!/"); + VirtualFile root; + if (path.endsWith(".jar")) { + root = JarFileSystem.getInstance().refreshAndFindFileByPath(path + "!/"); + } else { + root = LocalFileSystem.getInstance().refreshAndFindFileByPath(path); + } assert root != null : "Library root folder not found: " + path + "!/"; libraryModel.addRoot(root, OrderRootType.CLASSES); }