mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
See comment for details: https://youtrack.jetbrains.com/issue/SCL-20590/Quick-Definition-use-sources-when-available#focus=Comments-27-6786910.0-0 GitOrigin-RevId: a5a03d5d5aef954d30f017f446440c74ddad1b87
43 lines
1.7 KiB
Java
43 lines
1.7 KiB
Java
package com.intellij.codeInsight;
|
|
|
|
import com.intellij.JavaTestUtil;
|
|
import com.intellij.codeInsight.lookup.LookupElement;
|
|
import com.intellij.lang.properties.IProperty;
|
|
import com.intellij.lang.properties.psi.Property;
|
|
import com.intellij.psi.PsiElement;
|
|
import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase;
|
|
import com.intellij.util.containers.ContainerUtil;
|
|
|
|
import java.util.Arrays;
|
|
|
|
/**
|
|
* See also {@link com.intellij.java.navigation.ShowImplementationHandlerTest}
|
|
* @author Dmitry AJvdeev
|
|
*/
|
|
public class ShowImplementationsTest extends JavaCodeInsightFixtureTestCase {
|
|
|
|
public void testMessages() {
|
|
myFixture.configureByFiles("Bundles.java", "bundle.properties", "bundle_fr.properties");
|
|
PsiElement[] elements = ShowImplementationsTestUtil.getImplementations();
|
|
assertNotNull(elements);
|
|
assertEquals(2, elements.length);
|
|
assertTrue(elements[0] instanceof IProperty && elements[1] instanceof IProperty);
|
|
}
|
|
|
|
public void testMessagesCompletion() {
|
|
myFixture.configureByFiles("Bundles.java", "bundle.properties", "bundle_fr.properties");
|
|
LookupElement[] elements = myFixture.completeBasic();
|
|
assertNotNull(elements);
|
|
assertNotNull(ContainerUtil.find(elements, element -> element.getObject() instanceof Property));
|
|
PsiElement[] implementations = ShowImplementationsTestUtil.getImplementations();
|
|
assertNotNull(implementations);
|
|
assertEquals(Arrays.asList(implementations).toString(), 1, implementations.length);
|
|
assertTrue(implementations[0] instanceof IProperty);
|
|
}
|
|
|
|
@Override
|
|
protected String getBasePath() {
|
|
return JavaTestUtil.getRelativeJavaTestDataPath() + "/codeInsight/showImplementations/";
|
|
}
|
|
}
|