use of com.google.idea.blaze.base.model.MockBlazeProjectDataManager in project intellij by bazelbuild.
the class BlazeCommandRunConfigurationRunManagerImplTest method doSetup.
@Before
public final void doSetup() {
runManager = RunManagerImpl.getInstanceImpl(getProject());
// Without BlazeProjectData, the configuration editor is always disabled.
BlazeProjectDataManager mockProjectDataManager = new MockBlazeProjectDataManager(MockBlazeProjectDataBuilder.builder(workspaceRoot).build());
registerProjectService(BlazeProjectDataManager.class, mockProjectDataManager);
type = BlazeCommandRunConfigurationType.getInstance();
RunnerAndConfigurationSettings runnerAndConfigurationSettings = runManager.createConfiguration("Blaze Configuration", type.getFactory());
runManager.addConfiguration(runnerAndConfigurationSettings, false);
configuration = (BlazeCommandRunConfiguration) runnerAndConfigurationSettings.getConfiguration();
}
use of com.google.idea.blaze.base.model.MockBlazeProjectDataManager in project intellij by bazelbuild.
the class BlazeCommandRunConfigurationSettingsEditorTest method doSetup.
@Before
public final void doSetup() throws Exception {
// Without BlazeProjectData, the configuration editor is always disabled.
BlazeProjectDataManager mockProjectDataManager = new MockBlazeProjectDataManager(MockBlazeProjectDataBuilder.builder(workspaceRoot).build());
registerProjectService(BlazeProjectDataManager.class, mockProjectDataManager);
type = BlazeCommandRunConfigurationType.getInstance();
configuration = type.getFactory().createTemplateConfiguration(getProject());
}
use of com.google.idea.blaze.base.model.MockBlazeProjectDataManager in project intellij by bazelbuild.
the class TestTargetHeuristicTest method doSetup.
@Before
public final void doSetup() {
BlazeProjectData blazeProjectData = MockBlazeProjectDataBuilder.builder(workspaceRoot).build();
registerProjectService(BlazeProjectDataManager.class, new MockBlazeProjectDataManager(blazeProjectData));
}
use of com.google.idea.blaze.base.model.MockBlazeProjectDataManager in project intellij by bazelbuild.
the class RunConfigurationSerializerTest method doSetup.
@Before
public final void doSetup() {
runManager = RunManagerImpl.getInstanceImpl(getProject());
// Without BlazeProjectData, the configuration editor is always disabled.
BlazeProjectDataManager mockProjectDataManager = new MockBlazeProjectDataManager(MockBlazeProjectDataBuilder.builder(workspaceRoot).build());
registerProjectService(BlazeProjectDataManager.class, mockProjectDataManager);
RunnerAndConfigurationSettings runnerAndConfigurationSettings = runManager.createConfiguration("Blaze Configuration", BlazeCommandRunConfigurationType.getInstance().getFactory());
runManager.addConfiguration(runnerAndConfigurationSettings, false);
configuration = (BlazeCommandRunConfiguration) runnerAndConfigurationSettings.getConfiguration();
}
use of com.google.idea.blaze.base.model.MockBlazeProjectDataManager in project intellij by bazelbuild.
the class BlazeBuildServiceTest method initTest.
@Override
protected void initTest(Container applicationServices, Container projectServices) {
BlazeImportSettingsManager importSettingsManager = new BlazeImportSettingsManager();
importSettingsManager.setImportSettings(new BlazeImportSettings("", "", "", "", Blaze.BuildSystem.Blaze));
projectServices.register(BlazeImportSettingsManager.class, importSettingsManager);
applicationServices.register(ExperimentService.class, new MockExperimentService());
ProjectView view = ProjectView.builder().add(ListSection.builder(TargetSection.KEY).add(TargetExpression.fromStringSafe("//view/target:one")).add(TargetExpression.fromStringSafe("//view/target:two"))).build();
viewSet = ProjectViewSet.builder().add(new File("view/target/.blazeproject"), view).build();
ProjectViewManager viewManager = new MockProjectViewManager(viewSet);
projectServices.register(ProjectViewManager.class, viewManager);
BlazeProjectData blazeProjectData = MockBlazeProjectDataBuilder.builder(workspaceRoot).build();
projectServices.register(BlazeProjectDataManager.class, new MockBlazeProjectDataManager(blazeProjectData));
applicationServices.register(BlazeBuildService.class, spy(new BlazeBuildService()));
service = BlazeBuildService.getInstance();
assertThat(service).isNotNull();
// Can't mock BlazeExecutor.submitTask.
doNothing().when(service).buildTargetExpressions(any(), any(), any(), any());
}
Aggregations