use of com.intellij.codeInspection.inheritance.ChangeSuperClassFix in project intellij-community by JetBrains.
the class SuperClassHasFrequentlyUsedInheritorsInspectionTest method doTest.
private void doTest(final int expectedSize) {
myFixture.configureByFile(getTestName(false) + ".java");
myFixture.enableInspections(SuperClassHasFrequentlyUsedInheritorsInspection.class);
final Set<Pair<String, Integer>> actualSet = new HashSet<Pair<String, Integer>>();
for (IntentionAction intentionAction : myFixture.getAvailableIntentions()) {
if (intentionAction instanceof QuickFixWrapper) {
ChangeSuperClassFix changeSuperClassFix = getQuickFixFromWrapper((QuickFixWrapper) intentionAction);
if (changeSuperClassFix != null) {
actualSet.add(Pair.create(changeSuperClassFix.getNewSuperClass().getQualifiedName(), changeSuperClassFix.getPercent()));
}
}
}
assertSize(expectedSize, actualSet);
}
use of com.intellij.codeInspection.inheritance.ChangeSuperClassFix in project intellij-community by JetBrains.
the class SuperClassHasFrequentlyUsedInheritorsInspectionTest method doTest.
private void doTest(final Pair<String, Integer>... expectedResults) {
myFixture.configureByFile(getTestName(false) + ".java");
myFixture.enableInspections(SuperClassHasFrequentlyUsedInheritorsInspection.class);
final Set<Pair<String, Integer>> actualSet = new HashSet<Pair<String, Integer>>();
for (IntentionAction intentionAction : myFixture.getAvailableIntentions()) {
if (intentionAction instanceof QuickFixWrapper) {
ChangeSuperClassFix changeSuperClassFix = getQuickFixFromWrapper((QuickFixWrapper) intentionAction);
if (changeSuperClassFix != null) {
actualSet.add(Pair.create(changeSuperClassFix.getNewSuperClass().getQualifiedName(), changeSuperClassFix.getPercent()));
}
}
}
final Set<Pair<String, Integer>> expectedSet = ContainerUtil.newHashSet(expectedResults);
assertEquals(actualSet, expectedSet);
}
Aggregations