Class DynamicTest
java.lang.Object
com.illumon.iris.validation.dynamic.DynamicTest
- All Implemented Interfaces:
Serializable
,Comparable<DynamicTest>
A configuration defined data quality test case for DynamicValidator. These dynamic tests can be produced at runtime
without users generating code.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
An exception thrown when problems are encountered converting strings into typed parameter values.static class
An exception thrown when attempting to set a parameter that does not exist in the method.static class
An exception resulting from reflection not being able to access parameter names.static class
An exception thrown when trying to invoke the test, but a required parameter has not been set.static class
An exception thrown when DynamicValidatorInterface contains multiple methods with the same name.static class
An exception thrown when the test method is not present in DynamicValidatorInterface. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addImports
(String... imports) Adds java imports for use in dynamic code generation.int
Gets the name of the DynamicValidatorInterface method for the test.void
invoke
(DynamicValidatorInterface validator) Invoke the test.boolean
Indicates if the test should be run in TestValidationMode.FULL_DATABASE mode.boolean
Indicates if the test should be run in TestValidationMode.SIMPLE_TABLE mode.void
Adds a parameter for use when invoking the test method.void
setRunFullDatabase
(boolean runFullDatabase) Sets if the test should be run in TestValidationMode.FULL_DATABASE mode.void
setRunSimpleTable
(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
-
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 testNoSuchMethodException
InstantiationException
-
compareTo
- Specified by:
compareTo
in interfaceComparable<DynamicTest>
-
toString
-