mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
spellchecker finds its testdata after move
This commit is contained in:
@@ -17,4 +17,14 @@ public class PluginPathManager {
|
||||
}
|
||||
return new File(homePath, "plugins/" + pluginName).getPath();
|
||||
}
|
||||
|
||||
public static String getPluginHomePathRelative(String pluginName) {
|
||||
String homePath = PathManager.getHomePath();
|
||||
final String relativePath = "/community/plugins/" + pluginName;
|
||||
File candidate = new File(homePath, relativePath);
|
||||
if (candidate.isDirectory()) {
|
||||
return relativePath;
|
||||
}
|
||||
return "/plugins/" + pluginName;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -7,9 +7,8 @@ import com.intellij.spellchecker.inspections.SpellCheckerInspectionToolProvider;
|
||||
* User: Ekaterina Shliakhovetskaja
|
||||
*/
|
||||
public class ClassNameWithMistakesInspectionTest extends SpellcheckerInspectionTestCase {
|
||||
|
||||
protected String getBasePath() {
|
||||
return "/plugins/spellchecker/tests/testData/inspection/classNameWithMistakes";
|
||||
return getSpellcheckerTestDataPath() + "/inspection/classNameWithMistakes";
|
||||
}
|
||||
|
||||
public void testJava() throws Throwable {
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ public class CommentsWithMistakesInspectionTest extends SpellcheckerInspectionTe
|
||||
|
||||
|
||||
protected String getBasePath() {
|
||||
return "/plugins/spellchecker/tests/testData/inspection/commentsWithMistakes";
|
||||
return getSpellcheckerTestDataPath() + "/inspection/commentsWithMistakes";
|
||||
}
|
||||
|
||||
public void testJava() throws Throwable {
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ public class DocCommentWithMistakesInspectionTest extends SpellcheckerInspection
|
||||
|
||||
|
||||
protected String getBasePath() {
|
||||
return "/plugins/spellchecker/tests/testData/inspection/docCommentWithMistakes";
|
||||
return getSpellcheckerTestDataPath() + "/inspection/docCommentWithMistakes";
|
||||
}
|
||||
|
||||
public void testJava() throws Throwable {
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ public class FieldNameWithMistakesInspectionTest extends SpellcheckerInspectionT
|
||||
|
||||
|
||||
protected String getBasePath() {
|
||||
return "/plugins/spellchecker/tests/testData/inspection/fieldNameWithMistakes";
|
||||
return getSpellcheckerTestDataPath() + "/inspection/fieldNameWithMistakes";
|
||||
}
|
||||
|
||||
public void testJava() throws Throwable {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import com.intellij.spellchecker.inspections.SpellCheckerInspectionToolProvider;
|
||||
public class GroovyFileWithTypos extends SpellcheckerInspectionTestCase {
|
||||
|
||||
protected String getBasePath() {
|
||||
return "/plugins/spellchecker/tests/testData/inspection/groovy";
|
||||
return getSpellcheckerTestDataPath() + "/inspection/groovy";
|
||||
}
|
||||
|
||||
public void testGroovy() throws Throwable {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import com.intellij.spellchecker.inspections.SpellCheckerInspectionToolProvider;
|
||||
public class JSFileWithTypos extends SpellcheckerInspectionTestCase {
|
||||
|
||||
protected String getBasePath() {
|
||||
return "/plugins/spellchecker/tests/testData/inspection/js";
|
||||
return getSpellcheckerTestDataPath() + "/inspection/js";
|
||||
}
|
||||
|
||||
public void testJS() throws Throwable {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import com.intellij.spellchecker.inspections.SpellCheckerInspectionToolProvider;
|
||||
public class LocalVariableWithMistakesInspectionTest extends SpellcheckerInspectionTestCase {
|
||||
|
||||
protected String getBasePath() {
|
||||
return "/plugins/spellchecker/tests/testData/inspection/localVariableNameWithMistakes";
|
||||
return getSpellcheckerTestDataPath() + "/inspection/localVariableNameWithMistakes";
|
||||
}
|
||||
|
||||
public void testJava() throws Throwable {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import com.intellij.spellchecker.inspections.SpellCheckerInspectionToolProvider;
|
||||
public class MethodNameWithMistakesInspectionTest extends SpellcheckerInspectionTestCase {
|
||||
|
||||
protected String getBasePath() {
|
||||
return "/plugins/spellchecker/tests/testData/inspection/methodNameWithMistakes";
|
||||
return getSpellcheckerTestDataPath() + "/inspection/methodNameWithMistakes";
|
||||
}
|
||||
|
||||
public void testJava() throws Throwable {
|
||||
|
||||
+4
@@ -2,11 +2,15 @@ package com.intellij.spellchecker.inspection;
|
||||
|
||||
import com.intellij.codeInspection.LocalInspectionTool;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.application.PluginPathManager;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
public abstract class SpellcheckerInspectionTestCase extends JavaCodeInsightFixtureTestCase {
|
||||
protected static String getSpellcheckerTestDataPath() {
|
||||
return PluginPathManager.getPluginHomePathRelative("spellchecker") + "/testData";
|
||||
}
|
||||
|
||||
@NonNls
|
||||
protected String DATA_PATH = FileUtil.toSystemIndependentName(PathManager.getHomePath()) + "/plugins/spellchecker/core/tests/testData";
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import com.intellij.spellchecker.inspections.SpellCheckerInspectionToolProvider;
|
||||
public class StringWithMistakesInspectionTest extends SpellcheckerInspectionTestCase {
|
||||
|
||||
protected String getBasePath() {
|
||||
return "/plugins/spellchecker/tests/testData/inspection/stringWithMistakes";
|
||||
return getSpellcheckerTestDataPath() + "/inspection/stringWithMistakes";
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import com.intellij.spellchecker.inspections.SpellCheckerInspectionToolProvider;
|
||||
public class XmlWithMistakesInspectionTest extends SpellcheckerInspectionTestCase {
|
||||
|
||||
protected String getBasePath() {
|
||||
return "/plugins/spellchecker/tests/testData/inspection/xmlWithMistakes";
|
||||
return getSpellcheckerTestDataPath() + "/inspection/xmlWithMistakes";
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user