Search in sources :

Example 6 with MockExperimentService

use of com.google.idea.common.experiments.MockExperimentService in project intellij by bazelbuild.

the class BuildTargetFinderTest method initTest.

@Override
protected void initTest(Container applicationServices, Container projectServices) {
    super.initTest(applicationServices, projectServices);
    applicationServices.register(FileOperationProvider.class, fileOperationProvider);
    applicationServices.register(ExperimentService.class, new MockExperimentService());
    applicationServices.register(BlazeImportSettingsManager.class, mock(BlazeImportSettingsManager.class));
    ExtensionPoint<BuildSystemProvider> extensionPoint = registerExtensionPoint(BuildSystemProvider.EP_NAME, BuildSystemProvider.class);
    extensionPoint.registerExtension(new BazelBuildSystemProvider());
}
Also used : MockExperimentService(com.google.idea.common.experiments.MockExperimentService) BlazeImportSettingsManager(com.google.idea.blaze.base.settings.BlazeImportSettingsManager) BazelBuildSystemProvider(com.google.idea.blaze.base.bazel.BazelBuildSystemProvider) BuildSystemProvider(com.google.idea.blaze.base.bazel.BuildSystemProvider) BazelBuildSystemProvider(com.google.idea.blaze.base.bazel.BazelBuildSystemProvider)

Example 7 with MockExperimentService

use of com.google.idea.common.experiments.MockExperimentService in project intellij by bazelbuild.

the class BlazeIdeInterfaceAspectsImplTest method initTest.

@Override
protected void initTest(Container applicationServices, Container projectServices) {
    super.initTest(applicationServices, projectServices);
    applicationServices.register(ExperimentService.class, new MockExperimentService());
    applicationServices.register(FileOperationProvider.class, new FileOperationProvider());
}
Also used : MockExperimentService(com.google.idea.common.experiments.MockExperimentService) FileOperationProvider(com.google.idea.blaze.base.io.FileOperationProvider)

Example 8 with MockExperimentService

use of com.google.idea.common.experiments.MockExperimentService 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);
}
Also used : BlazeImportSettingsManager(com.google.idea.blaze.base.settings.BlazeImportSettingsManager) MockExperimentService(com.google.idea.common.experiments.MockExperimentService) JavaLikeLanguage(com.google.idea.blaze.java.sync.source.JavaLikeLanguage) BlazeCommandRunConfigurationHandlerProvider(com.google.idea.blaze.base.run.confighandler.BlazeCommandRunConfigurationHandlerProvider) BuildSystemProvider(com.google.idea.blaze.base.bazel.BuildSystemProvider) BlazeCommandGenericRunConfigurationHandlerProvider(com.google.idea.blaze.base.run.confighandler.BlazeCommandGenericRunConfigurationHandlerProvider) TargetFinder(com.google.idea.blaze.base.run.targetfinder.TargetFinder) BlazeCommandRunConfigurationType(com.google.idea.blaze.base.run.BlazeCommandRunConfigurationType) BlazeUserSettings(com.google.idea.blaze.base.settings.BlazeUserSettings) ExperimentService(com.google.idea.common.experiments.ExperimentService) MockExperimentService(com.google.idea.common.experiments.MockExperimentService)

Example 9 with MockExperimentService

use of com.google.idea.common.experiments.MockExperimentService in project intellij by bazelbuild.

the class BlazeJUnitTestFilterFlagsTest method initTest.

@Override
protected void initTest(@NotNull Container applicationServices, @NotNull Container projectServices) {
    ExperimentService experimentService = new MockExperimentService();
    applicationServices.register(ExperimentService.class, experimentService);
}
Also used : MockExperimentService(com.google.idea.common.experiments.MockExperimentService) ExperimentService(com.google.idea.common.experiments.ExperimentService) MockExperimentService(com.google.idea.common.experiments.MockExperimentService)

Example 10 with MockExperimentService

use of com.google.idea.common.experiments.MockExperimentService in project intellij by bazelbuild.

the class BlazeAndroidTestRunConfigurationStateTest 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 BlazeAndroidTestRunConfigurationState(buildSystem().getName());
}
Also used : MockExperimentService(com.google.idea.common.experiments.MockExperimentService) Before(org.junit.Before)

Aggregations

MockExperimentService (com.google.idea.common.experiments.MockExperimentService)25 BlazeImportSettingsManager (com.google.idea.blaze.base.settings.BlazeImportSettingsManager)8 MockBlazeExecutor (com.google.idea.blaze.base.async.executor.MockBlazeExecutor)6 Before (org.junit.Before)5 BuildSystemProvider (com.google.idea.blaze.base.bazel.BuildSystemProvider)4 BlazeExecutor (com.google.idea.blaze.base.async.executor.BlazeExecutor)3 BazelBuildSystemProvider (com.google.idea.blaze.base.bazel.BazelBuildSystemProvider)3 MockPrefetchService (com.google.idea.blaze.base.prefetch.MockPrefetchService)3 BlazeContext (com.google.idea.blaze.base.scope.BlazeContext)3 BlazeImportSettings (com.google.idea.blaze.base.settings.BlazeImportSettings)3 BlazeUserSettings (com.google.idea.blaze.base.settings.BlazeUserSettings)3 JavaLikeLanguage (com.google.idea.blaze.java.sync.source.JavaLikeLanguage)3 ExperimentService (com.google.idea.common.experiments.ExperimentService)3 VirtualFileSystemProvider (com.google.idea.blaze.base.io.VirtualFileSystemProvider)2 ProjectViewManager (com.google.idea.blaze.base.projectview.ProjectViewManager)2 BlazeCommandRunConfigurationHandlerProvider (com.google.idea.blaze.base.run.confighandler.BlazeCommandRunConfigurationHandlerProvider)2 TargetFinder (com.google.idea.blaze.base.run.targetfinder.TargetFinder)2 ArtifactLocationDecoder (com.google.idea.blaze.base.sync.workspace.ArtifactLocationDecoder)2 JavaSourcePackageReader (com.google.idea.blaze.java.sync.source.JavaSourcePackageReader)2 PackageManifestReader (com.google.idea.blaze.java.sync.source.PackageManifestReader)2