Search in sources :

Example 1 with ProjectPropertiesComponentImpl

use of com.intellij.ide.util.ProjectPropertiesComponentImpl in project buck by facebook.

the class BuckModuleTest method initBuckModule.

public Project initBuckModule() {
    Extensions.registerAreaClass("IDEA_PROJECT", null);
    MockDisposable mockDisposable = new MockDisposable();
    MockProjectEx project = new MockProjectEx(mockDisposable);
    MockApplication application = new MockApplicationEx(mockDisposable);
    ApplicationManager.setApplication(application, mockDisposable);
    application.registerService(UISettings.class, UISettings.getShadowInstance());
    application.registerService(PropertiesComponent.class, new ProjectPropertiesComponentImpl());
    FileTypeManager fileTypeManager = EasyMock.createMock(FileTypeManager.class);
    EasyMock.expect(fileTypeManager.getFileTypeByFileName(BuckFileType.INSTANCE.getDefaultExtension())).andReturn(BuckFileType.INSTANCE).times(3);
    EasyMock.replay(fileTypeManager);
    application.registerService(FileTypeManager.class, fileTypeManager);
    project.addComponent(PsiDocumentManager.class, EasyMock.createMock(PsiDocumentManager.class));
    return project;
}
Also used : MockApplicationEx(com.intellij.mock.MockApplicationEx) MockApplication(com.intellij.mock.MockApplication) MockDisposable(com.facebook.buck.intellij.ideabuck.test.util.MockDisposable) ProjectPropertiesComponentImpl(com.intellij.ide.util.ProjectPropertiesComponentImpl) FileTypeManager(com.intellij.openapi.fileTypes.FileTypeManager) MockProjectEx(com.intellij.mock.MockProjectEx) PsiDocumentManager(com.intellij.psi.PsiDocumentManager)

Aggregations

MockDisposable (com.facebook.buck.intellij.ideabuck.test.util.MockDisposable)1 ProjectPropertiesComponentImpl (com.intellij.ide.util.ProjectPropertiesComponentImpl)1 MockApplication (com.intellij.mock.MockApplication)1 MockApplicationEx (com.intellij.mock.MockApplicationEx)1 MockProjectEx (com.intellij.mock.MockProjectEx)1 FileTypeManager (com.intellij.openapi.fileTypes.FileTypeManager)1 PsiDocumentManager (com.intellij.psi.PsiDocumentManager)1