use of com.google.idea.blaze.base.sync.data.BlazeProjectDataManager in project intellij by bazelbuild.
the class TestRecorderBlazeCommandRunConfigurationTest 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);
BlazeCommandRunConfigurationHandlerProvider mockHandler = new MockBlazeAndroidBinaryRunConfigurationHandlerProvider();
ExtensionPoint<BlazeCommandRunConfigurationHandlerProvider> ep = Extensions.getRootArea().getExtensionPoint(BlazeCommandRunConfigurationHandlerProvider.EP_NAME);
ep.registerExtension(mockHandler, LoadingOrder.FIRST);
Disposer.register(getTestRootDisposable(), () -> ep.unregisterExtension(mockHandler));
MockBlazeProjectDataBuilder builder = MockBlazeProjectDataBuilder.builder(workspaceRoot);
builder.setTargetMap(TargetMapBuilder.builder().addTarget(TargetIdeInfo.builder().setKind(Kind.ANDROID_BINARY).setLabel("//label:android_binary_rule").build()).addTarget(TargetIdeInfo.builder().setKind(Kind.ANDROID_TEST).setLabel("//label:android_test_rule").build()).build());
registerProjectService(BlazeProjectDataManager.class, new MockBlazeProjectDataManager(builder.build()));
}
use of com.google.idea.blaze.base.sync.data.BlazeProjectDataManager in project intellij by bazelbuild.
the class PyImportResolverStrategyTestCase method doSetup.
@Before
public final void doSetup() {
BlazeProjectDataManager mockProjectDataManager = new MockBlazeProjectDataManager(MockBlazeProjectDataBuilder.builder(workspaceRoot).setOutputBase(fileSystem.getRootDir()).build());
registerProjectService(BlazeProjectDataManager.class, mockProjectDataManager);
}
use of com.google.idea.blaze.base.sync.data.BlazeProjectDataManager in project intellij by bazelbuild.
the class BuildFileIntegrationTestCase method doSetup.
@Before
public final void doSetup() {
BlazeProjectDataManager mockProjectDataManager = new MockBlazeProjectDataManager(MockBlazeProjectDataBuilder.builder(workspaceRoot).setOutputBase(fileSystem.getRootDir() + "/output_base").build());
registerProjectService(BlazeProjectDataManager.class, mockProjectDataManager);
editorTest = new EditorTestHelper(getProject(), testFixture);
}
use of com.google.idea.blaze.base.sync.data.BlazeProjectDataManager in project intellij by bazelbuild.
the class MultipleJavaClassesTestConfigurationProducerTest method addSourceFolder.
@Before
public final void addSourceFolder() {
// create a source root so that the package prefixes are correct.
VirtualFile pkgRoot = workspace.createDirectory(new WorkspacePath("java"));
ApplicationManager.getApplication().runWriteAction(() -> {
final ModifiableRootModel model = ModuleRootManager.getInstance(testFixture.getModule()).getModifiableModel();
ContentEntry contentEntry = model.getContentEntries()[0];
javaSourceRoot = contentEntry.addSourceFolder(pkgRoot, false, "");
model.commit();
});
BlazeProjectDataManager mockProjectDataManager = new MockBlazeProjectDataManager(MockBlazeProjectDataBuilder.builder(workspaceRoot).build());
registerProjectService(BlazeProjectDataManager.class, mockProjectDataManager);
}
use of com.google.idea.blaze.base.sync.data.BlazeProjectDataManager in project intellij by bazelbuild.
the class ProjectViewIntegrationTestCase method doSetup.
@Before
public final void doSetup() {
BlazeProjectDataManager mockProjectDataManager = new MockBlazeProjectDataManager(MockBlazeProjectDataBuilder.builder(workspaceRoot).build());
registerProjectService(BlazeProjectDataManager.class, mockProjectDataManager);
editorTest = new EditorTestHelper(getProject(), testFixture);
}
Aggregations