use of com.google.idea.common.experiments.MockExperimentService in project intellij by bazelbuild.
the class BlazeAndroidWorkspaceImporterTest method initTest.
@Override
protected void initTest(Container applicationServices, Container projectServices) {
MockExperimentService mockExperimentService = new MockExperimentService();
applicationServices.register(ExperimentService.class, mockExperimentService);
BlazeExecutor blazeExecutor = new MockBlazeExecutor();
applicationServices.register(BlazeExecutor.class, blazeExecutor);
projectServices.register(BlazeImportSettingsManager.class, new BlazeImportSettingsManager());
BlazeImportSettingsManager.getInstance(getProject()).setImportSettings(DUMMY_IMPORT_SETTINGS);
MockFileOperationProvider mockFileOperationProvider = new MockFileOperationProvider();
applicationServices.register(FileOperationProvider.class, mockFileOperationProvider);
context = new BlazeContext();
context.addOutputSink(IssueOutput.class, errorCollector);
registerExtensionPoint(BlazeJavaSyncAugmenter.EP_NAME, BlazeJavaSyncAugmenter.class);
// For importJavaWorkspace.
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());
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 BlazeAndroidRunConfigurationCommonStateTest method doSetup.
@Before
public final void doSetup() {
MockExperimentService experimentService = new MockExperimentService();
registerApplicationComponent(ExperimentService.class, experimentService);
// BlazeAndroidRunConfigurationCommonState.isNativeDebuggingEnabled() always
// returns false if this experiment is false.
experimentService.setExperiment(NdkSupport.NDK_SUPPORT, true);
state = new BlazeAndroidRunConfigurationCommonState(buildSystem().getName(), false);
}
use of com.google.idea.common.experiments.MockExperimentService in project intellij by bazelbuild.
the class BlazeAndroidBinaryRunConfigurationStateTest method doSetup.
@Before
public final void doSetup() {
MockExperimentService experimentService = new MockExperimentService();
registerApplicationComponent(ExperimentService.class, experimentService);
// BlazeAndroidRunConfigurationCommonState.isNativeDebuggingEnabled() always
// returns false if this experiment is false.
experimentService.setExperiment(NdkSupport.NDK_SUPPORT, true);
state = new BlazeAndroidBinaryRunConfigurationState(buildSystem().getName());
}
use of com.google.idea.common.experiments.MockExperimentService in project intellij by bazelbuild.
the class BlazeConfigurationResolverTest method initTest.
@Override
protected void initTest(Container applicationServices, Container projectServices) {
super.initTest(applicationServices, projectServices);
applicationServices.register(BlazeExecutor.class, new MockBlazeExecutor());
CPPEnvironmentAdapter.registerForTest(applicationServices.getPicoContainer());
applicationServices.register(ExperimentService.class, new MockExperimentService());
compilerVersionChecker = new MockCompilerVersionChecker("1234");
applicationServices.register(CompilerVersionChecker.class, compilerVersionChecker);
applicationServices.register(ProgressManager.class, new ProgressManagerImpl());
applicationServices.register(VirtualFileManager.class, mock(VirtualFileManager.class));
mockFileSystem = mock(LocalFileSystem.class);
applicationServices.register(VirtualFileSystemProvider.class, mock(VirtualFileSystemProvider.class));
when(VirtualFileSystemProvider.getInstance().getSystem()).thenReturn(mockFileSystem);
projectServices.register(BlazeImportSettingsManager.class, new BlazeImportSettingsManager());
BuildSystemProvider buildSystemProvider = new BazelBuildSystemProvider();
registerExtensionPoint(BuildSystemProvider.EP_NAME, BuildSystemProvider.class).registerExtension(buildSystemProvider);
BlazeImportSettingsManager.getInstance(getProject()).setImportSettings(new BlazeImportSettings("", "", "", "", buildSystemProvider.buildSystem()));
context.addOutputSink(IssueOutput.class, errorCollector);
resolver = new BlazeConfigurationResolver(project);
resolverResult = BlazeConfigurationResolverResult.empty(project);
}
use of com.google.idea.common.experiments.MockExperimentService in project intellij by bazelbuild.
the class BlazeResolveConfigurationEquivalenceTest method initTest.
@Override
protected void initTest(Container applicationServices, Container projectServices) {
super.initTest(applicationServices, projectServices);
applicationServices.register(BlazeExecutor.class, new MockBlazeExecutor());
CPPEnvironmentAdapter.registerForTest(applicationServices.getPicoContainer());
applicationServices.register(ExperimentService.class, new MockExperimentService());
applicationServices.register(CompilerVersionChecker.class, new MockCompilerVersionChecker("1234"));
applicationServices.register(ProgressManager.class, new ProgressManagerImpl());
applicationServices.register(VirtualFileManager.class, mock(VirtualFileManager.class));
mockFileSystem = mock(LocalFileSystem.class);
applicationServices.register(VirtualFileSystemProvider.class, mock(VirtualFileSystemProvider.class));
when(VirtualFileSystemProvider.getInstance().getSystem()).thenReturn(mockFileSystem);
projectServices.register(PsiManager.class, new MockPsiManager(project));
projectServices.register(BlazeImportSettingsManager.class, new BlazeImportSettingsManager());
BuildSystemProvider buildSystemProvider = new BazelBuildSystemProvider();
registerExtensionPoint(BuildSystemProvider.EP_NAME, BuildSystemProvider.class).registerExtension(buildSystemProvider);
BlazeImportSettingsManager.getInstance(getProject()).setImportSettings(new BlazeImportSettings("", "", "", "", buildSystemProvider.buildSystem()));
context.addOutputSink(IssueOutput.class, errorCollector);
resolver = new BlazeConfigurationResolver(project);
resolverResult = BlazeConfigurationResolverResult.empty(project);
}
Aggregations