Search in sources :

Example 1 with MyMockApplication

use of com.facebook.buck.intellij.ideabuck.test.util.MyMockApplication in project buck by facebook.

the class BuckEventsConsumerTest method initialiseEventsConsumer.

public BuckEventsConsumer initialiseEventsConsumer() {
    Extensions.registerAreaClass("IDEA_PROJECT", null);
    MockDisposable mockDisposable = new MockDisposable();
    MockProject project = new MockProjectEx(new MockDisposable());
    MockApplication application = new MyMockApplication(mockDisposable);
    ApplicationManager.setApplication(application, mockDisposable);
    final BuckEventsConsumer buckEventsConsumer = new BuckEventsConsumer(project);
    project.registerService(BuckUIManager.class, new BuckUIManager());
    project.registerService(ToolWindowManager.class, new Mock.MyToolWindowManager());
    application.registerService(FileDocumentManager.class, new MockFileDocumentManagerImpl(null, null));
    application.registerService(VirtualFileManager.class, EasyMock.createMock(VirtualFileManager.class));
    return buckEventsConsumer;
}
Also used : MockProject(com.intellij.mock.MockProject) MockFileDocumentManagerImpl(com.intellij.mock.MockFileDocumentManagerImpl) MockApplication(com.intellij.mock.MockApplication) MyMockApplication(com.facebook.buck.intellij.ideabuck.test.util.MyMockApplication) VirtualFileManager(com.intellij.openapi.vfs.VirtualFileManager) MockDisposable(com.facebook.buck.intellij.ideabuck.test.util.MockDisposable) MyMockApplication(com.facebook.buck.intellij.ideabuck.test.util.MyMockApplication) MockProjectEx(com.intellij.mock.MockProjectEx) EasyMock(org.easymock.EasyMock) Mock(com.intellij.mock.Mock)

Aggregations

MockDisposable (com.facebook.buck.intellij.ideabuck.test.util.MockDisposable)1 MyMockApplication (com.facebook.buck.intellij.ideabuck.test.util.MyMockApplication)1 Mock (com.intellij.mock.Mock)1 MockApplication (com.intellij.mock.MockApplication)1 MockFileDocumentManagerImpl (com.intellij.mock.MockFileDocumentManagerImpl)1 MockProject (com.intellij.mock.MockProject)1 MockProjectEx (com.intellij.mock.MockProjectEx)1 VirtualFileManager (com.intellij.openapi.vfs.VirtualFileManager)1 EasyMock (org.easymock.EasyMock)1