JUnit4: test function annotated with 'test' annotation

#KT-3178 Fixed
This commit is contained in:
Natalia.Ukhorskaya
2012-12-27 15:43:57 +04:00
parent e9d1171d6d
commit 00ef0fc0a6
3 changed files with 35 additions and 2 deletions
@@ -101,7 +101,15 @@ public class KotlinAnnotatedElementsSearcher extends AnnotatedElementsSearcher {
@Override
public Collection<? extends PsiElement> compute() {
if (useScope instanceof GlobalSearchScope) {
return JetAnnotationsIndex.getInstance().get(annClass.getName(), annClass.getProject(), (GlobalSearchScope)useScope);
Collection<JetAnnotationEntry> annotationEntries =
JetAnnotationsIndex.getInstance().get(annClass.getName(), annClass.getProject(), (GlobalSearchScope) useScope);
// Add annotations 'test' as often used alias when we search Test annotation
if (annClass.getName().equals("Test")) {
annotationEntries.addAll(JetAnnotationsIndex.getInstance().get(annClass.getName().toLowerCase(), annClass.getProject(), (GlobalSearchScope) useScope));
}
return annotationEntries;
}
/*
TODO getJetAnnotationCandidates works only with global search scope