mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
findPackage() added to Java code insight text fixture
This commit is contained in:
+4
@@ -17,6 +17,7 @@ package com.intellij.testFramework.fixtures;
|
||||
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiPackage;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -32,4 +33,7 @@ public interface JavaCodeInsightTestFixture extends CodeInsightTestFixture {
|
||||
|
||||
@NotNull
|
||||
PsiClass findClass(@NotNull @NonNls String name);
|
||||
|
||||
@NotNull
|
||||
PsiPackage findPackage(@NotNull @NonNls String name);
|
||||
}
|
||||
|
||||
+7
@@ -62,4 +62,11 @@ public class JavaCodeInsightTestFixtureImpl extends CodeInsightTestFixtureImpl i
|
||||
assertNotNull("Class " + name + " not found", aClass);
|
||||
return aClass;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PsiPackage findPackage(@NotNull @NonNls final String name) {
|
||||
final PsiPackage aPackage = getJavaFacade().findPackage(name);
|
||||
assertNotNull("Package " + name + " not found", aPackage);
|
||||
return aPackage;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user