Package com.ibm.wala.util.scope
Class JUnitEntryPoints
- java.lang.Object
-
- com.ibm.wala.util.scope.JUnitEntryPoints
-
public class JUnitEntryPoints extends Object
This class represents entry points (Entrypoint
)s of JUnit test methods. JUnit test methods are those invoked by the JUnit framework reflectively The entry points can be used to specify entry points of a call graph. This implementation only handles JUnit 3.
-
-
Constructor Summary
Constructors Constructor Description JUnitEntryPoints()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Set<IMethod>
getSetUpTearDownMethods(IClass testClass)
Get the "setUp" and "tearDown" methods in the given classstatic boolean
isJUnitMethod(IMethod m)
Check if the given method is a JUnit test method, assuming that it is declared in a JUnit test class.static boolean
isJUnitTestCase(IClass klass)
Check if the given class is a JUnit test class.static Iterable<Entrypoint>
make(IClassHierarchy cha)
Construct JUnit entrypoints for all the JUnit test methods in the given scope.static Iterable<Entrypoint>
makeOne(IClassHierarchy cha, String targetPackageName, String targetSimpleClassName, String targetMethodName)
Construct JUnit entrypoints for the specified test method in a scope.
-
-
-
Method Detail
-
make
public static Iterable<Entrypoint> make(IClassHierarchy cha)
Construct JUnit entrypoints for all the JUnit test methods in the given scope.- Throws:
IllegalArgumentException
- if cha is null
-
makeOne
public static Iterable<Entrypoint> makeOne(IClassHierarchy cha, String targetPackageName, String targetSimpleClassName, String targetMethodName)
Construct JUnit entrypoints for the specified test method in a scope.- Throws:
IllegalArgumentException
- if cha is null
-
isJUnitTestCase
public static boolean isJUnitTestCase(IClass klass)
Check if the given class is a JUnit test class. A JUnit test class is a subclass of junit.framework.TestCase or junit.framework.TestSuite.- Throws:
IllegalArgumentException
- if klass is null
-
isJUnitMethod
public static boolean isJUnitMethod(IMethod m)
Check if the given method is a JUnit test method, assuming that it is declared in a JUnit test class. A method is a JUnit test method if the name has the prefix "test", or its name is "setUp" or "tearDown".- Throws:
IllegalArgumentException
- if m is null
-
getSetUpTearDownMethods
public static Set<IMethod> getSetUpTearDownMethods(IClass testClass) throws ClassHierarchyException
Get the "setUp" and "tearDown" methods in the given class- Throws:
ClassHierarchyException
-
-