mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Ant finds its testdata after move
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package com.intellij.openapi.application;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class PluginPathManager {
|
||||
private PluginPathManager() {
|
||||
}
|
||||
|
||||
public static String getPluginHomePath(String pluginName) {
|
||||
String homePath = PathManager.getHomePath();
|
||||
File candidate = new File(homePath, "community/plugins/" + pluginName);
|
||||
if (candidate.isDirectory()) {
|
||||
return candidate.getPath();
|
||||
}
|
||||
return new File(homePath, "plugins/" + pluginName).getPath();
|
||||
}
|
||||
}
|
||||
@@ -6,16 +6,13 @@ import com.intellij.codeInsight.lookup.Lookup;
|
||||
import com.intellij.codeInsight.lookup.LookupElement;
|
||||
import com.intellij.codeInsight.lookup.LookupManager;
|
||||
import com.intellij.codeInsight.lookup.impl.TestLookupManager;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.application.PluginPathManager;
|
||||
import com.intellij.testFramework.LightCodeInsightTestCase;
|
||||
|
||||
/**
|
||||
* @author zhzhot
|
||||
*/
|
||||
public class AntCompletionTest extends LightCodeInsightTestCase {
|
||||
|
||||
protected String getTestDataPath() {
|
||||
return PathManager.getHomePath() + "/plugins/ant/tests/data/psi/completion/";
|
||||
return PluginPathManager.getPluginHomePath("ant") + "/tests/data/psi/completion/";
|
||||
}
|
||||
|
||||
public void testSimpleProperty() throws Exception {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
package com.intellij.lang.ant;
|
||||
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.application.PluginPathManager;
|
||||
import com.intellij.testFramework.fixtures.CodeInsightTestFixture;
|
||||
import com.intellij.testFramework.fixtures.IdeaProjectTestFixture;
|
||||
import com.intellij.testFramework.fixtures.JavaTestFixtureFactory;
|
||||
@@ -24,7 +24,7 @@ public class AntMultiFileCompletionTest extends TestCase {
|
||||
private CodeInsightTestFixture myFixture;
|
||||
|
||||
protected String getTestDataPath() {
|
||||
return PathManager.getHomePath() + "/plugins/ant/tests/data/psi/completion/";
|
||||
return PluginPathManager.getPluginHomePath("ant") + "/tests/data/psi/completion/";
|
||||
}
|
||||
|
||||
public void testPropertyCompletion() throws Throwable {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
package com.intellij.lang.ant;
|
||||
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.application.PluginPathManager;
|
||||
import com.intellij.testFramework.ParsingTestCase;
|
||||
|
||||
public class AntParsingTest extends ParsingTestCase {
|
||||
@@ -14,7 +14,7 @@ public class AntParsingTest extends ParsingTestCase {
|
||||
}
|
||||
|
||||
protected String getTestDataPath() {
|
||||
return PathManager.getHomePath() + "/plugins/ant/tests/data";
|
||||
return PluginPathManager.getPluginHomePath("ant") + "/tests/data";
|
||||
}
|
||||
|
||||
public void testSingleProject() throws Exception {
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.intellij.lang.ant;
|
||||
|
||||
import com.intellij.codeInsight.TargetElementUtilBase;
|
||||
import com.intellij.lang.ant.psi.AntFile;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.application.PluginPathManager;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
@@ -115,7 +115,7 @@ public class AntRenameTest extends LightCodeInsightTestCase {
|
||||
}
|
||||
|
||||
protected String getTestDataPath() {
|
||||
return PathManager.getHomePath().replace('\\', '/') + "/plugins/ant/tests/data/psi/rename/";
|
||||
return PluginPathManager.getPluginHomePath("ant").replace('\\', '/') + "/tests/data/psi/rename/";
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.intellij.lang.ant.psi.AntProperty;
|
||||
import com.intellij.lang.ant.psi.AntTarget;
|
||||
import com.intellij.lang.ant.psi.AntTask;
|
||||
import com.intellij.lang.ant.psi.impl.reference.AntPropertyReference;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.application.PluginPathManager;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiReference;
|
||||
@@ -249,7 +249,7 @@ public class AntResolveTest extends ResolveTestCase {
|
||||
}
|
||||
|
||||
protected String getTestDataPath() {
|
||||
return PathManager.getHomePath() + "/plugins/ant/tests/data/psi/resolve/";
|
||||
return PluginPathManager.getPluginHomePath("ant") + "/tests/data/psi/resolve/";
|
||||
}
|
||||
|
||||
private PsiReference configure() throws Exception {
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.intellij.lang.ant;
|
||||
|
||||
import com.intellij.lang.ant.psi.AntFile;
|
||||
import com.intellij.lang.ant.psi.introspection.AntTypeDefinition;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.application.PluginPathManager;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.PsiFile;
|
||||
@@ -21,7 +21,7 @@ public class CustomTypesTest extends ParsingTestCase {
|
||||
}
|
||||
|
||||
protected String getTestDataPath() {
|
||||
return PathManager.getHomePath() + "/plugins/ant/tests/data/psi/customTypes";
|
||||
return PluginPathManager.getPluginHomePath("ant") + "/tests/data/psi/customTypes";
|
||||
}
|
||||
|
||||
public void testAntCustomTask() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user