public class AllInclassMethodTests
extends java.lang.Object
@TestMethod
from a given location of compiled Java classes.Constructor and Description |
---|
AllInclassMethodTests() |
Modifier and Type | Method and 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_OutputStream() |
static java.lang.String |
test_basicFileTest() |
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) |
public java.util.List<java.lang.reflect.Method> getAllTestMethods()
public void collectAllTestMethods(java.lang.String lookUpDir)
@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.lookUpDir
- public static boolean testExpectedFromFile(java.lang.reflect.Method method)
method
- true
iff the method is annotated with
TestMethod.filename()
. Then the result of the test will
be compared to the contents of a file.public static boolean testExpectedFromOutputAnnotation(java.lang.reflect.Method method)
method
- true
iff the method is annotated with
TestMethod.output()
. Then the result of the test will
be compared to the specified string.public static boolean testResultFromSystemOut(java.lang.reflect.Method method)
method
- 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
.public static java.lang.String getTestName(java.lang.reflect.Method m)
public static java.lang.String test_basicOutputTest()
public static java.lang.String test_basicFileTest()
public static java.lang.String test_dualTest()
public static java.lang.String test_basicFileTest_OutputStream()