|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.geronimo.validator.ValidationTest
The base class for all validation tests. They will work similarly to JUnit tests, in that any method beginning with "test" will be executed. The test methods should return a ValidationResult, though they may also indicate problems by throwing a ValidationException. The difference is that a ValidationException is considered to be fatal, whereas a ValidationResult may indicate a warning or a non-fatal error as well. Each test class may specify a deployment descriptor and XPath, in which case the same test class will have its tests executed multiple times with a different context each time (once for each DD and/or hit on the XPath).
Field Summary | |
protected ValidationContext |
context
|
Constructor Summary | |
ValidationTest()
|
Method Summary | |
protected ValidationResult |
error(String messageCode)
|
protected ValidationResult |
error(String messageCode,
Object param)
|
protected ValidationResult |
error(String messageCode,
Object[] params)
|
protected ValidationResult |
error(String messageCode,
ValidationResult oldState)
|
protected ValidationResult |
error(String messageCode,
ValidationResult oldState,
Object param)
|
protected ValidationResult |
error(String messageCode,
ValidationResult oldState,
Object[] params)
|
abstract org.apache.xmlbeans.SchemaType |
getSchemaType()
Any given test class is typically associated with one particular deployment descriptor. |
abstract String |
getXpath()
Any given test class can be associated with a specific XPath in its deployment descriptor. |
abstract ValidationResult |
initialize(ValidationContext context)
Called before any test methods are run in order to establish the context for the test. |
protected Class |
loadClass(String className,
String description)
Loads a class from the application module. |
protected ValidationResult |
warn(String messageCode)
|
protected ValidationResult |
warn(String messageCode,
Object param)
|
protected ValidationResult |
warn(String messageCode,
Object[] params)
|
protected ValidationResult |
warn(String messageCode,
ValidationResult oldState)
|
protected ValidationResult |
warn(String messageCode,
ValidationResult oldState,
Object param)
|
protected ValidationResult |
warn(String messageCode,
ValidationResult oldState,
Object[] params)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ValidationContext context
Constructor Detail |
public ValidationTest()
Method Detail |
public abstract org.apache.xmlbeans.SchemaType getSchemaType()
public abstract String getXpath()
public abstract ValidationResult initialize(ValidationContext context)
context
- The context for all test methods in this class to use.
protected Class loadClass(String className, String description) throws ValidationException
className
- The fully-qualified Java class name of the class to
load.description
- A description of the why this class is being loaded,
used in an error message if it cannot be loaded.
("Class [className] could not be loaded ([description])")
ValidationException
- occurs when the class can't be loaded.
Don't both to catch this exception unless you don't want a
failure to load the class to be interpreted as a fatal error.protected ValidationResult warn(String messageCode, ValidationResult oldState)
protected ValidationResult warn(String messageCode, ValidationResult oldState, Object param)
protected ValidationResult warn(String messageCode, ValidationResult oldState, Object[] params)
protected ValidationResult warn(String messageCode)
protected ValidationResult warn(String messageCode, Object param)
protected ValidationResult warn(String messageCode, Object[] params)
protected ValidationResult error(String messageCode, ValidationResult oldState)
protected ValidationResult error(String messageCode, ValidationResult oldState, Object param)
protected ValidationResult error(String messageCode, ValidationResult oldState, Object[] params)
protected ValidationResult error(String messageCode)
protected ValidationResult error(String messageCode, Object param)
protected ValidationResult error(String messageCode, Object[] params)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |