From a38dd4ab7d674a1d4a0e593ff5df7cab3e75b26b Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 27 Mar 2012 18:53:04 +0200 Subject: [PATCH] allow to add directories as library classes in tests --- .../src/com/intellij/testFramework/PsiTestUtil.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); }