Class AllInclassMethodTests

java.lang.Object
org.processmining.contexts.test.AllInclassMethodTests

public class AllInclassMethodTests extends Object
Utility class to collect all methods annotated with @TestMethod from a given location of compiled Java classes.
Author:
dfahland
  • Constructor Details

    • AllInclassMethodTests

      public AllInclassMethodTests()
  • Method Details

    • getAllTestMethods

      public List<Method> getAllTestMethods()
      Returns:
      all found methods
    • collectAllTestMethods

      public void collectAllTestMethods(String lookUpDir)
      Find all methods with annotation @TestMethod in the given loop up directory. The classes can be stored inside a JAR file. The list of found methods can be retrieved with getAllTestMethods(). This method can be run several times to scan classes from different directories.
      Parameters:
      lookUpDir -
    • testExpectedFromFile

      public static boolean testExpectedFromFile(Method method)
      Parameters:
      method -
      Returns:
      true iff the method is annotated with TestMethod.filename(). Then the result of the test will be compared to the contents of a file.
    • testExpectedFromOutputAnnotation

      public static boolean testExpectedFromOutputAnnotation(Method method)
      Parameters:
      method -
      Returns:
      true iff the method is annotated with TestMethod.output(). Then the result of the test will be compared to the specified string.
    • testResultFromSystemOut

      public static boolean testResultFromSystemOut(Method method)
      Parameters:
      method -
      Returns:
      true iff the method is annotated with TestMethod.returnSystemOut() == true. Then the return result of the method will be everything the method wrote to System.out.
    • getTestName

      public static String getTestName(Method m)
    • test_basicOutputTest

      public static String test_basicOutputTest()
    • test_basicFileTest

      public static String test_basicFileTest()
    • test_dualTest

      public static String test_dualTest()
    • test_basicFileTest_OutputStream

      public static String test_basicFileTest_OutputStream()