use of com.google.idea.common.experiments.MockExperimentService in project intellij by bazelbuild.
the class BlazeGoGotoDeclarationHandlerTest method init.
@Before
public void init() {
MockExperimentService experimentService = new MockExperimentService();
experimentService.setExperiment(BlazeGoSupport.blazeGoSupportEnabled, true);
registerApplicationComponent(ExperimentService.class, experimentService);
registerApplicationService(FileOperationProvider.class, new MockFileOperationProvider());
}
use of com.google.idea.common.experiments.MockExperimentService in project intellij by bazelbuild.
the class BlazeJavaWorkspaceImporterTest method initTest.
@Override
// False positive on getDeclaredPackageOfJavaFile.
@SuppressWarnings("FunctionalInterfaceClash")
protected void initTest(Container applicationServices, Container projectServices) {
applicationServices.register(ExperimentService.class, new MockExperimentService());
BlazeExecutor blazeExecutor = new MockBlazeExecutor();
applicationServices.register(BlazeExecutor.class, blazeExecutor);
projectServices.register(BlazeImportSettingsManager.class, new BlazeImportSettingsManager());
BlazeImportSettingsManager.getInstance(getProject()).setImportSettings(DUMMY_IMPORT_SETTINGS);
// will silently fall back to FilePathJavaPackageReader
applicationServices.register(JavaSourcePackageReader.class, new JavaSourcePackageReader() {
@Nullable
@Override
public String getDeclaredPackageOfJavaFile(BlazeContext context, ArtifactLocationDecoder artifactLocationDecoder, SourceArtifact sourceArtifact) {
return null;
}
});
applicationServices.register(PackageManifestReader.class, new PackageManifestReader());
applicationServices.register(PrefetchService.class, new MockPrefetchService());
context = new BlazeContext();
context.addOutputSink(IssueOutput.class, errorCollector);
augmenters = registerExtensionPoint(BlazeJavaSyncAugmenter.EP_NAME, BlazeJavaSyncAugmenter.class);
registerExtensionPoint(JavaLikeLanguage.EP_NAME, JavaLikeLanguage.class).registerExtension(new JavaLikeLanguage.Java());
}
use of com.google.idea.common.experiments.MockExperimentService in project intellij by bazelbuild.
the class SourceDirectoryCalculatorTest method initTest.
@Override
protected void initTest(Container applicationServices, Container projectServices) {
super.initTest(applicationServices, projectServices);
mockInputStreamProvider = new MockInputStreamProvider();
applicationServices.register(InputStreamProvider.class, mockInputStreamProvider);
applicationServices.register(JavaSourcePackageReader.class, new JavaSourcePackageReader());
applicationServices.register(PackageManifestReader.class, new PackageManifestReader());
applicationServices.register(FileOperationProvider.class, new MockFileOperationProvider());
context.addOutputSink(IssueOutput.class, issues);
sourceDirectoryCalculator = new SourceDirectoryCalculator();
BlazeExecutor blazeExecutor = new MockBlazeExecutor();
applicationServices.register(BlazeExecutor.class, blazeExecutor);
experimentService = new MockExperimentService();
applicationServices.register(ExperimentService.class, experimentService);
applicationServices.register(PrefetchService.class, new MockPrefetchService());
registerExtensionPoint(JavaLikeLanguage.EP_NAME, JavaLikeLanguage.class).registerExtension(new JavaLikeLanguage.Java());
}
use of com.google.idea.common.experiments.MockExperimentService in project intellij by bazelbuild.
the class TargetExpressionTest method initTest.
@Override
protected void initTest(Container applicationServices, Container projectServices) {
super.initTest(applicationServices, projectServices);
experimentService = new MockExperimentService();
applicationServices.register(ExperimentService.class, experimentService);
}
use of com.google.idea.common.experiments.MockExperimentService 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