本文整理汇总了Java中com.intellij.execution.junit.JUnitUtil.isTestMethodOrConfig方法的典型用法代码示例。如果您正苦于以下问题:Java JUnitUtil.isTestMethodOrConfig方法的具体用法?Java JUnitUtil.isTestMethodOrConfig怎么用?Java JUnitUtil.isTestMethodOrConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.junit.JUnitUtil
的用法示例。
在下文中一共展示了JUnitUtil.isTestMethodOrConfig方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isEntryPoint
import com.intellij.execution.junit.JUnitUtil; //导入方法依赖的package包/类
@Override
public boolean isEntryPoint(@NotNull PsiElement psiElement) {
if (ADD_JUNIT_TO_ENTRIES) {
if (psiElement instanceof PsiClass) {
final PsiClass aClass = (PsiClass)psiElement;
if (JUnitUtil.isTestClass(aClass, false, true)) {
if (!PsiClassUtil.isRunnableClass(aClass, true, true)) {
final PsiClass topLevelClass = PsiTreeUtil.getTopmostParentOfType(aClass, PsiClass.class);
if (topLevelClass != null && PsiClassUtil.isRunnableClass(topLevelClass, true, true)) {
return true;
}
final CommonProcessors.FindProcessor<PsiClass> findProcessor = new CommonProcessors.FindProcessor<PsiClass>() {
@Override
protected boolean accept(PsiClass psiClass) {
return !psiClass.hasModifierProperty(PsiModifier.ABSTRACT);
}
};
return !ClassInheritorsSearch.search(aClass).forEach(findProcessor) && findProcessor.isFound();
}
return true;
}
}
else if (psiElement instanceof PsiMethod) {
final PsiMethod method = (PsiMethod)psiElement;
if (method.isConstructor() && method.getParameterList().getParametersCount() == 0) {
return JUnitUtil.isTestClass(method.getContainingClass());
}
if (JUnitUtil.isTestMethodOrConfig(method)) return true;
}
}
return false;
}
示例2: value
import com.intellij.execution.junit.JUnitUtil; //导入方法依赖的package包/类
public boolean value(PsiElement member) {
if (member instanceof PsiMethod) {
PsiMethod method = (PsiMethod)member;
if (JUnitUtil.isTestMethodOrConfig(method)){
return true;
}
}
return false;
}
示例3: isEntryPoint
import com.intellij.execution.junit.JUnitUtil; //导入方法依赖的package包/类
@Override
public boolean isEntryPoint(PsiElement psiElement) {
if (ADD_JUNIT_TO_ENTRIES) {
if (psiElement instanceof PsiClass) {
final PsiClass aClass = (PsiClass)psiElement;
if (JUnitUtil.isTestClass(aClass, false, true)) {
if (!PsiClassUtil.isRunnableClass(aClass, true, true)) {
final CommonProcessors.FindProcessor<PsiClass> findProcessor = new CommonProcessors.FindProcessor<PsiClass>() {
@Override
protected boolean accept(PsiClass psiClass) {
return !psiClass.hasModifierProperty(PsiModifier.ABSTRACT);
}
};
return !ClassInheritorsSearch.search(aClass).forEach(findProcessor) && findProcessor.isFound();
}
return true;
}
}
else if (psiElement instanceof PsiMethod) {
final PsiMethod method = (PsiMethod)psiElement;
if (method.isConstructor() && method.getParameterList().getParametersCount() == 0) {
return JUnitUtil.isTestClass(method.getContainingClass());
}
if (JUnitUtil.isTestMethodOrConfig(method)) return true;
}
}
return false;
}