Class JUnitEntryPoints

java.lang.Object
com.ibm.wala.core.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.
  • Constructor Details

    • JUnitEntryPoints

      public JUnitEntryPoints()
  • Method Details

    • 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
      API Note:
      Only handles JUnit3.
    • 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
      API Note:
      Applicable only to JUnit3.
    • 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
      API Note:
      Only handles JUnit3.
    • getSetUpTearDownMethods

      public static Set<IMethod> getSetUpTearDownMethods(IClass testClass)
      Get the "setUp" and "tearDown" methods in the given class
      API Note:
      Only handles JUnit3.