public class JUnitUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
JUnitUtil.NoJUnitException |
static class |
JUnitUtil.TestMethodFilter |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AFTER_ALL_ANNOTATION_NAME |
static java.lang.String |
AFTER_ANNOTATION_NAME |
static java.lang.String |
AFTER_CLASS_ANNOTATION_NAME |
static java.lang.String |
AFTER_EACH_ANNOTATION_NAME |
static java.lang.String |
BEFORE_ALL_ANNOTATION_NAME |
static java.lang.String |
BEFORE_ANNOTATION_NAME |
static java.lang.String |
BEFORE_CLASS_ANNOTATION_NAME |
static java.lang.String |
BEFORE_EACH_ANNOTATION_NAME |
static java.lang.String |
CUSTOM_TESTABLE_ANNOTATION |
static java.lang.String |
DATA_POINT |
static java.lang.String |
IGNORE_ANNOTATION |
static java.lang.String |
JUNIT5_NESTED |
static java.lang.String |
PARAMETERIZED_CLASS_NAME |
static java.lang.String |
PARAMETRIZED_PARAMETER_ANNOTATION_NAME |
static java.lang.String |
PARAMETRIZED_PARAMETERS_ANNOTATION_NAME |
static java.lang.String |
RULE_ANNOTATION |
static java.lang.String |
RUN_WITH |
static java.lang.String |
SUITE_CLASS_NAME |
static java.lang.String |
SUITE_METHOD_NAME |
static java.lang.String |
TEST_ANNOTATION |
static java.lang.String |
TEST_CASE_CLASS |
static java.lang.String |
TEST5_ANNOTATION |
static java.util.Collection<java.lang.String> |
TEST5_ANNOTATIONS |
static java.util.Collection<java.lang.String> |
TEST5_CONFIG_METHODS |
static java.lang.String |
TEST5_FACTORY_ANNOTATION |
static java.util.Collection<java.lang.String> |
TEST5_JUPITER_ANNOTATIONS |
static java.lang.String |
TEST5_PACKAGE_FQN |
static java.util.Collection<java.lang.String> |
TEST5_STATIC_CONFIG_METHODS |
Constructor and Description |
---|
JUnitUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
checkTestCase(SourceScope scope,
Project project) |
static PsiMethod |
findFirstTestMethod(PsiClass clazz) |
static PsiClass |
findPsiClass(java.lang.String qualifiedName,
Module module,
Project project) |
static PsiMethod |
findSuiteMethod(PsiClass clazz) |
static PsiPackage |
getContainingPackage(PsiClass psiClass) |
static PsiAnnotation |
getRunWithAnnotation(PsiClass aClass) |
static PsiClass |
getTestCaseClass(Module module) |
static PsiClass |
getTestCaseClass(SourceScope scope) |
static PsiClass |
getTestClass(Location<?> location) |
static PsiClass |
getTestClass(PsiElement element) |
static PsiMethod |
getTestMethod(PsiElement element) |
static PsiMethod |
getTestMethod(PsiElement element,
boolean checkAbstract) |
static PsiMethod |
getTestMethod(PsiElement element,
boolean checkAbstract,
boolean checkRunWith) |
static boolean |
isInheritorOrSelfRunner(PsiAnnotation annotation,
java.lang.String... runners) |
static boolean |
isJUnit3TestClass(PsiClass clazz) |
static boolean |
isJUnit4TestAnnotated(PsiMethod method) |
static boolean |
isJUnit4TestClass(PsiClass psiClass) |
static boolean |
isJUnit4TestClass(PsiClass psiClass,
boolean checkAbstract) |
static boolean |
isJUnit5(GlobalSearchScope scope,
Project project) |
static boolean |
isJUnit5(PsiElement element) |
static boolean |
isJUnit5TestClass(PsiClass psiClass,
boolean checkAbstract) |
static boolean |
isOneOf(PsiAnnotation annotation,
java.lang.String... runners) |
static boolean |
isParameterized(PsiAnnotation annotation) |
static boolean |
isSuiteMethod(PsiMethod psiMethod) |
static boolean |
isTestAnnotated(PsiMethod method) |
static boolean |
isTestAnnotated(PsiMethod method,
boolean includeCustom) |
static boolean |
isTestCaseInheritor(PsiClass aClass) |
static boolean |
isTestClass(PsiClass psiClass) |
static boolean |
isTestClass(PsiClass psiClass,
boolean checkAbstract,
boolean checkForTestCaseInheritance) |
static boolean |
isTestMethod(Location<? extends PsiMethod> location) |
static boolean |
isTestMethod(Location<? extends PsiMethod> location,
boolean checkAbstract) |
static boolean |
isTestMethod(Location<? extends PsiMethod> location,
boolean checkAbstract,
boolean checkRunWith) |
static boolean |
isTestMethod(Location<? extends PsiMethod> location,
boolean checkAbstract,
boolean checkRunWith,
boolean checkClass) |
static boolean |
isTestMethodOrConfig(PsiMethod psiMethod) |
public static final java.lang.String TEST_CASE_CLASS
public static final java.lang.String TEST_ANNOTATION
public static final java.lang.String RULE_ANNOTATION
public static final java.lang.String TEST5_PACKAGE_FQN
public static final java.lang.String TEST5_ANNOTATION
public static final java.lang.String CUSTOM_TESTABLE_ANNOTATION
public static final java.lang.String TEST5_FACTORY_ANNOTATION
public static final java.lang.String IGNORE_ANNOTATION
public static final java.lang.String RUN_WITH
public static final java.lang.String DATA_POINT
public static final java.lang.String SUITE_METHOD_NAME
public static final java.lang.String BEFORE_ANNOTATION_NAME
public static final java.lang.String AFTER_ANNOTATION_NAME
public static final java.lang.String BEFORE_EACH_ANNOTATION_NAME
public static final java.lang.String AFTER_EACH_ANNOTATION_NAME
public static final java.lang.String PARAMETRIZED_PARAMETERS_ANNOTATION_NAME
public static final java.lang.String PARAMETRIZED_PARAMETER_ANNOTATION_NAME
public static final java.lang.String AFTER_CLASS_ANNOTATION_NAME
public static final java.lang.String BEFORE_CLASS_ANNOTATION_NAME
public static final java.util.Collection<java.lang.String> TEST5_CONFIG_METHODS
public static final java.lang.String BEFORE_ALL_ANNOTATION_NAME
public static final java.lang.String AFTER_ALL_ANNOTATION_NAME
public static final java.util.Collection<java.lang.String> TEST5_STATIC_CONFIG_METHODS
public static final java.util.Collection<java.lang.String> TEST5_ANNOTATIONS
public static final java.util.Collection<java.lang.String> TEST5_JUPITER_ANNOTATIONS
public static final java.lang.String PARAMETERIZED_CLASS_NAME
public static final java.lang.String SUITE_CLASS_NAME
public static final java.lang.String JUNIT5_NESTED
public static boolean isSuiteMethod(PsiMethod psiMethod)
public static boolean isTestMethod(Location<? extends PsiMethod> location, boolean checkAbstract)
public static boolean isTestMethod(Location<? extends PsiMethod> location, boolean checkAbstract, boolean checkRunWith)
public static boolean isTestMethod(Location<? extends PsiMethod> location, boolean checkAbstract, boolean checkRunWith, boolean checkClass)
public static boolean isTestCaseInheritor(PsiClass aClass)
public static boolean isTestClass(PsiClass psiClass)
public static boolean isTestClass(PsiClass psiClass, boolean checkAbstract, boolean checkForTestCaseInheritance)
public static boolean isJUnit3TestClass(PsiClass clazz)
public static boolean isJUnit4TestClass(PsiClass psiClass)
public static boolean isJUnit4TestClass(PsiClass psiClass, boolean checkAbstract)
public static boolean isJUnit5TestClass(PsiClass psiClass, boolean checkAbstract)
public static boolean isJUnit5(PsiElement element)
public static boolean isJUnit5(GlobalSearchScope scope, Project project)
public static boolean isTestAnnotated(PsiMethod method)
public static boolean isTestAnnotated(PsiMethod method, boolean includeCustom)
public static boolean isJUnit4TestAnnotated(PsiMethod method)
public static PsiClass getTestCaseClass(Module module) throws JUnitUtil.NoJUnitException
JUnitUtil.NoJUnitException
public static PsiClass getTestCaseClass(SourceScope scope) throws JUnitUtil.NoJUnitException
JUnitUtil.NoJUnitException
public static void checkTestCase(SourceScope scope, Project project) throws JUnitUtil.NoJUnitException
JUnitUtil.NoJUnitException
public static boolean isTestMethodOrConfig(PsiMethod psiMethod)
public static PsiAnnotation getRunWithAnnotation(PsiClass aClass)
public static boolean isParameterized(PsiAnnotation annotation)
public static boolean isInheritorOrSelfRunner(PsiAnnotation annotation, java.lang.String... runners)
public static boolean isOneOf(PsiAnnotation annotation, java.lang.String... runners)
public static PsiClass findPsiClass(java.lang.String qualifiedName, Module module, Project project)
public static PsiPackage getContainingPackage(PsiClass psiClass)
public static PsiClass getTestClass(PsiElement element)
public static PsiMethod getTestMethod(PsiElement element)
public static PsiMethod getTestMethod(PsiElement element, boolean checkAbstract)
public static PsiMethod getTestMethod(PsiElement element, boolean checkAbstract, boolean checkRunWith)