diff --git a/platform/testFramework/src/com/intellij/testFramework/fixtures/CodeInsightTestFixture.java b/platform/testFramework/src/com/intellij/testFramework/fixtures/CodeInsightTestFixture.java index 581ca54b6baa..4d6314ecfff4 100644 --- a/platform/testFramework/src/com/intellij/testFramework/fixtures/CodeInsightTestFixture.java +++ b/platform/testFramework/src/com/intellij/testFramework/fixtures/CodeInsightTestFixture.java @@ -290,6 +290,8 @@ public interface CodeInsightTestFixture extends IdeaProjectTestFixture { @NotNull HighlightTestInfo testFile(@NonNls @NotNull String... filePath); + void openFileInEditor(@NotNull VirtualFile file); + void testInspection(@NotNull String testDir, @NotNull InspectionToolWrapper toolWrapper); /** @@ -462,6 +464,8 @@ public interface CodeInsightTestFixture extends IdeaProjectTestFixture { @NotNull Collection findAllGutters(@NotNull @TestDataFile String filePath); + Collection findAllGutters(); + void type(final char c); void type(@NotNull String s); diff --git a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java index f4264f760cd9..ff5e2020a2b9 100644 --- a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java +++ b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java @@ -441,6 +441,7 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig }; } + @Override public void openFileInEditor(@NotNull final VirtualFile file) { myFile = file; myEditor = createEditor(file); @@ -930,9 +931,15 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig @Override @NotNull public Collection findAllGutters(@NotNull final String filePath) { + configureByFilesInner(filePath); + return findAllGutters(); + } + + @Override + @NotNull + public Collection findAllGutters() { final Project project = getProject(); final SortedMap> result = new TreeMap>(); - configureByFilesInner(filePath); List infos = doHighlighting(); for (HighlightInfo info : infos) { @@ -1461,9 +1468,6 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig private Editor createEditor(@NotNull VirtualFile file) { final Project project = getProject(); final FileEditorManager instance = FileEditorManager.getInstance(project); - if (file.getFileType().isBinary()) { - return null; - } Editor editor = instance.openTextEditor(new OpenFileDescriptor(project, file), false); if (editor != null) { editor.getCaretModel().moveToOffset(0); diff --git a/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/xslt/XsltBasicTest.java b/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/xslt/XsltBasicTest.java index 7070314550e1..4c2a7a5aa365 100644 --- a/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/xslt/XsltBasicTest.java +++ b/plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/xslt/XsltBasicTest.java @@ -18,8 +18,6 @@ package org.intellij.lang.xpath.xslt; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.impl.PsiFileEx; import com.intellij.psi.xml.XmlFile; - -import com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl; import org.intellij.lang.xpath.TestBase; import org.intellij.lang.xpath.xslt.impl.XsltChecker; @@ -95,7 +93,7 @@ public class XsltBasicTest extends TestBase { final String fileName = getTestFileName(); String path = fileName.replaceAll("_.*$", "") + ".xsl"; final VirtualFile file = myFixture.copyFileToProject(path); - ((CodeInsightTestFixtureImpl)myFixture).openFileInEditor(file); + myFixture.openFileInEditor(file); if (fileName.endsWith("_Loaded")) { ((XmlFile)myFixture.getFile()).getDocument(); assertTrue(((PsiFileEx)myFixture.getFile()).isContentsLoaded());