Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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

FocusIDDescriptionTest Data
Expected Result
ServiceLoader API

1Tests when there are no providers found by the ServiceLoader API due to missing or empty meta-inf fileNo META-INF/Services/org.apache.daffodil.udf.UDFunctionProvider file on classpath of classLoader (CLI Test)
“No user defined functions found.” error
2Tests when there is an error thrown from ServiceLoader APIMETA-INF/Services/org.apache.daffodil.udf.UDFunctionProvider file contains typo in class name
“ServiceConfigurationError” error
Provider Class

3Tests when UDF Provider has no function classesUDF with no call to setFunctionClasses initializing functionClasses to array of classes
Warning: Provider Ignored...No function classes found
4Tests when UDF Provider has empty function classUDF with call to setFunctionClasses initializing functionClasses to empty array of
classesWarning: Provider Ignored...No function
classes
found
5Tests when provider doesn’t implement UDFunctionProviderUDF with Provider that doesn’t extend UDFunctionProvider class
Provider not “seen” by Daffodil
Function Class



6Tests when function classes don’t implement Serializable classUDF with function class that doesn’t implement Serializable interface
Warning: Provider Ignored...FunctionClass(es) must implement java.io.Serializable7
7Tests when function classes don’t
Tests when function classes don’t
have annotationsUDF with function class that doesn’t have function class annotation
Warning: Provider Ignored...Annotations missing for FunctionClass(es)
8Tests when function classes have empty/invalid annotation fieldsUDF 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.”
9Tests when function classes have no evaluate functionUDF with function class whose method isn’t named “evaluate”
“Missing evaluate method for function provided” error
10Tests when function can’t be foundFunction call from schema with no non either non existent namespace or name
“Function not found” error
Evaluate function




11Tests when function class have overloaded evaluate functionUDF with overloaded
evaluate function“Only one
evaluate
method allowed per
function
class” error
12Tests when arguments number incorrectFunction call from schema with incorrect arg number
IllegalArgumentException
13Tests when argument types incorrectFunction call from schema with incorrect arg type
IllegalArgumentException
14Tests when argument types unsupportedFunction call from schema with unsupported type (such as Calendar)
“Unsupported object representation type” error
15Tests when return type unsupportedUDF with unsupported return type such as Array of Arrays
“Unsupported object representation type” error
16Tests UDF with no argsUDF with no param and static return type
Returns value of static return

17Tests UDF with no return typeUDF with void return type
Error: "Evaluate method for function provided cannot be void"
Primitive Arg/Return Types Testing





18Tests UDF with primitive int params and returnsUDF with primitive params and return
Return specified type
19Tests UDF with primitive byte params and returnsUDF with primitive params and return
Return specified type
20Tests UDF with primitive short params and returnsUDF with primitive params and return
Return specified type
21Tests UDF with primitive long params and returnsUDF with primitive params and return
Return specified type
22Tests UDF with primitive double params and returnsUDF with primitive params and
returnReturn specified type
return
23Tests UDF with primitive float params and returnsUDF with primitive params and return
Return specified type
24Tests UDF with primitive boolean params and returnsUDF with primitive params and return
Return specified type
Boxed Args/Return Type Testing





25Tests UDF with Boxed Integer params and returnsUDF with boxed params and return
Return specified type
26Tests UDF with Boxed Byte params and returnsUDF with boxed params and return
Return specified type
27Tests UDF with Boxed Short params and returnsUDF with boxed params and return
Return specified type
28Tests UDF with Boxed Long params and returnsUDF with boxed params and return
Return specified type
29Tests UDF with Boxed Double params and returnsUDF with boxed params and return
Return specified type
30Tests UDF with Boxed Float params and returnsUDF with boxed params and return
Return specified type
31Tests UDF with Boxed Boolean params and returnsUDF with boxed params and return
Return specified type
Other Param/Return Types



32Tests UDF with Java Big Integer params and returnsUDF with specified params and returns
Return specified type
33Tests UDF with Java Big Decimal params and returnsUDF with specified params and returns
Return specified type
34Tests UDF with String params and returnsUDF with specified params and returns
Return specified type
35Tests UDF with Byte Array params and returnsUDF with specified params and returns
Return specified type
36Tests UDF with URI params and returnsUDF with specified params and returns
Return specified type

Prototype

UDF Jars: HAEMSLConversions.jar and UDFunctionProviderImpl.jar. Both extend UDFunctionProvider.jar.

...