From 8dfe4b86b46f099212a3f6fb90f39cb895416a50 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Mon, 14 Sep 2015 14:36:52 +0300 Subject: [PATCH] fix compilation --- .../testFramework/PlatformTestCase.java | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java b/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java index a3c8f2807cad..ab2d6ce3cc49 100644 --- a/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java @@ -146,7 +146,7 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro } private static final String[] PREFIX_CANDIDATES = { - "AppCode", "CLion", "CidrCommon", + "AppCode", "CLion", "CidrCommon", "Python", "PyCharmCore", "Ruby", "UltimateLangXml", "Idea", "PlatformLangXml" }; /** @@ -235,7 +235,6 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro myProjectManager.openTestProject(myProject); LocalFileSystem.getInstance().refreshIoFiles(myFilesToDelete); - myProjectManager.openTestProject(myProject); setUpModule(); setUpJdk(); @@ -246,15 +245,14 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro ((FileTypeManagerImpl)FileTypeManager.getInstance()).drainReDetectQueue(); } - protected Project doCreateProject(File projectFile) throws Exception { + protected Project doCreateProject(@NotNull File projectFile) throws Exception { return createProject(projectFile, getClass().getName() + "." + getName()); } @NotNull public static Project createProject(File projectFile, String creationPlace) { try { - Project project = - ProjectManagerEx.getInstanceEx().newProject(FileUtil.getNameWithoutExtension(projectFile), projectFile.getPath(), false, false); + Project project = ProjectManagerEx.getInstanceEx().newProject(FileUtil.getNameWithoutExtension(projectFile), projectFile.getPath(), false, false); assert project != null; project.putUserData(CREATION_PLACE, creationPlace); @@ -877,14 +875,14 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro } protected static void delete(@NotNull final VirtualFile file) { - ApplicationManager.getApplication().runWriteAction(new Runnable() { + WriteCommandAction.runWriteCommandAction(null, new Runnable() { @Override public void run() { try { file.delete(null); } catch (IOException e) { - fail(); + throw new RuntimeException(e); } } }); @@ -920,6 +918,17 @@ public abstract class PlatformTestCase extends UsefulTestCase implements DataPro return copy[0]; } + public static void copyDirContentsTo(@NotNull final VirtualFile vTestRoot, @NotNull final VirtualFile toDir) { + new WriteCommandAction.Simple(null) { + @Override + protected void run() throws Throwable { + for (VirtualFile file : vTestRoot.getChildren()) { + VfsUtil.copy(this, file, toDir); + } + } + }.execute().throwException(); + } + public static void setFileText(@NotNull final VirtualFile file, @NotNull final String text) throws IOException { new WriteAction() { @Override