extend test framework: isTestMethodOrConfig

This commit is contained in:
anna
2010-01-27 21:56:51 +03:00
parent 89dd1d6b85
commit 4f5a5bc370
3 changed files with 10 additions and 0 deletions
@@ -27,4 +27,6 @@ import com.intellij.util.IncorrectOperationException;
public interface TestFramework {
boolean isTestKlass(PsiClass psiClass);
PsiMethod findSetUpMethod(PsiClass psiClass) throws IncorrectOperationException;
boolean isTestMethodOrConfig(PsiMethod psiMethod);
}
@@ -66,4 +66,8 @@ public class JUnitTestFramework implements TestFramework {
}
return inClass;
}
public boolean isTestMethodOrConfig(PsiMethod psiMethod) {
return JUnitUtil.isTestMethodOrConfig(psiMethod);
}
}
@@ -477,6 +477,10 @@ public class TestNGUtil implements TestFramework
return inClass;
}
public boolean isTestMethodOrConfig(PsiMethod psiMethod) {
return hasTest(psiMethod) || hasConfig(psiMethod);
}
public static boolean checkTestNGInClasspath(PsiElement psiElement) {
final Project project = psiElement.getProject();
final PsiManager manager = PsiManager.getInstance(project);