|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.groboutils.junit.v1.parser.TestClassParser
Parses Test classes to discover the usable test methods.
Ripped the test method discovery code out of junit.framework.TestSuite to allow it to have usable logic.
This is not covered under the GroboUtils license, but rather under the JUnit license (IBM Public License). This heading may not be totally in line with the license, so I'll change it when I find out what needs to be changed.
Constructor Summary | |
TestClassParser(java.lang.Class theClass)
The primary constructor, which will cause this instance to know how to parse only the passed-in class. |
Method Summary | |
protected void |
addTestMethod(java.lang.reflect.Method m,
java.util.Vector names)
Adds the method m to the inner list of known test methods, but only if it is a public test method. |
void |
clearWarnings()
Remove all current warnings. |
protected void |
discoverTestMethods(java.lang.Class theClass)
Discover and record the test methods of the public test class theClass. |
java.lang.String |
getName()
Get the name of the test suite. |
java.lang.Class |
getTestClass()
Get the class under test. |
java.lang.reflect.Method[] |
getTestMethods()
Retrieve all public test methods discovered through inspection. |
java.lang.String[] |
getWarnings()
Retrieve all warnings generated during the introspection of the class, or test creation. |
protected boolean |
isPublicTestMethod(java.lang.reflect.Method m)
Asserts that the method is public, and that it is also a test method. |
protected boolean |
isTestMethod(java.lang.reflect.Method m)
Test if method m is a test method, which means it accepts no parameters, returns void, and the name of the method begins with test. |
protected boolean |
testClass(java.lang.Class theClass)
Discover if the given class is a valid testing class. |
protected void |
warning(java.lang.String message)
Adds a warning message to the inner list of warnings. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TestClassParser(java.lang.Class theClass)
theClass
- the class to parse for testing.
java.lang.IllegalArgumentException
- if theClass is
null.Method Detail |
public java.lang.String[] getWarnings()
public void clearWarnings()
public java.lang.reflect.Method[] getTestMethods()
public java.lang.String getName()
public java.lang.Class getTestClass()
protected boolean testClass(java.lang.Class theClass)
theClass
- the class to parse for testing.
protected void discoverTestMethods(java.lang.Class theClass)
theClass
- the class to parse for testing.protected void addTestMethod(java.lang.reflect.Method m, java.util.Vector names)
m
- the method to add.names
- a list of method names that have already been inspected.protected boolean isPublicTestMethod(java.lang.reflect.Method m)
m
- the method under scrutiny.
isTestMethod( Method )
protected boolean isTestMethod(java.lang.reflect.Method m)
m
- the method under scrutiny.
protected void warning(java.lang.String message)
message
- the message describing the warning.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |