Search in sources :

Example 1 with JvmPsiConversionHelperImpl

use of com.intellij.psi.impl.JvmPsiConversionHelperImpl in project intellij by bazelbuild.

the class BlazeRenderErrorContributorTest method initTest.

@Override
protected void initTest(Container applicationServices, Container projectServices) {
    super.initTest(applicationServices, projectServices);
    applicationServices.register(FileTypeManager.class, new MockFileTypeManager());
    projectFileIndex = mock(ProjectFileIndex.class);
    projectServices.register(ProjectFileIndex.class, projectFileIndex);
    projectServices.register(BuildReferenceManager.class, new MockBuildReferenceManager(project));
    projectServices.register(TransitiveDependencyMap.class, new TransitiveDependencyMap(project));
    projectServices.register(ProjectScopeBuilder.class, new ProjectScopeBuilderImpl(project));
    projectServices.register(AndroidResourceModuleRegistry.class, new AndroidResourceModuleRegistry());
    ExtensionPointImpl<Provider> kindProvider = registerExtensionPoint(Kind.Provider.EP_NAME, Kind.Provider.class);
    kindProvider.registerExtension(new AndroidBlazeRules());
    applicationServices.register(Kind.ApplicationState.class, new Kind.ApplicationState());
    BlazeImportSettingsManager importSettingsManager = new BlazeImportSettingsManager(project);
    BlazeImportSettings settings = new BlazeImportSettings("", "", "", "", BuildSystemName.Blaze);
    importSettingsManager.setImportSettings(settings);
    projectServices.register(BlazeImportSettingsManager.class, importSettingsManager);
    projectServices.register(JvmPsiConversionHelper.class, new JvmPsiConversionHelperImpl());
    createPsiClassesAndSourceToTargetMap(projectServices);
    projectDataManager = new MockBlazeProjectDataManager();
    projectServices.register(BlazeProjectDataManager.class, projectDataManager);
    ExtensionPoint<RenderErrorContributor.Provider> extensionPoint = registerExtensionPoint(ExtensionPointName.create("com.android.rendering.renderErrorContributor"), RenderErrorContributor.Provider.class);
    extensionPoint.registerExtension(new RenderErrorContributor.Provider());
    extensionPoint.registerExtension(new BlazeRenderErrorContributor.BlazeProvider());
    module = new MockModule(project, () -> {
    });
    // For the isApplicable tests.
    provider = new BlazeRenderErrorContributor.BlazeProvider();
}
Also used : BlazeImportSettingsManager(com.google.idea.blaze.base.settings.BlazeImportSettingsManager) BlazeImportSettings(com.google.idea.blaze.base.settings.BlazeImportSettings) RenderErrorContributor(com.android.tools.idea.rendering.RenderErrorContributor) AndroidResourceModuleRegistry(com.google.idea.blaze.android.sync.model.AndroidResourceModuleRegistry) MockFileTypeManager(com.intellij.openapi.fileTypes.MockFileTypeManager) TransitiveDependencyMap(com.google.idea.blaze.base.targetmaps.TransitiveDependencyMap) Provider(com.google.idea.blaze.base.model.primitives.Kind.Provider) AndroidBlazeRules(com.google.idea.blaze.java.AndroidBlazeRules) MockModule(com.intellij.mock.MockModule) ProjectFileIndex(com.intellij.openapi.roots.ProjectFileIndex) Kind(com.google.idea.blaze.base.model.primitives.Kind) JvmPsiConversionHelperImpl(com.intellij.psi.impl.JvmPsiConversionHelperImpl) ProjectScopeBuilderImpl(com.intellij.psi.search.ProjectScopeBuilderImpl)

Example 2 with JvmPsiConversionHelperImpl

use of com.intellij.psi.impl.JvmPsiConversionHelperImpl in project intellij by bazelbuild.

the class BlazeClassJarProviderTest method initTest.

@Override
protected void initTest(Container applicationServices, Container projectServices) {
    applicationServices.register(FileTypeManager.class, new MockFileTypeManager());
    applicationServices.register(FileDocumentManager.class, new MockFileDocumentManagerImpl(null, null));
    applicationServices.register(VirtualFileManager.class, mock(VirtualFileManager.class));
    applicationServices.register(BlazeBuildService.class, new BlazeBuildService(project));
    projectServices.register(ProjectScopeBuilder.class, new ProjectScopeBuilderImpl(project));
    projectServices.register(ProjectViewManager.class, new MockProjectViewManager());
    BlazeProjectDataManager mockProjectDataManager = new MockBlazeProjectDataManager(MockBlazeProjectDataBuilder.builder().build());
    projectServices.register(BlazeProjectDataManager.class, mockProjectDataManager);
    BlazeImportSettingsManager manager = new BlazeImportSettingsManager(project);
    manager.setImportSettings(new BlazeImportSettings("", "", "", "", BuildSystemName.Blaze));
    projectServices.register(BlazeImportSettingsManager.class, manager);
    projectServices.register(JvmPsiConversionHelper.class, new JvmPsiConversionHelperImpl());
    facade = new MockJavaPsiFacade(project, ImmutableList.of("com.google.example.Modified", "com.google.example.NotModified"));
    projectServices.register(JavaPsiFacade.class, facade);
    module = new MockModule(() -> {
    });
}
Also used : BlazeImportSettingsManager(com.google.idea.blaze.base.settings.BlazeImportSettingsManager) MockFileDocumentManagerImpl(com.intellij.mock.MockFileDocumentManagerImpl) BlazeImportSettings(com.google.idea.blaze.base.settings.BlazeImportSettings) VirtualFileManager(com.intellij.openapi.vfs.VirtualFileManager) MockBlazeProjectDataManager(com.google.idea.blaze.base.model.MockBlazeProjectDataManager) BlazeProjectDataManager(com.google.idea.blaze.base.sync.data.BlazeProjectDataManager) MockFileTypeManager(com.intellij.openapi.fileTypes.MockFileTypeManager) MockModule(com.intellij.mock.MockModule) BlazeBuildService(com.google.idea.blaze.base.build.BlazeBuildService) JvmPsiConversionHelperImpl(com.intellij.psi.impl.JvmPsiConversionHelperImpl) MockBlazeProjectDataManager(com.google.idea.blaze.base.model.MockBlazeProjectDataManager) ProjectScopeBuilderImpl(com.intellij.psi.search.ProjectScopeBuilderImpl)

Example 3 with JvmPsiConversionHelperImpl

use of com.intellij.psi.impl.JvmPsiConversionHelperImpl in project intellij by bazelbuild.

the class BlazeAndroidModelTest method initTest.

@Override
protected void initTest(Container applicationServices, Container projectServices) {
    applicationServices.register(FileTypeManager.class, new MockFileTypeManager());
    applicationServices.register(FileDocumentManager.class, new MockFileDocumentManagerImpl(null, null));
    applicationServices.register(VirtualFileManager.class, mock(VirtualFileManager.class));
    applicationServices.register(BlazeBuildService.class, new BlazeBuildService());
    projectServices.register(ProjectScopeBuilder.class, new ProjectScopeBuilderImpl(project));
    projectServices.register(ProjectViewManager.class, new MockProjectViewManager());
    BlazeProjectDataManager mockProjectDataManager = new MockBlazeProjectDataManager(MockBlazeProjectDataBuilder.builder().build());
    projectServices.register(BlazeProjectDataManager.class, mockProjectDataManager);
    BlazeImportSettingsManager manager = new BlazeImportSettingsManager(project);
    manager.setImportSettings(new BlazeImportSettings("", "", "", "", BuildSystem.Blaze));
    projectServices.register(BlazeImportSettingsManager.class, manager);
    projectServices.register(JvmPsiConversionHelper.class, new JvmPsiConversionHelperImpl());
    facade = new MockJavaPsiFacade(project, ImmutableList.of("com.google.example.Modified", "com.google.example.NotModified"));
    projectServices.register(JavaPsiFacade.class, facade);
    module = new MockModule(() -> {
    });
    model = new BlazeAndroidModel(project, null, mock(SourceProvider.class), null, 0, false);
}
Also used : BlazeImportSettingsManager(com.google.idea.blaze.base.settings.BlazeImportSettingsManager) MockFileDocumentManagerImpl(com.intellij.mock.MockFileDocumentManagerImpl) BlazeImportSettings(com.google.idea.blaze.base.settings.BlazeImportSettings) VirtualFileManager(com.intellij.openapi.vfs.VirtualFileManager) MockBlazeProjectDataManager(com.google.idea.blaze.base.model.MockBlazeProjectDataManager) BlazeProjectDataManager(com.google.idea.blaze.base.sync.data.BlazeProjectDataManager) MockFileTypeManager(com.intellij.openapi.fileTypes.MockFileTypeManager) MockModule(com.intellij.mock.MockModule) BlazeBuildService(com.google.idea.blaze.base.actions.BlazeBuildService) JvmPsiConversionHelperImpl(com.intellij.psi.impl.JvmPsiConversionHelperImpl) MockBlazeProjectDataManager(com.google.idea.blaze.base.model.MockBlazeProjectDataManager) ProjectScopeBuilderImpl(com.intellij.psi.search.ProjectScopeBuilderImpl)

Aggregations

BlazeImportSettings (com.google.idea.blaze.base.settings.BlazeImportSettings)3 BlazeImportSettingsManager (com.google.idea.blaze.base.settings.BlazeImportSettingsManager)3 MockModule (com.intellij.mock.MockModule)3 MockFileTypeManager (com.intellij.openapi.fileTypes.MockFileTypeManager)3 JvmPsiConversionHelperImpl (com.intellij.psi.impl.JvmPsiConversionHelperImpl)3 ProjectScopeBuilderImpl (com.intellij.psi.search.ProjectScopeBuilderImpl)3 MockBlazeProjectDataManager (com.google.idea.blaze.base.model.MockBlazeProjectDataManager)2 BlazeProjectDataManager (com.google.idea.blaze.base.sync.data.BlazeProjectDataManager)2 MockFileDocumentManagerImpl (com.intellij.mock.MockFileDocumentManagerImpl)2 VirtualFileManager (com.intellij.openapi.vfs.VirtualFileManager)2 RenderErrorContributor (com.android.tools.idea.rendering.RenderErrorContributor)1 AndroidResourceModuleRegistry (com.google.idea.blaze.android.sync.model.AndroidResourceModuleRegistry)1 BlazeBuildService (com.google.idea.blaze.base.actions.BlazeBuildService)1 BlazeBuildService (com.google.idea.blaze.base.build.BlazeBuildService)1 Kind (com.google.idea.blaze.base.model.primitives.Kind)1 Provider (com.google.idea.blaze.base.model.primitives.Kind.Provider)1 TransitiveDependencyMap (com.google.idea.blaze.base.targetmaps.TransitiveDependencyMap)1 AndroidBlazeRules (com.google.idea.blaze.java.AndroidBlazeRules)1 ProjectFileIndex (com.intellij.openapi.roots.ProjectFileIndex)1