Package org.processmining.contexts.test
Class AllInclassMethodTests
- java.lang.Object
-
- org.processmining.contexts.test.AllInclassMethodTests
-
public class AllInclassMethodTests extends java.lang.Object
Utility class to collect all methods annotated with@TestMethod
from a given location of compiled Java classes.- Author:
- dfahland
-
-
Constructor Summary
Constructors Constructor Description AllInclassMethodTests()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
collectAllTestMethods(java.lang.String lookUpDir)
Find all methods with annotation@TestMethod
in the given loop up directory.java.util.List<java.lang.reflect.Method>
getAllTestMethods()
static java.lang.String
getTestName(java.lang.reflect.Method m)
static java.lang.String
test_basicFileTest()
static java.lang.String
test_basicFileTest_OutputStream()
static java.lang.String
test_basicOutputTest()
static java.lang.String
test_dualTest()
static boolean
testExpectedFromFile(java.lang.reflect.Method method)
static boolean
testExpectedFromOutputAnnotation(java.lang.reflect.Method method)
static boolean
testResultFromSystemOut(java.lang.reflect.Method method)
-
-
-
Method Detail
-
getAllTestMethods
public java.util.List<java.lang.reflect.Method> getAllTestMethods()
- Returns:
- all found methods
-
collectAllTestMethods
public void collectAllTestMethods(java.lang.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 withgetAllTestMethods()
. This method can be run several times to scan classes from different directories.- Parameters:
lookUpDir
-
-
testExpectedFromFile
public static boolean testExpectedFromFile(java.lang.reflect.Method method)
- Parameters:
method
-- Returns:
true
iff the method is annotated withTestMethod.filename()
. Then the result of the test will be compared to the contents of a file.
-
testExpectedFromOutputAnnotation
public static boolean testExpectedFromOutputAnnotation(java.lang.reflect.Method method)
- Parameters:
method
-- Returns:
true
iff the method is annotated withTestMethod.output()
. Then the result of the test will be compared to the specified string.
-
testResultFromSystemOut
public static boolean testResultFromSystemOut(java.lang.reflect.Method method)
- Parameters:
method
-- Returns:
true
iff the method is annotated with
. Then the return result of the method will be everything the method wrote toTestMethod.returnSystemOut()
== trueSystem.out
.
-
getTestName
public static java.lang.String getTestName(java.lang.reflect.Method m)
-
test_basicOutputTest
public static java.lang.String test_basicOutputTest()
-
test_basicFileTest
public static java.lang.String test_basicFileTest()
-
test_dualTest
public static java.lang.String test_dualTest()
-
test_basicFileTest_OutputStream
public static java.lang.String test_basicFileTest_OutputStream()
-
-