Package org.processmining.contexts.test
Class AllInclassMethodTests
java.lang.Object
org.processmining.contexts.test.AllInclassMethodTests
Utility class to collect all methods annotated with
@TestMethod
from a given location of compiled Java classes.- Author:
- dfahland
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
collectAllTestMethods
(String lookUpDir) Find all methods with annotation@TestMethod
in the given loop up directory.static String
static String
static String
static String
static String
static boolean
testExpectedFromFile
(Method method) static boolean
static boolean
testResultFromSystemOut
(Method method)
-
Constructor Details
-
AllInclassMethodTests
public AllInclassMethodTests()
-
-
Method Details
-
getAllTestMethods
- Returns:
- all found methods
-
collectAllTestMethods
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
- 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
- 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
- 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
-
test_basicOutputTest
-
test_basicFileTest
-
test_dualTest
-
test_basicFileTest_OutputStream
-