Package org.processmining.contexts.test
Class AllInclassMethodTests
- java.lang.Object
-
- org.processmining.contexts.test.AllInclassMethodTests
-
public class AllInclassMethodTests extends java.lang.ObjectUtility class to collect all methods annotated with@TestMethodfrom 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 voidcollectAllTestMethods(java.lang.String lookUpDir)Find all methods with annotation@TestMethodin the given loop up directory.java.util.List<java.lang.reflect.Method>getAllTestMethods()static java.lang.StringgetTestName(java.lang.reflect.Method m)static java.lang.Stringtest_basicFileTest()static java.lang.Stringtest_basicFileTest_OutputStream()static java.lang.Stringtest_basicOutputTest()static java.lang.Stringtest_dualTest()static booleantestExpectedFromFile(java.lang.reflect.Method method)static booleantestExpectedFromOutputAnnotation(java.lang.reflect.Method method)static booleantestResultFromSystemOut(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@TestMethodin 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:
trueiff 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:
trueiff 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:
trueiff 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()
-
-