use of com.intellij.refactoring.util.MoveRenameUsageInfo in project intellij-community by JetBrains.
the class RenameCollisionsTest method testAllUsagesInCode.
public void testAllUsagesInCode() throws Exception {
configureByFile(BASE_PATH + getTestName(false) + ".java");
PsiElement element = TargetElementUtil.findTargetElement(myEditor, TargetElementUtil.ELEMENT_NAME_ACCEPTED | TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED);
assertNotNull(element);
final UsageInfo[] usageInfos = RenameUtil.findUsages(element, "newName", true, true, new HashMap<>());
assertSize(1, usageInfos);
for (UsageInfo usageInfo : usageInfos) {
assertTrue(usageInfo instanceof MoveRenameUsageInfo);
assertFalse(usageInfo.isNonCodeUsage);
}
}
Aggregations