fix "IDEA-221944 Deadlock on opening second project" and support preloading for proje...
[idea/community.git] / platform / platform-tests / testSrc / com / intellij / openapi / fileEditor / HeavyFileEditorManagerTestCase.java
1 // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
2 package com.intellij.openapi.fileEditor;
3
4 import com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl;
5 import com.intellij.openapi.project.Project;
6 import com.intellij.openapi.vfs.LocalFileSystem;
7 import com.intellij.openapi.vfs.VirtualFile;
8 import com.intellij.testFramework.PlatformTestUtil;
9 import com.intellij.testFramework.ServiceContainerUtil;
10 import com.intellij.testFramework.builders.ModuleFixtureBuilder;
11 import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase;
12
13 /**
14  * @author Dmitry Avdeev
15  */
16 public abstract class HeavyFileEditorManagerTestCase extends CodeInsightFixtureTestCase<ModuleFixtureBuilder<?>> {
17   protected VirtualFile getFile(String path) {
18     return LocalFileSystem.getInstance().refreshAndFindFileByPath(
19       PlatformTestUtil.getPlatformTestDataPath() + "fileEditorManager" + path);
20   }
21
22   @Override
23   public void setUp() throws Exception {
24     super.setUp();
25
26     Project project = getProject();
27     FileEditorManagerImpl manager = new FileEditorManagerImpl(project);
28     ServiceContainerUtil.registerComponentInstance(project, FileEditorManager.class, manager, getTestRootDisposable());
29   }
30
31   @Override
32   protected String getBasePath() {
33     return "/platform/platform-tests/testData/fileEditorManager";
34   }
35 }