use of com.intellij.mock.MockModule in project intellij by bazelbuild.
the class BlazeBuildSystemServiceTest method initTest.
@Override
protected void initTest(Container applicationServices, Container projectServices) {
module = new MockModule(project, () -> {
});
// For Blaze.isBlazeProject.
mockBlazeImportSettings(projectServices);
createMocksForBuildProject(applicationServices);
createMocksForSyncProject(projectServices);
createMocksForAddDependency(applicationServices, projectServices);
ExtensionPoint<BuildSystemService> extensionPoint = registerExtensionPoint(ExtensionPointName.create("com.android.project.buildSystemService"), BuildSystemService.class);
extensionPoint.registerExtension(new BlazeBuildSystemService());
service = BuildSystemService.getInstance(project);
}
use of com.intellij.mock.MockModule 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());
projectServices.register(BlazeProjectDataManager.class, new BlazeProjectDataManagerImpl(project));
BlazeImportSettingsManager manager = new BlazeImportSettingsManager();
manager.setImportSettings(new BlazeImportSettings("", "", "", "", BuildSystem.Blaze));
projectServices.register(BlazeImportSettingsManager.class, manager);
facade = new MockJavaPsiFacade(project, new MockPsiManager(project), ImmutableList.of("com.google.example.Modified", "com.google.example.NotModified"));
projectServices.register(JavaPsiFacade.class, facade);
module = new MockModule(() -> {
});
model = new BlazeAndroidModel(project, module, null, mock(SourceProvider.class), null, "", 0);
}
Aggregations