Search in sources :

Example 56 with TestOnly

use of org.jetbrains.annotations.TestOnly in project intellij-plugins by JetBrains.

the class LibraryUtil method getTestGlobalLibrary.

@TestOnly
static // we cannot use LocalFileSystem, because our test can run outside the idea
VirtualFile getTestGlobalLibrary(boolean isPlayer) {
    String name = (isPlayer ? "player" : "air") + "-catalog.xml";
    File file = new File(DebugPathManager.getTestDataPath() + "/lib/playerglobal", name);
    assert file.exists();
    try {
        return new LightVirtualFile(name, XmlFileType.INSTANCE, IOUtil.getCharSequence(file), StandardCharsets.UTF_8, 0);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : LightVirtualFile(com.intellij.testFramework.LightVirtualFile) VirtualFile(com.intellij.openapi.vfs.VirtualFile) LightVirtualFile(com.intellij.testFramework.LightVirtualFile) TestOnly(org.jetbrains.annotations.TestOnly)

Aggregations

TestOnly (org.jetbrains.annotations.TestOnly)56 Disposable (com.intellij.openapi.Disposable)18 VirtualFile (com.intellij.openapi.vfs.VirtualFile)8 NotNull (org.jetbrains.annotations.NotNull)7 Project (com.intellij.openapi.project.Project)5 Application (com.intellij.openapi.application.Application)4 Document (com.intellij.openapi.editor.Document)3 Editor (com.intellij.openapi.editor.Editor)3 THashSet (gnu.trove.THashSet)3 Nullable (org.jetbrains.annotations.Nullable)3 HighlightingPass (com.intellij.codeHighlighting.HighlightingPass)2 TextEditorHighlightingPass (com.intellij.codeHighlighting.TextEditorHighlightingPass)2 ApplicationEx (com.intellij.openapi.application.ex.ApplicationEx)2 ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)2 CollectionListModel (com.intellij.ui.CollectionListModel)2 THashMap (gnu.trove.THashMap)2 BackgroundEditorHighlighter (com.intellij.codeHighlighting.BackgroundEditorHighlighter)1 Pass (com.intellij.codeHighlighting.Pass)1 AutoPopupController (com.intellij.codeInsight.AutoPopupController)1 com.intellij.codeInsight.daemon (com.intellij.codeInsight.daemon)1