support java-tests written in groovy

This commit is contained in:
peter
2010-08-31 12:38:25 +01:00
parent f9844b0c5a
commit 5bca962394
2 changed files with 7 additions and 3 deletions
@@ -61,6 +61,9 @@ public abstract class LightFixtureCompletionTestCase extends LightCodeInsightFix
assertOrderedEquals(myFixture.getLookupElementStrings(), items);
}
protected void type(String s) {
myFixture.type(s);
}
protected void type(char c) {
myFixture.type(c);
}
@@ -25,6 +25,7 @@
package com.intellij.openapi.application.ex;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.testFramework.TestRunnerUtil;
import com.intellij.util.containers.ConcurrentHashMap;
import junit.framework.TestCase;
@@ -298,7 +299,7 @@ public class PathManagerEx {
return result;
}
String targetFile = toSystemDependentName(clazz.getName().replace('.', '/') + ".java");
String targetFile = toSystemDependentName(clazz.getName().replace('.', '/'));
if (COMMUNITY_TEST_FILES_PARSED_FLAG.compareAndSet(false, true)) {
parseCommunityTestFiles();
}
@@ -370,7 +371,7 @@ public class PathManagerEx {
private static void process(File file) {
String path = file.getAbsolutePath();
if (!path.endsWith(".java")) {
if (!path.endsWith(".java") && !path.endsWith(".groovy")) {
return;
}
@@ -385,7 +386,7 @@ public class PathManagerEx {
// Never expect to be here.
return;
}
COMMUNITY_TEST_FILES.add(path.substring(indexToUse));
COMMUNITY_TEST_FILES.add(StringUtil.trimEnd(StringUtil.trimEnd(path.substring(indexToUse), ".java"), ".groovy"));
}
}
}