use of com.intellij.psi.PsiCall in project intellij-community by JetBrains.
the class InlineToAnonymousClassTest method performAction.
private void performAction(final boolean inlineThisOnly, final boolean searchInNonJavaFiles) {
PsiElement element = TargetElementUtil.findTargetElement(myEditor, TargetElementUtil.ELEMENT_NAME_ACCEPTED | TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED);
PsiCall callToInline = InlineToAnonymousClassHandler.findCallToInline(myEditor);
PsiClass classToInline = (PsiClass) element;
assertEquals(null, InlineToAnonymousClassHandler.getCannotInlineMessage(classToInline));
final InlineToAnonymousClassProcessor processor = new InlineToAnonymousClassProcessor(getProject(), classToInline, callToInline, inlineThisOnly, false, searchInNonJavaFiles);
UsageInfo[] usages = processor.findUsages();
MultiMap<PsiElement, String> conflicts = processor.getConflicts(usages);
assertEquals(0, conflicts.size());
processor.run();
}
use of com.intellij.psi.PsiCall in project intellij-community by JetBrains.
the class InlineToAnonymousClassTest method doTestCanBeInvokedOnReference.
private void doTestCanBeInvokedOnReference(boolean canBeInvokedOnReference) throws Exception {
configureByFile("/refactoring/inlineToAnonymousClass/" + getTestName(false) + ".java");
PsiElement element = TargetElementUtil.findTargetElement(myEditor, TargetElementUtil.ELEMENT_NAME_ACCEPTED | TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED);
PsiCall callToInline = InlineToAnonymousClassHandler.findCallToInline(myEditor);
PsiClass classToInline = (PsiClass) element;
assertEquals(null, InlineToAnonymousClassHandler.getCannotInlineMessage(classToInline));
final PsiClassType superType = InlineToAnonymousClassProcessor.getSuperType(classToInline);
assertTrue(superType != null);
assertEquals(canBeInvokedOnReference, InlineToAnonymousClassHandler.canBeInvokedOnReference(callToInline, superType));
}
Aggregations