Search in sources :

Example 1 with TestOnly

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

the class TestNamespaceContext method install.

@TestOnly
public static void install(Disposable parent) {
    final NamespaceContext old = ContextProvider.DefaultProvider.NULL_NAMESPACE_CONTEXT;
    ContextProvider.DefaultProvider.NULL_NAMESPACE_CONTEXT = TestNamespaceContext.INSTANCE;
    Disposer.register(parent, new Disposable() {

        @Override
        public void dispose() {
            ContextProvider.DefaultProvider.NULL_NAMESPACE_CONTEXT = old;
        }
    });
}
Also used : Disposable(com.intellij.openapi.Disposable) NamespaceContext(org.intellij.lang.xpath.context.NamespaceContext) TestOnly(org.jetbrains.annotations.TestOnly)

Example 2 with TestOnly

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

the class EmmetAbbreviationBalloon method setTestingAbbreviation.

@TestOnly
public static void setTestingAbbreviation(@NotNull String testingAbbreviation, @NotNull Disposable parentDisposable) {
    ourTestingAbbreviation = testingAbbreviation;
    Disposer.register(parentDisposable, new Disposable() {

        @Override
        public void dispose() {
            //noinspection AssignmentToStaticFieldFromInstanceMethod
            ourTestingAbbreviation = null;
        }
    });
}
Also used : Disposable(com.intellij.openapi.Disposable) TestOnly(org.jetbrains.annotations.TestOnly)

Example 3 with TestOnly

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

the class MavenProjectsManager method scheduleImportInTests.

@TestOnly
public void scheduleImportInTests(List<VirtualFile> projectFiles) {
    List<Pair<MavenProject, MavenProjectChanges>> toImport = new ArrayList<>();
    for (VirtualFile each : projectFiles) {
        MavenProject project = findProject(each);
        if (project != null) {
            toImport.add(Pair.create(project, MavenProjectChanges.ALL));
        }
    }
    scheduleForNextImport(toImport);
    scheduleImport();
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) TestOnly(org.jetbrains.annotations.TestOnly)

Example 4 with TestOnly

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

the class ExternalResourceManagerExImpl method addTestResource.

@TestOnly
public static void addTestResource(final String url, final String location, Disposable parentDisposable) {
    final ExternalResourceManagerExImpl instance = (ExternalResourceManagerExImpl) getInstance();
    ApplicationManager.getApplication().runWriteAction(() -> instance.addResource(url, location));
    Disposer.register(parentDisposable, new Disposable() {

        @Override
        public void dispose() {
            ApplicationManager.getApplication().runWriteAction(() -> instance.removeResource(url));
        }
    });
}
Also used : Disposable(com.intellij.openapi.Disposable) TestOnly(org.jetbrains.annotations.TestOnly)

Example 5 with TestOnly

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

the class ExternalResourceManagerExImpl method registerResourceTemporarily.

@TestOnly
public static void registerResourceTemporarily(final String url, final String location, Disposable disposable) {
    ApplicationManager.getApplication().runWriteAction(() -> getInstance().addResource(url, location));
    Disposer.register(disposable, new Disposable() {

        @Override
        public void dispose() {
            ApplicationManager.getApplication().runWriteAction(() -> getInstance().removeResource(url));
        }
    });
}
Also used : Disposable(com.intellij.openapi.Disposable) 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