use of com.intellij.mock.MockPsiFile in project intellij-community by JetBrains.
the class PsiDocumentManagerImplTest method testGetDocument_FirstGet.
public void testGetDocument_FirstGet() throws Exception {
VirtualFile vFile = createFile();
final PsiFile file = new MockPsiFile(vFile, getPsiManager());
final Document document = getDocument(file);
assertNotNull(document);
assertSame(document, FileDocumentManager.getInstance().getDocument(vFile));
}
use of com.intellij.mock.MockPsiFile in project intellij by bazelbuild.
the class BlazeRenderErrorContributorTest method testNoIssuesIfNoErrors.
@Test
public void testNoIssuesIfNoErrors() {
PsiFile file = new MockPsiFile(new MockPsiManager(project));
file.putUserData(ModuleUtilCore.KEY_MODULE, module);
RenderResult result = RenderResult.createBlank(file);
RenderErrorModel errorModel = RenderErrorModelFactory.createErrorModel(result, null);
assertThat(errorModel.getIssues()).isEmpty();
}
use of com.intellij.mock.MockPsiFile in project intellij by bazelbuild.
the class BlazeRenderErrorContributorTest method createRenderErrorModelWithBrokenClasses.
private RenderErrorModel createRenderErrorModelWithBrokenClasses() {
PsiFile file = new MockPsiFile(new MockPsiManager(project));
file.putUserData(ModuleUtilCore.KEY_MODULE, module);
RenderResult result = RenderResult.createBlank(file);
result.getLogger().addBrokenClass("com.google.example.CustomView", new Exception("resource not found"));
return RenderErrorModelFactory.createErrorModel(result, null);
}
use of com.intellij.mock.MockPsiFile in project intellij by bazelbuild.
the class BlazeRenderErrorContributorTest method createRenderErrorModelWithMissingClasses.
private RenderErrorModel createRenderErrorModelWithMissingClasses(String... classNames) {
PsiFile file = new MockPsiFile(new MockPsiManager(project));
file.putUserData(ModuleUtilCore.KEY_MODULE, module);
RenderResult result = RenderResult.createBlank(file);
for (String className : classNames) {
result.getLogger().addMissingClass(className);
}
return RenderErrorModelFactory.createErrorModel(result, null);
}
use of com.intellij.mock.MockPsiFile in project android by JetBrains.
the class GradleRenderErrorContributorTest method createResultWithBrokenClass.
private RenderResult createResultWithBrokenClass() {
PsiFile file = new MockPsiFile(new MockPsiManager(myProject));
file.putUserData(ModuleUtilCore.KEY_MODULE, myModule);
RenderResult result = RenderResult.createBlank(file);
result.getLogger().addBrokenClass("com.google.Class", new Exception());
return result;
}
Aggregations