THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
- Warning: No annotation present in function class(es) of \[Provider_ClassName]. Class will be ignored.
- Error: No User Defined function class with specified name/namespace found. (List all names/namespaces with associated providers)
- Error: No evaluate function found in function class object
Testing
...
- Provider Checks
- No provider class
- No or empty functionClass list (i.e getFunctionClasses is empty)
- Function Class Checks
- No evaluate function
- Annotations Checks
- No FunctionClassInfo annotation
- Elements not filled in/empty
...
Focus | ID | Description | Test Data | Expected Result |
---|---|---|---|---|
ServiceLoader API | 1 | Tests when there are no providers found by the ServiceLoader API due to missing or empty meta-inf file | No META-INF/Services/org.apache.daffodil.udf.UDFunctionProvider file on classpath of classLoader (CLI Test) | “No user defined functions found.” error |
2 | Tests when there is an error thrown from ServiceLoader API | META-INF/Services/org.apache.daffodil.udf.UDFunctionProvider file contains typo in class name | “ServiceConfigurationError” error | |
Provider Class | 3 | Tests when UDF Provider has no function classes | UDF with no call to setFunctionClasses initializing functionClasses to array of classes | Warning: Provider Ignored...No function classes found |
4 | Tests when UDF Provider has empty function class | UDF with call to setFunctionClasses initializing functionClasses to empty array of classes | Warning: Provider Ignored...No function classes found | |
5 | Tests when provider doesn’t implement UDFunctionProvider | UDF with Provider that doesn’t extend UDFunctionProvider class | Provider not “seen” by Daffodil | |
Function Class | 6 | Tests when function classes don’t implement Serializable class | UDF with function class that doesn’t implement Serializable interface | Warning: Provider Ignored...FunctionClass(es) must implement java.io.Serializable |
7 | Tests when function classes don’t have annotations | UDF with function class that doesn’t have function class annotation | Warning: Provider Ignored...Annotations missing for FunctionClass(es) | |
8 | Tests when function classes have empty/invalid annotation fields | UDF with function class that has annotation function with empty fields | FunctionClass ignored: … “Annotation namespace field is empty or invalid.” and/or “Annotation namespace field is empty or invalid.” | |
9 | Tests when function classes have no evaluate function | UDF with function class whose method isn’t named “evaluate” | “Missing evaluate method for function provided” error | |
10 | Tests when function can’t be found | Function call from schema with no non either non existent namespace or name | “Function not found” error | |
Evaluate function | 11 | Tests when function class have overloaded evaluate function | UDF with overloaded evaluate function | “Only one evaluate method allowed per function class” error |
12 | Tests when arguments number incorrect | Function call from schema with incorrect arg number | IllegalArgumentException | |
13 | Tests when argument types incorrect | Function call from schema with incorrect arg type | IllegalArgumentException | |
14 | Tests when argument types unsupported | Function call from schema with unsupported type (such as Calendar) | “Unsupported object representation type” error | |
15 | Tests when return type unsupported | UDF with unsupported return type such as Array of Arrays | “Unsupported object representation type” error | |
16 | Tests UDF with no args | UDF with no param and static return type | Returns value of static return | |
17 | Tests UDF with no return type | UDF with void return type | Returns null or nil | |
Primitive Arg/Return Types Testing | 18 | Tests UDF with primitive int params and returns | UDF with primitive params and return | Return specified type |
19 | Tests UDF with primitive byte params and returns | UDF with primitive params and return | Return specified type | |
20 | Tests UDF with primitive short params and returns | UDF with primitive params and return | Return specified type | |
21 | Tests UDF with primitive long params and returns | UDF with primitive params and return | Return specified type | |
22 | Tests UDF with primitive double params and returns | UDF with primitive params and return | Return specified type | |
23 | Tests UDF with primitive float params and returns | UDF with primitive params and return | Return specified type | |
24 | Tests UDF with primitive boolean params and returns | UDF with primitive params and return | Return specified type | |
Boxed Args/Return Type Testing | 25 | Tests UDF with Boxed Integer params and returns | UDF with boxed params and return | Return specified type |
26 | Tests UDF with Boxed Byte params and returns | UDF with boxed params and return | Return specified type | |
27 | Tests UDF with Boxed Short params and returns | UDF with boxed params and return | Return specified type | |
28 | Tests UDF with Boxed Long params and returns | UDF with boxed params and return | Return specified type | |
29 | Tests UDF with Boxed Double params and returns | UDF with boxed params and return | Return specified type | |
30 | Tests UDF with Boxed Float params and returns | UDF with boxed params and return | Return specified type | |
31 | Tests UDF with Boxed Boolean params and returns | UDF with boxed params and return | Return specified type | |
Other Param/Return Types | 32 | Tests UDF with Java Big Integer params and returns | UDF with specified params and returns | Return specified type |
33 | Tests UDF with Java Big Decimal params and returns | UDF with specified params and returns | Return specified type | |
34 | Tests UDF with String params and returns | UDF with specified params and returns | Return specified type | |
35 | Tests UDF with Byte Array params and returns | UDF with specified params and returns | Return specified type | |
36 | Tests UDF with URI params and returns | UDF with specified params and returns | Return specified type |
...
Prototype
UDF Jars: HAEMSLConversions.jar and UDFunctionProviderImpl.jar. Both extend UDFunctionProvider.jar.
...