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;
}
});
}
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;
}
});
}
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();
}
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));
}
});
}
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));
}
});
}
Aggregations