use of com.google.idea.blaze.base.run.targetfinder.TargetFinder in project intellij by bazelbuild.
the class BlazeJavaRunProfileStateTest method initTest.
@Override
protected void initTest(Container applicationServices, Container projectServices) {
projectServices.register(BlazeImportSettingsManager.class, new BlazeImportSettingsManager());
BlazeImportSettingsManager.getInstance(getProject()).setImportSettings(DUMMY_IMPORT_SETTINGS);
ExperimentService experimentService = new MockExperimentService();
applicationServices.register(ExperimentService.class, experimentService);
applicationServices.register(BlazeUserSettings.class, new BlazeUserSettings());
projectServices.register(FastBuildService.class, new DisabledFastBuildService());
projectServices.register(ProjectViewManager.class, new MockProjectViewManager());
ExtensionPointImpl<TargetFinder> targetFinderEp = registerExtensionPoint(TargetFinder.EP_NAME, TargetFinder.class);
targetFinderEp.registerExtension(new MockTargetFinder());
ExtensionPointImpl<JavaLikeLanguage> javaLikeEp = registerExtensionPoint(JavaLikeLanguage.EP_NAME, JavaLikeLanguage.class);
javaLikeEp.registerExtension(new JavaLikeLanguage.Java());
registerExtensionPoint(BuildFlagsProvider.EP_NAME, BuildFlagsProvider.class);
ExtensionPointImpl<BlazeCommandRunConfigurationHandlerProvider> handlerProviderEp = registerExtensionPoint(BlazeCommandRunConfigurationHandlerProvider.EP_NAME, BlazeCommandRunConfigurationHandlerProvider.class);
handlerProviderEp.registerExtension(new BlazeJavaRunConfigurationHandlerProvider());
handlerProviderEp.registerExtension(new BlazeCommandGenericRunConfigurationHandlerProvider());
ExtensionPointImpl<BuildSystemProvider> buildSystemProviderExtensionPoint = registerExtensionPoint(BuildSystemProvider.EP_NAME, BuildSystemProvider.class);
BuildSystemProvider buildSystemProvider = mock(BuildSystemProvider.class);
when(buildSystemProvider.getBinaryPath()).thenReturn("/usr/bin/blaze");
buildSystemProviderExtensionPoint.registerExtension(buildSystemProvider);
configuration = new BlazeCommandRunConfigurationType().getFactory().createTemplateConfiguration(project);
}
use of com.google.idea.blaze.base.run.targetfinder.TargetFinder in project intellij by bazelbuild.
the class BlazeCommandRunConfigurationTest method initTest.
@Override
protected void initTest(Container applicationServices, Container projectServices) {
super.initTest(applicationServices, projectServices);
applicationServices.register(UISettings.class, new UISettings());
projectServices.register(BlazeImportSettingsManager.class, new BlazeImportSettingsManager());
BlazeImportSettingsManager.getInstance(getProject()).setImportSettings(DUMMY_IMPORT_SETTINGS);
applicationServices.register(ExperimentService.class, new MockExperimentService());
ExtensionPointImpl<TargetFinder> targetFinderEp = registerExtensionPoint(TargetFinder.EP_NAME, TargetFinder.class);
targetFinderEp.registerExtension(new MockTargetFinder());
ExtensionPointImpl<BlazeCommandRunConfigurationHandlerProvider> handlerProviderEp = registerExtensionPoint(BlazeCommandRunConfigurationHandlerProvider.EP_NAME, BlazeCommandRunConfigurationHandlerProvider.class);
handlerProviderEp.registerExtension(new MockBlazeCommandRunConfigurationHandlerProvider());
this.configuration = this.type.getFactory().createTemplateConfiguration(project);
}
Aggregations