diff --git a/ChangeLog.md b/ChangeLog.md index d428031a314..595ba527d85 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -131,6 +131,7 @@ New features: - [KT-11604](https://youtrack.jetbrains.com/issue/KT-11604) Support "Configure Spring facet" inspection on Kotlin classes - [KT-11407](https://youtrack.jetbrains.com/issue/KT-11407) Implemented "Generate Spring Dependency..." actions - [KT-11408](https://youtrack.jetbrains.com/issue/KT-11408) Implemented "Generate @Autowired Dependency..." action +- [KT-11652](https://youtrack.jetbrains.com/issue/KT-11652) Rename bean attributes mentioned in Spring XML config together with corresponding Kotlin declarations Issues fixed: @@ -164,6 +165,7 @@ Issues fixed: - [KT-11689](https://youtrack.jetbrains.com/issue/KT-11689) Fixed exception on attempt to navigate to Kotlin file from Spring notification balloon - [KT-11725](https://youtrack.jetbrains.com/issue/KT-11725) Fixed renaming of injected SpEL references - [KT-11720](https://youtrack.jetbrains.com/issue/KT-11720) Fixed renaming of Kotlin beans through SpEL references +- [KT-11719](https://youtrack.jetbrains.com/issue/KT-11719) Fixed renaming of Kotlin parameters references in XML files #### Debugger diff --git a/compiler/light-classes/src/org/jetbrains/kotlin/asJava/KtLightParameter.java b/compiler/light-classes/src/org/jetbrains/kotlin/asJava/KtLightParameter.java index 51727142728..fde3a881564 100644 --- a/compiler/light-classes/src/org/jetbrains/kotlin/asJava/KtLightParameter.java +++ b/compiler/light-classes/src/org/jetbrains/kotlin/asJava/KtLightParameter.java @@ -170,4 +170,14 @@ public class KtLightParameter extends LightParameter implements KtLightDeclarati public PsiElement getParent() { return getMethod().getParameterList(); } + + @Override + public boolean isEquivalentTo(PsiElement another) { + KtParameter kotlinOrigin = getKotlinOrigin(); + if (another instanceof KtLightParameter && kotlinOrigin != null) { + KtLightParameter anotherParam = (KtLightParameter) another; + return kotlinOrigin.equals(anotherParam.getKotlinOrigin()) && getClsDelegate().equals(anotherParam.getClsDelegate()); + } + return super.isEquivalentTo(another); + } } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/ideaExtensions/KotlinReferencesSearcher.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/ideaExtensions/KotlinReferencesSearcher.kt index 02acc8ca49a..1ec679790c6 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/ideaExtensions/KotlinReferencesSearcher.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/ideaExtensions/KotlinReferencesSearcher.kt @@ -224,8 +224,8 @@ class KotlinReferencesSearcher : QueryExecutorBase, + result: MutableList + ) { + checkConflictsAndReplaceUsageInfos(result) + } + override fun substituteElementToRename(element: PsiElement?, editor: Editor?): PsiElement? { val wrappedMethod = wrapPsiMethod(element) ?: return element diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/rename/RenameKotlinPropertyProcessor.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/rename/RenameKotlinPropertyProcessor.kt index 83f522d56a5..a6fadeb2b61 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/rename/RenameKotlinPropertyProcessor.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/rename/RenameKotlinPropertyProcessor.kt @@ -27,7 +27,6 @@ import com.intellij.psi.search.SearchScope import com.intellij.psi.search.searches.OverridingMethodsSearch import com.intellij.refactoring.listeners.RefactoringElementListener import com.intellij.refactoring.rename.RenameProcessor -import com.intellij.refactoring.rename.RenamePsiElementProcessor import com.intellij.refactoring.util.RefactoringUtil import com.intellij.usageView.UsageInfo import org.jetbrains.kotlin.asJava.LightClassUtil @@ -45,7 +44,7 @@ import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils import org.jetbrains.kotlin.resolve.OverrideResolver -class RenameKotlinPropertyProcessor : RenamePsiElementProcessor() { +class RenameKotlinPropertyProcessor : RenameKotlinPsiProcessor() { override fun canProcessElement(element: PsiElement): Boolean { val namedUnwrappedElement = element.namedUnwrappedElement return namedUnwrappedElement is KtProperty || (namedUnwrappedElement is KtParameter && namedUnwrappedElement.hasValOrVar()) diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/rename/RenameKotlinPsiProcessor.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/rename/RenameKotlinPsiProcessor.kt index 2cd17e34055..63eaaf71005 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/rename/RenameKotlinPsiProcessor.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/rename/RenameKotlinPsiProcessor.kt @@ -16,20 +16,27 @@ package org.jetbrains.kotlin.idea.refactoring.rename -import com.intellij.refactoring.rename.RenamePsiElementProcessor import com.intellij.psi.PsiElement -import com.intellij.usageView.UsageInfo +import com.intellij.psi.PsiReference +import com.intellij.psi.search.searches.MethodReferencesSearch +import com.intellij.refactoring.rename.RenamePsiElementProcessor +import org.jetbrains.kotlin.asJava.toLightMethods import org.jetbrains.kotlin.psi.KtNamedDeclaration +import org.jetbrains.kotlin.psi.KtNamedFunction +import org.jetbrains.kotlin.psi.KtParameter +import org.jetbrains.kotlin.psi.KtProperty +import org.jetbrains.kotlin.utils.SmartList abstract class RenameKotlinPsiProcessor : RenamePsiElementProcessor() { override fun canProcessElement(element: PsiElement): Boolean = element is KtNamedDeclaration - override fun findCollisions( - element: PsiElement?, - newName: String?, - allRenames: Map, - result: MutableList - ) { - checkConflictsAndReplaceUsageInfos(result) + override fun findReferences(element: PsiElement): Collection { + val references = SmartList(super.findReferences(element)) + if (element is KtNamedFunction + || (element is KtProperty && !element.isLocal) + || (element is KtParameter && element.hasValOrVar())) { + element.toLightMethods().flatMapTo(references) { MethodReferencesSearch.search(it) } + } + return references } } diff --git a/idea/tests/org/jetbrains/kotlin/findUsages/AbstractFindUsagesTest.java b/idea/tests/org/jetbrains/kotlin/findUsages/AbstractFindUsagesTest.java index b801c167400..7f2259e7d36 100644 --- a/idea/tests/org/jetbrains/kotlin/findUsages/AbstractFindUsagesTest.java +++ b/idea/tests/org/jetbrains/kotlin/findUsages/AbstractFindUsagesTest.java @@ -61,6 +61,7 @@ import org.jetbrains.kotlin.idea.findUsages.KotlinPropertyFindUsagesOptions; import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase; import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor; import org.jetbrains.kotlin.idea.test.PluginTestCaseBase; +import org.jetbrains.kotlin.idea.test.TestFixtureExtension; import org.jetbrains.kotlin.idea.util.ProjectRootsUtil; import org.jetbrains.kotlin.psi.*; import org.jetbrains.kotlin.test.InTextDirectivesUtils; @@ -293,6 +294,10 @@ public abstract class AbstractFindUsagesTest extends KotlinLightCodeInsightFixtu myFixture.setTestDataPath(PluginTestCaseBase.getTestDataPathBase() + "/findUsages"); } + protected void extraConfig(@SuppressWarnings("UnusedParameters") @NotNull String path) { + + } + protected void doTest(@NotNull String path) throws Exception { File mainFile = new File(path); final String mainFileName = mainFile.getName(); @@ -315,59 +320,73 @@ public abstract class AbstractFindUsagesTest extends KotlinLightCodeInsightFixtu : Property.class); } - OptionsParser parser = OptionsParser.getParserByPsiElementClass(caretElementClass); - - String rootPath = path.substring(0, path.lastIndexOf("/") + 1); - - File rootDir = new File(rootPath); - File[] extraFiles = rootDir.listFiles( - new FilenameFilter() { - @Override - public boolean accept(@NotNull File dir, @NotNull String name) { - if (!name.startsWith(prefix) || name.equals(mainFileName)) return false; - - String ext = FileUtilRt.getExtension(name); - return ext.equals("kt") - || ext.equals("java") - || ext.equals("xml") - || ext.equals("properties") - || (ext.equals("txt") && !name.endsWith(".results.txt")); - } - } - ); - - assert extraFiles != null; - for (File file : extraFiles) { - myFixture.configureByFile(rootPath + file.getName()); + List fixtureClasses = InTextDirectivesUtils.findListWithPrefixes(mainFileText, "// FIXTURE_CLASS: "); + for (String fixtureClass : fixtureClasses) { + TestFixtureExtension.Companion.loadFixture(fixtureClass, myFixture.getModule()); } - myFixture.configureByFile(path); - PsiElement caretElement = - InTextDirectivesUtils.isDirectiveDefined(mainFileText, "// FIND_BY_REF") - ? TargetElementUtilBase.findTargetElement(myFixture.getEditor(), - TargetElementUtilBase.REFERENCED_ELEMENT_ACCEPTED | - JavaTargetElementEvaluator.NEW_AS_CONSTRUCTOR) - : myFixture.getElementAtCaret(); - assertNotNull(caretElement); - assertInstanceOf(caretElement, caretElementClass); + try { + extraConfig(path); - PsiFile containingFile = caretElement.getContainingFile(); - boolean isLibraryElement = containingFile != null && ProjectRootsUtil.isLibraryFile(getProject(), containingFile.getVirtualFile()); + OptionsParser parser = OptionsParser.getParserByPsiElementClass(caretElementClass); - FindUsagesOptions options = parser != null ? parser.parse(mainFileText, getProject()) : null; + String rootPath = path.substring(0, path.lastIndexOf("/") + 1); - // Ensure that search by sources (if present) and decompiled declarations gives the same results - if (isLibraryElement) { - PsiElement originalElement = caretElement.getOriginalElement(); - findUsagesAndCheckResults(mainFileText, prefix, rootPath, originalElement, options); + File rootDir = new File(rootPath); + File[] extraFiles = rootDir.listFiles( + new FilenameFilter() { + @Override + public boolean accept(@NotNull File dir, @NotNull String name) { + if (!name.startsWith(prefix) || name.equals(mainFileName)) return false; - PsiElement navigationElement = caretElement.getNavigationElement(); - if (navigationElement != originalElement) { - findUsagesAndCheckResults(mainFileText, prefix, rootPath, navigationElement, options); + String ext = FileUtilRt.getExtension(name); + return ext.equals("kt") + || ext.equals("java") + || ext.equals("xml") + || ext.equals("properties") + || (ext.equals("txt") && !name.endsWith(".results.txt")); + } + } + ); + + assert extraFiles != null; + for (File file : extraFiles) { + myFixture.configureByFile(rootPath + file.getName()); + } + myFixture.configureByFile(path); + + PsiElement caretElement = + InTextDirectivesUtils.isDirectiveDefined(mainFileText, "// FIND_BY_REF") + ? TargetElementUtilBase.findTargetElement(myFixture.getEditor(), + TargetElementUtilBase.REFERENCED_ELEMENT_ACCEPTED | + JavaTargetElementEvaluator.NEW_AS_CONSTRUCTOR) + : myFixture.getElementAtCaret(); + assertNotNull(caretElement); + assertInstanceOf(caretElement, caretElementClass); + + PsiFile containingFile = caretElement.getContainingFile(); + boolean isLibraryElement = containingFile != null && ProjectRootsUtil.isLibraryFile(getProject(), containingFile.getVirtualFile()); + + FindUsagesOptions options = parser != null ? parser.parse(mainFileText, getProject()) : null; + + // Ensure that search by sources (if present) and decompiled declarations gives the same results + if (isLibraryElement) { + PsiElement originalElement = caretElement.getOriginalElement(); + findUsagesAndCheckResults(mainFileText, prefix, rootPath, originalElement, options); + + PsiElement navigationElement = caretElement.getNavigationElement(); + if (navigationElement != originalElement) { + findUsagesAndCheckResults(mainFileText, prefix, rootPath, navigationElement, options); + } + } + else { + findUsagesAndCheckResults(mainFileText, prefix, rootPath, caretElement, options); } } - else { - findUsagesAndCheckResults(mainFileText, prefix, rootPath, caretElement, options); + finally { + for (String fixtureClass : fixtureClasses) { + TestFixtureExtension.Companion.unloadFixture(fixtureClass); + } } } diff --git a/ultimate/testData/spring/core/findUsages/classXml-config.xml b/ultimate/testData/spring/core/findUsages/classXml-config.xml new file mode 100644 index 00000000000..a0358e22a83 --- /dev/null +++ b/ultimate/testData/spring/core/findUsages/classXml-config.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/findUsages/classXml.kt b/ultimate/testData/spring/core/findUsages/classXml.kt new file mode 100644 index 00000000000..996c488c7ca --- /dev/null +++ b/ultimate/testData/spring/core/findUsages/classXml.kt @@ -0,0 +1,6 @@ +// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension +// PSI_ELEMENT: org.jetbrains.kotlin.psi.KtClass +// OPTIONS: usages +package a + +class KotlinSpringBean \ No newline at end of file diff --git a/ultimate/testData/spring/core/findUsages/classXml.results.txt b/ultimate/testData/spring/core/findUsages/classXml.results.txt new file mode 100644 index 00000000000..30446677bb6 --- /dev/null +++ b/ultimate/testData/spring/core/findUsages/classXml.results.txt @@ -0,0 +1 @@ +Usage in XML descriptor 5 \ No newline at end of file diff --git a/ultimate/testData/spring/core/findUsages/primaryConstructorArgXml-config.xml b/ultimate/testData/spring/core/findUsages/primaryConstructorArgXml-config.xml new file mode 100644 index 00000000000..eaf33c31f00 --- /dev/null +++ b/ultimate/testData/spring/core/findUsages/primaryConstructorArgXml-config.xml @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/findUsages/primaryConstructorArgXml.kt b/ultimate/testData/spring/core/findUsages/primaryConstructorArgXml.kt new file mode 100644 index 00000000000..0258aa0f7c5 --- /dev/null +++ b/ultimate/testData/spring/core/findUsages/primaryConstructorArgXml.kt @@ -0,0 +1,6 @@ +// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension +// PSI_ELEMENT: org.jetbrains.kotlin.psi.KtParameter +// OPTIONS: usages +package a + +class KotlinSpringBean(var value: Int) \ No newline at end of file diff --git a/ultimate/testData/spring/core/findUsages/primaryConstructorArgXml.results.txt b/ultimate/testData/spring/core/findUsages/primaryConstructorArgXml.results.txt new file mode 100644 index 00000000000..7a3c68f2683 --- /dev/null +++ b/ultimate/testData/spring/core/findUsages/primaryConstructorArgXml.results.txt @@ -0,0 +1,2 @@ +Usage in XML descriptor 6 +Usage in XML descriptor 7 \ No newline at end of file diff --git a/ultimate/testData/spring/core/findUsages/propertyXml-config.xml b/ultimate/testData/spring/core/findUsages/propertyXml-config.xml new file mode 100644 index 00000000000..d52dc4ae40c --- /dev/null +++ b/ultimate/testData/spring/core/findUsages/propertyXml-config.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/findUsages/propertyXml.kt b/ultimate/testData/spring/core/findUsages/propertyXml.kt new file mode 100644 index 00000000000..5bf3e0e252a --- /dev/null +++ b/ultimate/testData/spring/core/findUsages/propertyXml.kt @@ -0,0 +1,8 @@ +// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension +// PSI_ELEMENT: org.jetbrains.kotlin.psi.KtProperty +// OPTIONS: usages +package a + +class KotlinSpringBean { + var foo: Int = 1 +} \ No newline at end of file diff --git a/ultimate/testData/spring/core/findUsages/propertyXml.results.txt b/ultimate/testData/spring/core/findUsages/propertyXml.results.txt new file mode 100644 index 00000000000..af8e1385418 --- /dev/null +++ b/ultimate/testData/spring/core/findUsages/propertyXml.results.txt @@ -0,0 +1 @@ +Usage in XML descriptor 6 \ No newline at end of file diff --git a/ultimate/testData/spring/core/findUsages/setterFunXml-config.xml b/ultimate/testData/spring/core/findUsages/setterFunXml-config.xml new file mode 100644 index 00000000000..5ca9c80d876 --- /dev/null +++ b/ultimate/testData/spring/core/findUsages/setterFunXml-config.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/findUsages/setterFunXml.kt b/ultimate/testData/spring/core/findUsages/setterFunXml.kt new file mode 100644 index 00000000000..2f4bc8cee34 --- /dev/null +++ b/ultimate/testData/spring/core/findUsages/setterFunXml.kt @@ -0,0 +1,10 @@ +// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension +// PSI_ELEMENT: org.jetbrains.kotlin.psi.KtNamedFunction +// OPTIONS: usages +package a + +class KotlinSpringBean { + fun setBar(value: Int) { + + } +} \ No newline at end of file diff --git a/ultimate/testData/spring/core/findUsages/setterFunXml.results.txt b/ultimate/testData/spring/core/findUsages/setterFunXml.results.txt new file mode 100644 index 00000000000..92fc23a904c --- /dev/null +++ b/ultimate/testData/spring/core/findUsages/setterFunXml.results.txt @@ -0,0 +1 @@ +Usage in XML descriptor 6 \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/classWithXmlRefs/after/spring-config.xml b/ultimate/testData/spring/core/rename/classWithXmlRefs/after/spring-config.xml new file mode 100644 index 00000000000..1e35b72204a --- /dev/null +++ b/ultimate/testData/spring/core/rename/classWithXmlRefs/after/spring-config.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/classWithXmlRefs/after/test.kt b/ultimate/testData/spring/core/rename/classWithXmlRefs/after/test.kt new file mode 100644 index 00000000000..0321ef20a49 --- /dev/null +++ b/ultimate/testData/spring/core/rename/classWithXmlRefs/after/test.kt @@ -0,0 +1,3 @@ +package a + +class KotlinSpringBean2 \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/classWithXmlRefs/before/spring-config.xml b/ultimate/testData/spring/core/rename/classWithXmlRefs/before/spring-config.xml new file mode 100644 index 00000000000..a0358e22a83 --- /dev/null +++ b/ultimate/testData/spring/core/rename/classWithXmlRefs/before/spring-config.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/classWithXmlRefs/before/test.kt b/ultimate/testData/spring/core/rename/classWithXmlRefs/before/test.kt new file mode 100644 index 00000000000..fceedad6a43 --- /dev/null +++ b/ultimate/testData/spring/core/rename/classWithXmlRefs/before/test.kt @@ -0,0 +1,3 @@ +package a + +class /*rename*/KotlinSpringBean \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/classWithXmlRefs/classWithXmlRef.test b/ultimate/testData/spring/core/rename/classWithXmlRefs/classWithXmlRef.test new file mode 100644 index 00000000000..d56390b1af1 --- /dev/null +++ b/ultimate/testData/spring/core/rename/classWithXmlRefs/classWithXmlRef.test @@ -0,0 +1,8 @@ +{ + "fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"], + "type": "MARKED_ELEMENT", + "mainFile": "test.kt", + "springFileSet": ["spring-config.xml"], + "newName": "KotlinSpringBean2", + "withRuntime": "true" +} \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/classWithXmlRefsByRef/after/spring-config.xml b/ultimate/testData/spring/core/rename/classWithXmlRefsByRef/after/spring-config.xml new file mode 100644 index 00000000000..1e35b72204a --- /dev/null +++ b/ultimate/testData/spring/core/rename/classWithXmlRefsByRef/after/spring-config.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/classWithXmlRefsByRef/after/test.kt b/ultimate/testData/spring/core/rename/classWithXmlRefsByRef/after/test.kt new file mode 100644 index 00000000000..0321ef20a49 --- /dev/null +++ b/ultimate/testData/spring/core/rename/classWithXmlRefsByRef/after/test.kt @@ -0,0 +1,3 @@ +package a + +class KotlinSpringBean2 \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/classWithXmlRefsByRef/before/spring-config.xml b/ultimate/testData/spring/core/rename/classWithXmlRefsByRef/before/spring-config.xml new file mode 100644 index 00000000000..aa2eed3a993 --- /dev/null +++ b/ultimate/testData/spring/core/rename/classWithXmlRefsByRef/before/spring-config.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/classWithXmlRefsByRef/before/test.kt b/ultimate/testData/spring/core/rename/classWithXmlRefsByRef/before/test.kt new file mode 100644 index 00000000000..67958d2e596 --- /dev/null +++ b/ultimate/testData/spring/core/rename/classWithXmlRefsByRef/before/test.kt @@ -0,0 +1,3 @@ +package a + +class KotlinSpringBean \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/classWithXmlRefsByRef/classWithXmlRefByRef.test b/ultimate/testData/spring/core/rename/classWithXmlRefsByRef/classWithXmlRefByRef.test new file mode 100644 index 00000000000..1e56c4e3499 --- /dev/null +++ b/ultimate/testData/spring/core/rename/classWithXmlRefsByRef/classWithXmlRefByRef.test @@ -0,0 +1,9 @@ +{ + "fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"], + "type": "MARKED_ELEMENT", + "mainFile": "spring-config.xml", + "springFileSet": ["spring-config.xml"], + "newName": "KotlinSpringBean2", + "byRef": "true", + "withRuntime": "true" +} \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefs/after/spring-config.xml b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefs/after/spring-config.xml new file mode 100644 index 00000000000..41a32b8f29a --- /dev/null +++ b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefs/after/spring-config.xml @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefs/after/test.kt b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefs/after/test.kt new file mode 100644 index 00000000000..bd4861b9084 --- /dev/null +++ b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefs/after/test.kt @@ -0,0 +1,3 @@ +package a + +class KotlinSpringBean(var value2: Int) \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefs/before/spring-config.xml b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefs/before/spring-config.xml new file mode 100644 index 00000000000..eaf33c31f00 --- /dev/null +++ b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefs/before/spring-config.xml @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefs/before/test.kt b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefs/before/test.kt new file mode 100644 index 00000000000..32f44021cb0 --- /dev/null +++ b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefs/before/test.kt @@ -0,0 +1,3 @@ +package a + +class KotlinSpringBean(var /*rename*/value: Int) \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefs/primaryConstructorArgWithXmlRef.test b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefs/primaryConstructorArgWithXmlRef.test new file mode 100644 index 00000000000..318eae5cc90 --- /dev/null +++ b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefs/primaryConstructorArgWithXmlRef.test @@ -0,0 +1,8 @@ +{ + "fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"], + "type": "MARKED_ELEMENT", + "mainFile": "test.kt", + "springFileSet": ["spring-config.xml"], + "newName": "value2", + "withRuntime": "true" +} \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef1/after/spring-config.xml b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef1/after/spring-config.xml new file mode 100644 index 00000000000..41a32b8f29a --- /dev/null +++ b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef1/after/spring-config.xml @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef1/after/test.kt b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef1/after/test.kt new file mode 100644 index 00000000000..bd4861b9084 --- /dev/null +++ b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef1/after/test.kt @@ -0,0 +1,3 @@ +package a + +class KotlinSpringBean(var value2: Int) \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef1/before/spring-config.xml b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef1/before/spring-config.xml new file mode 100644 index 00000000000..0847dc549af --- /dev/null +++ b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef1/before/spring-config.xml @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef1/before/test.kt b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef1/before/test.kt new file mode 100644 index 00000000000..5b0a3cb08ba --- /dev/null +++ b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef1/before/test.kt @@ -0,0 +1,3 @@ +package a + +class KotlinSpringBean(var value: Int) \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef1/primaryConstructorArgWithXmlRefByRef1.test b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef1/primaryConstructorArgWithXmlRefByRef1.test new file mode 100644 index 00000000000..067af5add1b --- /dev/null +++ b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef1/primaryConstructorArgWithXmlRefByRef1.test @@ -0,0 +1,9 @@ +{ + "fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"], + "type": "MARKED_ELEMENT", + "mainFile": "spring-config.xml", + "springFileSet": ["spring-config.xml"], + "newName": "value2", + "byRef": "true", + "withRuntime": "true" +} \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef2/after/spring-config.xml b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef2/after/spring-config.xml new file mode 100644 index 00000000000..41a32b8f29a --- /dev/null +++ b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef2/after/spring-config.xml @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef2/after/test.kt b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef2/after/test.kt new file mode 100644 index 00000000000..bd4861b9084 --- /dev/null +++ b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef2/after/test.kt @@ -0,0 +1,3 @@ +package a + +class KotlinSpringBean(var value2: Int) \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef2/before/spring-config.xml b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef2/before/spring-config.xml new file mode 100644 index 00000000000..b6d8997f9d1 --- /dev/null +++ b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef2/before/spring-config.xml @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef2/before/test.kt b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef2/before/test.kt new file mode 100644 index 00000000000..5b0a3cb08ba --- /dev/null +++ b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef2/before/test.kt @@ -0,0 +1,3 @@ +package a + +class KotlinSpringBean(var value: Int) \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef2/primaryConstructorArgWithXmlRefByRef2.test b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef2/primaryConstructorArgWithXmlRefByRef2.test new file mode 100644 index 00000000000..067af5add1b --- /dev/null +++ b/ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef2/primaryConstructorArgWithXmlRefByRef2.test @@ -0,0 +1,9 @@ +{ + "fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"], + "type": "MARKED_ELEMENT", + "mainFile": "spring-config.xml", + "springFileSet": ["spring-config.xml"], + "newName": "value2", + "byRef": "true", + "withRuntime": "true" +} \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/propertyWithXmlRefs/after/spring-config.xml b/ultimate/testData/spring/core/rename/propertyWithXmlRefs/after/spring-config.xml new file mode 100644 index 00000000000..e4c5d044d86 --- /dev/null +++ b/ultimate/testData/spring/core/rename/propertyWithXmlRefs/after/spring-config.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/propertyWithXmlRefs/after/test.kt b/ultimate/testData/spring/core/rename/propertyWithXmlRefs/after/test.kt new file mode 100644 index 00000000000..e6e7f7cda07 --- /dev/null +++ b/ultimate/testData/spring/core/rename/propertyWithXmlRefs/after/test.kt @@ -0,0 +1,5 @@ +package a + +class KotlinSpringBean { + var foo2: Int = 1 +} \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/propertyWithXmlRefs/before/spring-config.xml b/ultimate/testData/spring/core/rename/propertyWithXmlRefs/before/spring-config.xml new file mode 100644 index 00000000000..d52dc4ae40c --- /dev/null +++ b/ultimate/testData/spring/core/rename/propertyWithXmlRefs/before/spring-config.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/propertyWithXmlRefs/before/test.kt b/ultimate/testData/spring/core/rename/propertyWithXmlRefs/before/test.kt new file mode 100644 index 00000000000..12f4b079d8a --- /dev/null +++ b/ultimate/testData/spring/core/rename/propertyWithXmlRefs/before/test.kt @@ -0,0 +1,5 @@ +package a + +class KotlinSpringBean { + var /*rename*/foo: Int = 1 +} \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/propertyWithXmlRefs/propertyWithXmlRef.test b/ultimate/testData/spring/core/rename/propertyWithXmlRefs/propertyWithXmlRef.test new file mode 100644 index 00000000000..f43a4fd526f --- /dev/null +++ b/ultimate/testData/spring/core/rename/propertyWithXmlRefs/propertyWithXmlRef.test @@ -0,0 +1,8 @@ +{ + "fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"], + "type": "MARKED_ELEMENT", + "mainFile": "test.kt", + "springFileSet": ["spring-config.xml"], + "newName": "foo2", + "withRuntime": "true" +} \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/propertyWithXmlRefsByRef/after/spring-config.xml b/ultimate/testData/spring/core/rename/propertyWithXmlRefsByRef/after/spring-config.xml new file mode 100644 index 00000000000..e4c5d044d86 --- /dev/null +++ b/ultimate/testData/spring/core/rename/propertyWithXmlRefsByRef/after/spring-config.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/propertyWithXmlRefsByRef/after/test.kt b/ultimate/testData/spring/core/rename/propertyWithXmlRefsByRef/after/test.kt new file mode 100644 index 00000000000..e6e7f7cda07 --- /dev/null +++ b/ultimate/testData/spring/core/rename/propertyWithXmlRefsByRef/after/test.kt @@ -0,0 +1,5 @@ +package a + +class KotlinSpringBean { + var foo2: Int = 1 +} \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/propertyWithXmlRefsByRef/before/spring-config.xml b/ultimate/testData/spring/core/rename/propertyWithXmlRefsByRef/before/spring-config.xml new file mode 100644 index 00000000000..362c33f7870 --- /dev/null +++ b/ultimate/testData/spring/core/rename/propertyWithXmlRefsByRef/before/spring-config.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/propertyWithXmlRefsByRef/before/test.kt b/ultimate/testData/spring/core/rename/propertyWithXmlRefsByRef/before/test.kt new file mode 100644 index 00000000000..14f0d8b5d15 --- /dev/null +++ b/ultimate/testData/spring/core/rename/propertyWithXmlRefsByRef/before/test.kt @@ -0,0 +1,5 @@ +package a + +class KotlinSpringBean { + var foo: Int = 1 +} \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/propertyWithXmlRefsByRef/propertyWithXmlRefByRef.test b/ultimate/testData/spring/core/rename/propertyWithXmlRefsByRef/propertyWithXmlRefByRef.test new file mode 100644 index 00000000000..e3370430eb1 --- /dev/null +++ b/ultimate/testData/spring/core/rename/propertyWithXmlRefsByRef/propertyWithXmlRefByRef.test @@ -0,0 +1,9 @@ +{ + "fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"], + "type": "MARKED_ELEMENT", + "mainFile": "spring-config.xml", + "springFileSet": ["spring-config.xml"], + "newName": "foo2", + "byRef": "true", + "withRuntime": "true" +} \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/setterFunWithXmlRefs/after/spring-config.xml b/ultimate/testData/spring/core/rename/setterFunWithXmlRefs/after/spring-config.xml new file mode 100644 index 00000000000..b8f739d527d --- /dev/null +++ b/ultimate/testData/spring/core/rename/setterFunWithXmlRefs/after/spring-config.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/setterFunWithXmlRefs/after/test.kt b/ultimate/testData/spring/core/rename/setterFunWithXmlRefs/after/test.kt new file mode 100644 index 00000000000..c9ecfc422f7 --- /dev/null +++ b/ultimate/testData/spring/core/rename/setterFunWithXmlRefs/after/test.kt @@ -0,0 +1,7 @@ +package a + +class KotlinSpringBean { + fun setBar2(value: Int) { + + } +} \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/setterFunWithXmlRefs/before/spring-config.xml b/ultimate/testData/spring/core/rename/setterFunWithXmlRefs/before/spring-config.xml new file mode 100644 index 00000000000..5ca9c80d876 --- /dev/null +++ b/ultimate/testData/spring/core/rename/setterFunWithXmlRefs/before/spring-config.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/setterFunWithXmlRefs/before/test.kt b/ultimate/testData/spring/core/rename/setterFunWithXmlRefs/before/test.kt new file mode 100644 index 00000000000..b8ed4d08e7f --- /dev/null +++ b/ultimate/testData/spring/core/rename/setterFunWithXmlRefs/before/test.kt @@ -0,0 +1,7 @@ +package a + +class KotlinSpringBean { + fun /*rename*/setBar(value: Int) { + + } +} \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/setterFunWithXmlRefs/setterFunWithXmlRef.test b/ultimate/testData/spring/core/rename/setterFunWithXmlRefs/setterFunWithXmlRef.test new file mode 100644 index 00000000000..a5993ace12f --- /dev/null +++ b/ultimate/testData/spring/core/rename/setterFunWithXmlRefs/setterFunWithXmlRef.test @@ -0,0 +1,8 @@ +{ + "fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"], + "type": "MARKED_ELEMENT", + "mainFile": "test.kt", + "springFileSet": ["spring-config.xml"], + "newName": "setBar2", + "withRuntime": "true" +} \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/setterFunWithXmlRefsByRef/after/spring-config.xml b/ultimate/testData/spring/core/rename/setterFunWithXmlRefsByRef/after/spring-config.xml new file mode 100644 index 00000000000..b8f739d527d --- /dev/null +++ b/ultimate/testData/spring/core/rename/setterFunWithXmlRefsByRef/after/spring-config.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/setterFunWithXmlRefsByRef/after/test.kt b/ultimate/testData/spring/core/rename/setterFunWithXmlRefsByRef/after/test.kt new file mode 100644 index 00000000000..c9ecfc422f7 --- /dev/null +++ b/ultimate/testData/spring/core/rename/setterFunWithXmlRefsByRef/after/test.kt @@ -0,0 +1,7 @@ +package a + +class KotlinSpringBean { + fun setBar2(value: Int) { + + } +} \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/setterFunWithXmlRefsByRef/before/spring-config.xml b/ultimate/testData/spring/core/rename/setterFunWithXmlRefsByRef/before/spring-config.xml new file mode 100644 index 00000000000..de41b1caf92 --- /dev/null +++ b/ultimate/testData/spring/core/rename/setterFunWithXmlRefsByRef/before/spring-config.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/setterFunWithXmlRefsByRef/before/test.kt b/ultimate/testData/spring/core/rename/setterFunWithXmlRefsByRef/before/test.kt new file mode 100644 index 00000000000..8bdeb19a33c --- /dev/null +++ b/ultimate/testData/spring/core/rename/setterFunWithXmlRefsByRef/before/test.kt @@ -0,0 +1,7 @@ +package a + +class KotlinSpringBean { + fun setBar(value: Int) { + + } +} \ No newline at end of file diff --git a/ultimate/testData/spring/core/rename/setterFunWithXmlRefsByRef/setterFunWithXmlRefByRef.test b/ultimate/testData/spring/core/rename/setterFunWithXmlRefsByRef/setterFunWithXmlRefByRef.test new file mode 100644 index 00000000000..e446fdd8a88 --- /dev/null +++ b/ultimate/testData/spring/core/rename/setterFunWithXmlRefsByRef/setterFunWithXmlRefByRef.test @@ -0,0 +1,9 @@ +{ + "fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"], + "type": "MARKED_ELEMENT", + "mainFile": "spring-config.xml", + "springFileSet": ["spring-config.xml"], + "newName": "setBar2", + "byRef": "true", + "withRuntime": "true" +} \ No newline at end of file diff --git a/ultimate/tests/org/jetbrains/kotlin/idea/spring/tests/findUsages/AbstractSpringFindUsagesTest.kt b/ultimate/tests/org/jetbrains/kotlin/idea/spring/tests/findUsages/AbstractSpringFindUsagesTest.kt new file mode 100644 index 00000000000..8eea7cf6fc0 --- /dev/null +++ b/ultimate/tests/org/jetbrains/kotlin/idea/spring/tests/findUsages/AbstractSpringFindUsagesTest.kt @@ -0,0 +1,28 @@ +/* + * Copyright 2010-2016 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.idea.spring.tests.findUsages + +import org.jetbrains.kotlin.findUsages.AbstractFindUsagesTest +import org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension +import org.jetbrains.kotlin.idea.spring.tests.loadConfigByMainFilePath +import org.jetbrains.kotlin.idea.test.TestFixtureExtension + +abstract class AbstractSpringFindUsagesTest : AbstractFindUsagesTest() { + override fun extraConfig(path: String) { + TestFixtureExtension.getFixture()!!.loadConfigByMainFilePath(path, myFixture) + } +} diff --git a/ultimate/tests/org/jetbrains/kotlin/idea/spring/tests/findUsages/SpringFindUsagesTestGenerated.java b/ultimate/tests/org/jetbrains/kotlin/idea/spring/tests/findUsages/SpringFindUsagesTestGenerated.java new file mode 100644 index 00000000000..ffb91f08b75 --- /dev/null +++ b/ultimate/tests/org/jetbrains/kotlin/idea/spring/tests/findUsages/SpringFindUsagesTestGenerated.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010-2016 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.idea.spring.tests.findUsages; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.KotlinTestUtils; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("ultimate/testData/spring/core/findUsages") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class SpringFindUsagesTestGenerated extends AbstractSpringFindUsagesTest { + public void testAllFilesPresentInFindUsages() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("ultimate/testData/spring/core/findUsages"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("classXml.kt") + public void testClassXml() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/findUsages/classXml.kt"); + doTest(fileName); + } + + @TestMetadata("primaryConstructorArgXml.kt") + public void testPrimaryConstructorArgXml() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/findUsages/primaryConstructorArgXml.kt"); + doTest(fileName); + } + + @TestMetadata("propertyXml.kt") + public void testPropertyXml() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/findUsages/propertyXml.kt"); + doTest(fileName); + } + + @TestMetadata("setterFunXml.kt") + public void testSetterFunXml() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/findUsages/setterFunXml.kt"); + doTest(fileName); + } +} diff --git a/ultimate/tests/org/jetbrains/kotlin/idea/spring/tests/rename/SpringRenameTestGenerated.java b/ultimate/tests/org/jetbrains/kotlin/idea/spring/tests/rename/SpringRenameTestGenerated.java index fd06796cff2..3b5de54b109 100644 --- a/ultimate/tests/org/jetbrains/kotlin/idea/spring/tests/rename/SpringRenameTestGenerated.java +++ b/ultimate/tests/org/jetbrains/kotlin/idea/spring/tests/rename/SpringRenameTestGenerated.java @@ -35,6 +35,18 @@ public class SpringRenameTestGenerated extends AbstractSpringRenameTest { KotlinTestUtils.assertAllTestsPresentInSingleGeneratedClass(this.getClass(), new File("ultimate/testData/spring/core/rename"), Pattern.compile("^(.+)\\.test$")); } + @TestMetadata("classWithXmlRefs/classWithXmlRef.test") + public void testClassWithXmlRefs_ClassWithXmlRef() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/rename/classWithXmlRefs/classWithXmlRef.test"); + doTest(fileName); + } + + @TestMetadata("classWithXmlRefsByRef/classWithXmlRefByRef.test") + public void testClassWithXmlRefsByRef_ClassWithXmlRefByRef() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/rename/classWithXmlRefsByRef/classWithXmlRefByRef.test"); + doTest(fileName); + } + @TestMetadata("javaSpelRefToJava/javaSpelRefToJava.test") public void testJavaSpelRefToJava_JavaSpelRefToJava() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/rename/javaSpelRefToJava/javaSpelRefToJava.test"); @@ -82,4 +94,46 @@ public class SpringRenameTestGenerated extends AbstractSpringRenameTest { String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/rename/ktSpelRefToKtAnnotated/ktSpelRefToKtAnnotated.test"); doTest(fileName); } + + @TestMetadata("primaryConstructorArgWithXmlRefs/primaryConstructorArgWithXmlRef.test") + public void testPrimaryConstructorArgWithXmlRefs_PrimaryConstructorArgWithXmlRef() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefs/primaryConstructorArgWithXmlRef.test"); + doTest(fileName); + } + + @TestMetadata("primaryConstructorArgWithXmlRefsByRef1/primaryConstructorArgWithXmlRefByRef1.test") + public void testPrimaryConstructorArgWithXmlRefsByRef1_PrimaryConstructorArgWithXmlRefByRef1() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef1/primaryConstructorArgWithXmlRefByRef1.test"); + doTest(fileName); + } + + @TestMetadata("primaryConstructorArgWithXmlRefsByRef2/primaryConstructorArgWithXmlRefByRef2.test") + public void testPrimaryConstructorArgWithXmlRefsByRef2_PrimaryConstructorArgWithXmlRefByRef2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/rename/primaryConstructorArgWithXmlRefsByRef2/primaryConstructorArgWithXmlRefByRef2.test"); + doTest(fileName); + } + + @TestMetadata("propertyWithXmlRefs/propertyWithXmlRef.test") + public void testPropertyWithXmlRefs_PropertyWithXmlRef() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/rename/propertyWithXmlRefs/propertyWithXmlRef.test"); + doTest(fileName); + } + + @TestMetadata("propertyWithXmlRefsByRef/propertyWithXmlRefByRef.test") + public void testPropertyWithXmlRefsByRef_PropertyWithXmlRefByRef() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/rename/propertyWithXmlRefsByRef/propertyWithXmlRefByRef.test"); + doTest(fileName); + } + + @TestMetadata("setterFunWithXmlRefs/setterFunWithXmlRef.test") + public void testSetterFunWithXmlRefs_SetterFunWithXmlRef() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/rename/setterFunWithXmlRefs/setterFunWithXmlRef.test"); + doTest(fileName); + } + + @TestMetadata("setterFunWithXmlRefsByRef/setterFunWithXmlRefByRef.test") + public void testSetterFunWithXmlRefsByRef_SetterFunWithXmlRefByRef() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("ultimate/testData/spring/core/rename/setterFunWithXmlRefsByRef/setterFunWithXmlRefByRef.test"); + doTest(fileName); + } } diff --git a/ultimate/tests/org/jetbrains/kotlin/tests/GenerateTests.kt b/ultimate/tests/org/jetbrains/kotlin/tests/GenerateTests.kt index dc4c989937e..9c98b306e6a 100644 --- a/ultimate/tests/org/jetbrains/kotlin/tests/GenerateTests.kt +++ b/ultimate/tests/org/jetbrains/kotlin/tests/GenerateTests.kt @@ -19,6 +19,7 @@ package org.jetbrains.kotlin.tests import org.jetbrains.kotlin.generators.tests.testGroup import org.jetbrains.kotlin.idea.codeInsight.AbstractInspectionTest import org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixTest +import org.jetbrains.kotlin.idea.spring.tests.findUsages.AbstractSpringFindUsagesTest import org.jetbrains.kotlin.idea.spring.tests.generate.AbstractGenerateSpringDependencyActionTest import org.jetbrains.kotlin.idea.spring.tests.gutter.AbstractSpringClassAnnotatorTest import org.jetbrains.kotlin.idea.spring.tests.references.AbstractSpringReferenceCompletionHandlerTest @@ -61,5 +62,9 @@ fun main(args: Array) { testClass() { model("spring/core/rename", extension = "test", singleClass = true) } + + testClass() { + model("spring/core/findUsages", pattern = """^(.+)\.kt$""") + } } }