spellchecker finds its testdata after move

This commit is contained in:
Dmitry Jemerov
2009-08-31 16:57:52 +04:00
parent 559f33abe6
commit 00de95280c
12 changed files with 24 additions and 11 deletions
@@ -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;
}
}
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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 {
@@ -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";
@@ -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";
}
@@ -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";
}