Class DynamicTest
java.lang.Object
io.deephaven.enterprise.validation.dynamic.DynamicTest
- All Implemented Interfaces:
Comparable<DynamicTest>
A configuration defined data quality test case for DynamicValidator. These dynamic tests can be produced at runtime
without users generating code.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn exception thrown when problems are encountered converting strings into typed parameter values.static classAn exception thrown when attempting to set a parameter that does not exist in the method.static classAn exception resulting from reflection not being able to access parameter names.static classAn exception thrown when trying to invoke the test, but a required parameter has not been set.static classAn exception thrown when DynamicValidatorInterface contains multiple methods with the same name.static classAn exception thrown when the test method is not present in DynamicValidatorInterface. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddImports(String... imports) Adds java imports for use in dynamic code generation.intcompareTo(@NotNull DynamicTest o) Gets the name of the DynamicValidatorInterface method for the test.voidinvoke(DynamicValidatorInterface validator) Invoke the test.booleanisAnnotationPresentClass(Class<? extends Annotation> annotationClass) booleanIndicates if the test should be run in TestValidationMode.FULL_DATABASE mode.booleanIndicates if the test should be run in TestValidationMode.SIMPLE_TABLE mode.voidAdds a parameter for use when invoking the test method.voidsetRunFullDatabase(boolean runFullDatabase) Sets if the test should be run in TestValidationMode.FULL_DATABASE mode.voidsetRunSimpleTable(boolean runSimpleTable) Sets if the test should be run in TestValidationMode.SIMPLE_TABLE mode.toString()
-
Constructor Details
-
DynamicTest
Creates a new test.- Parameters:
methodName- name of the DynamicValidatorInterface method for the test.
-
-
Method Details
-
isAnnotationPresentClass
-
getMethodName
Gets the name of the DynamicValidatorInterface method for the test.- Returns:
- name of the DynamicValidatorInterface method for the test.
-
isRunFullDatabase
public boolean isRunFullDatabase()Indicates if the test should be run in TestValidationMode.FULL_DATABASE mode.- Returns:
- true if the test should be run in TestValidationMode.FULL_DATABASE mode; false otherwise.
-
setRunFullDatabase
public void setRunFullDatabase(boolean runFullDatabase) Sets if the test should be run in TestValidationMode.FULL_DATABASE mode.- Parameters:
runFullDatabase- true if the test should be run in TestValidationMode.FULL_DATABASE mode; false otherwise.
-
isRunSimpleTable
public boolean isRunSimpleTable()Indicates if the test should be run in TestValidationMode.SIMPLE_TABLE mode.- Returns:
- true if the test should be run in TestValidationMode.SIMPLE_TABLE mode; false otherwise.
-
setRunSimpleTable
public void setRunSimpleTable(boolean runSimpleTable) Sets if the test should be run in TestValidationMode.SIMPLE_TABLE mode.- Parameters:
runSimpleTable- true if the test should be run in TestValidationMode.SIMPLE_TABLE mode; false otherwise.
-
addImports
Adds java imports for use in dynamic code generation.- Parameters:
imports- java imports for use in dynamic code generation.
-
parameter
Adds a parameter for use when invoking the test method. During execution, the value strings will be dynamically converted to the appropriate type.- Parameters:
name- parameter namevalue- parameter value string
-
invoke
public void invoke(DynamicValidatorInterface validator) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException, InstantiationException Invoke the test.- Parameters:
validator- data validator to use when executing the test.- Throws:
InvocationTargetException- problem executing the testIllegalAccessException- problem executing the testInstantiationExceptionNoSuchMethodException
-
compareTo
- Specified by:
compareToin interfaceComparable<DynamicTest>
-
toString
-