From 5bca9623940cd4f6d1ccd88ffe203e2aecde1a6c Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 30 Aug 2010 15:39:14 +0100 Subject: [PATCH] support java-tests written in groovy --- .../completion/LightFixtureCompletionTestCase.java | 3 +++ .../com/intellij/openapi/application/ex/PathManagerEx.java | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/LightFixtureCompletionTestCase.java b/java/java-tests/testSrc/com/intellij/codeInsight/completion/LightFixtureCompletionTestCase.java index 8dd4a2d099f2..de2ed0f84271 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/LightFixtureCompletionTestCase.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/LightFixtureCompletionTestCase.java @@ -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); } diff --git a/platform/platform-api/src/com/intellij/openapi/application/ex/PathManagerEx.java b/platform/platform-api/src/com/intellij/openapi/application/ex/PathManagerEx.java index e136d8f61aa7..38a28cb107c2 100644 --- a/platform/platform-api/src/com/intellij/openapi/application/ex/PathManagerEx.java +++ b/platform/platform-api/src/com/intellij/openapi/application/ex/PathManagerEx.java @@ -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")); } } }