mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
Regression after [java-i18n] Reuse AnnotationContext for finding the PropertyKey annotation / Tagir Valeev / 434562521bc15769ff6e543e341ea95e904fee4e GitOrigin-RevId: f3c11998fbee29fc688dab5ac221f145d1735f1a
44 lines
1.5 KiB
Java
44 lines
1.5 KiB
Java
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
|
package com.intellij.codeInspection;
|
|
|
|
import com.intellij.openapi.application.PluginPathManager;
|
|
import com.intellij.psi.PsiReference;
|
|
import com.intellij.testFramework.LightProjectDescriptor;
|
|
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase;
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
public class LightPropertiesResolveTest extends LightJavaCodeInsightFixtureTestCase {
|
|
@Override
|
|
protected @NotNull LightProjectDescriptor getProjectDescriptor() {
|
|
return JAVA_8;
|
|
}
|
|
|
|
@Override
|
|
protected String getBasePath() {
|
|
return PluginPathManager.getPluginHomePathRelative("java-i18n") + "/testData/lightResolve";
|
|
}
|
|
|
|
public void testSameNameProperty() {
|
|
createBundles();
|
|
PsiReference reference = myFixture.getReferenceAtCaretPosition("SameNameProperty.java");
|
|
assertNotNull(reference.resolve());
|
|
}
|
|
|
|
private void createBundles() {
|
|
myFixture.addFileToProject("Bundle1.properties", "same.name=b1");
|
|
myFixture.addFileToProject("Bundle2.properties", "same.name=b2");
|
|
}
|
|
|
|
public void testLocalVar() {
|
|
createBundles();
|
|
PsiReference reference = myFixture.getReferenceAtCaretPosition("LocalVar.java");
|
|
assertNotNull(reference.resolve());
|
|
}
|
|
|
|
public void testTypeUse() {
|
|
createBundles();
|
|
PsiReference reference = myFixture.getReferenceAtCaretPosition("TypeUse.java");
|
|
assertNotNull(reference.resolve());
|
|
}
|
|
}
|