From a988415e22da75d9661a17ca9fd42c6edc7636fa Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Tue, 21 Oct 2014 13:22:30 +0400 Subject: [PATCH] Add file text to assert message --- .../codeInsight/AbstractOutOfBlockModificationTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/idea/tests/org/jetbrains/jet/plugin/codeInsight/AbstractOutOfBlockModificationTest.java b/idea/tests/org/jetbrains/jet/plugin/codeInsight/AbstractOutOfBlockModificationTest.java index d04603d058e..22ac460b3a5 100644 --- a/idea/tests/org/jetbrains/jet/plugin/codeInsight/AbstractOutOfBlockModificationTest.java +++ b/idea/tests/org/jetbrains/jet/plugin/codeInsight/AbstractOutOfBlockModificationTest.java @@ -16,6 +16,7 @@ package org.jetbrains.jet.plugin.codeInsight; +import com.intellij.openapi.util.io.FileUtil; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiManager; @@ -23,6 +24,9 @@ import com.intellij.psi.impl.PsiModificationTrackerImpl; import org.jetbrains.jet.plugin.JetLightCodeInsightFixtureTestCase; import org.jetbrains.jet.plugin.PluginTestCaseBase; +import java.io.File; +import java.io.IOException; + public abstract class AbstractOutOfBlockModificationTest extends JetLightCodeInsightFixtureTestCase { @Override public void setUp() throws Exception { @@ -35,7 +39,7 @@ public abstract class AbstractOutOfBlockModificationTest extends JetLightCodeIns return PluginTestCaseBase.getTestDataPathBase() + "/codeInsight/outOfBlock"; } - protected void doTest(String path) { + protected void doTest(String path) throws IOException { myFixture.configureByFile(path); boolean expectedOutOfBlock = getExpectedOutOfBlockResult(); @@ -57,7 +61,7 @@ public abstract class AbstractOutOfBlockModificationTest extends JetLightCodeIns assertTrue("Modification tracker should always be changed after type", modificationCountBeforeType != modificationCountAfterType); - assertEquals("Result for out of block test is differs from expected on element " + element, + assertEquals("Result for out of block test is differs from expected on element in file:\n" + FileUtil.loadFile(new File(path)), expectedOutOfBlock, oobBeforeType != oobAfterCount); }