From fc111bcb1d6e853e966b4f659662663d8b887ea4 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Wed, 13 Jul 2016 15:10:00 +0300 Subject: [PATCH] clear parameter name --- .../LightPlatformCodeInsightTestCase.java | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java b/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java index 72c0f7a4e44c..f336446a5be5 100644 --- a/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java @@ -283,20 +283,20 @@ public abstract class LightPlatformCodeInsightTestCase extends LightPlatformTest /** * Validates that content of the editor as well as caret and selection matches one specified in data file that * should be formed with the same format as one used in configureByFile - * @param filePath - relative path from %IDEA_INSTALLATION_HOME%/testData/ + * @param expectedFilePath - relative path from %IDEA_INSTALLATION_HOME%/testData/ */ - protected void checkResultByFile(@TestDataFile @NonNls @NotNull String filePath) { - checkResultByFile(null, filePath, false); + protected void checkResultByFile(@TestDataFile @NonNls @NotNull String expectedFilePath) { + checkResultByFile(null, expectedFilePath, false); } /** * Validates that content of the editor as well as caret and selection matches one specified in data file that * should be formed with the same format as one used in configureByFile * @param message - this check specific message. Added to text, caret position, selection checking. May be null - * @param filePath - relative path from %IDEA_INSTALLATION_HOME%/testData/ + * @param expectedFilePath - relative path from %IDEA_INSTALLATION_HOME%/testData/ * @param ignoreTrailingSpaces - whether trailing spaces in editor in data file should be stripped prior to comparing. */ - protected void checkResultByFile(@Nullable String message, @TestDataFile @NotNull String filePath, final boolean ignoreTrailingSpaces) { + protected void checkResultByFile(@Nullable String message, @TestDataFile @NotNull String expectedFilePath, final boolean ignoreTrailingSpaces) { bringRealEditorBack(); getProject().getComponent(PostprocessReformattingAspect.class).doPostponedFormatting(); @@ -308,26 +308,27 @@ public abstract class LightPlatformCodeInsightTestCase extends LightPlatformTest PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); - String fullPath = getTestDataPath() + filePath; + String fullPath = getTestDataPath() + expectedFilePath; File ioFile = new File(fullPath); assertTrue(getMessage("Cannot find file " + fullPath, message), ioFile.exists()); - String fileText = null; + String fileText; try { fileText = FileUtil.loadFile(ioFile, CharsetToolkit.UTF8_CHARSET); } catch (IOException e) { LOG.error(e); + throw new RuntimeException(e); } - checkResultByText(message, StringUtil.convertLineSeparators(fileText), ignoreTrailingSpaces, getTestDataPath() + "/" + filePath); + checkResultByText(message, StringUtil.convertLineSeparators(fileText), ignoreTrailingSpaces, getTestDataPath() + "/" + expectedFilePath); } /** * Same as checkResultByFile but text is provided directly. */ - protected void checkResultByText(@NonNls @NotNull String fileText) { - checkResultByText(null, fileText, false, null); + protected void checkResultByText(@NonNls @NotNull String expectedFileText) { + checkResultByText(null, expectedFileText, false, null); } /** @@ -335,8 +336,8 @@ public abstract class LightPlatformCodeInsightTestCase extends LightPlatformTest * @param message - this check specific message. Added to text, caret position, selection checking. May be null * @param ignoreTrailingSpaces - whether trailing spaces in editor in data file should be stripped prior to comparing. */ - protected void checkResultByText(final String message, @NotNull String fileText, final boolean ignoreTrailingSpaces) { - checkResultByText(message, fileText, ignoreTrailingSpaces, null); + protected void checkResultByText(final String message, @NotNull String expectedFileText, final boolean ignoreTrailingSpaces) { + checkResultByText(message, expectedFileText, ignoreTrailingSpaces, null); } /** @@ -344,11 +345,11 @@ public abstract class LightPlatformCodeInsightTestCase extends LightPlatformTest * @param message - this check specific message. Added to text, caret position, selection checking. May be null * @param ignoreTrailingSpaces - whether trailing spaces in editor in data file should be stripped prior to comparing. */ - protected void checkResultByText(final String message, @NotNull final String fileText, final boolean ignoreTrailingSpaces, final String filePath) { + protected void checkResultByText(final String message, @NotNull String expectedFileText, final boolean ignoreTrailingSpaces, final String filePath) { bringRealEditorBack(); PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); ApplicationManager.getApplication().runWriteAction(() -> { - final Document document = EditorFactory.getInstance().createDocument(fileText); + final Document document = EditorFactory.getInstance().createDocument(expectedFileText); if (ignoreTrailingSpaces) { ((DocumentImpl)document).stripTrailingSpaces(getProject());