Sounds great.
I do like the idea of including official UDFs with actual functionality
that we currently don't support, so it'd useful in that sense, but could
also act as a model to follow for implementing UDFs with Daffodil. For
testing though, I agree with putting stuff in src/test as we can have
good UDFs, bad UDFs and everything in between in a consistent manner.
Re errors, there was some chatter during the planning phase that wasn't
in favor of using SDE & SDWs, so would the Daffodil-defined exception
objects you referenced be specific to User Defined Functions?
On 9/6/19 11:38 AM, Steve Lawrence wrote:
> Completely agreed.
>
> Regarding test UDF's, we should be able to create custom test UDF's in
> src/test/{scala,java} which will get compiled into jars and put on the
> class path only during testing. Daffodil should be able to find them
> just like it would find any other jar on the classpath, allowing us to
> fully exercise UDF capabilities (including broken UDFs) without
> polluting daffodil proper.
>
> On 9/6/19 11:31 AM, Beckerle, Mike wrote:
>> re: Design-for-Test for UDF facility
>>
>>
>> When this code gets to code review with tests one of the key things will be
>> that we get decent diagnostics from this for all the things users can do
>> wrong in creating the UDF jar, such as not having it be found, not having
>> all the classes in it, not having them named right or derived properly, etc.
>> etc. First cut is errors should be throwing a Daffodil-defined exception
>> object, which encapsulates whatever exception object the actual underlying
>> UDF reflection code or Service API call throws.
>>
>>
>> Regression testing this UDF facility will require some trickery, as some
>> tests will not be ordinary JUnit-style tests, as incorrectly-constructed
>> jars have to be created and used.
>>
>>
>> I recommend that we add some "official" UDFs to daffodil that are always
>> part of the standard build, not because they are useful, but because they
>> allow us to test the UDF system.
>>
>>
>> An important test case is also to define such a UDF which throws an
>> exception, so that we can have tests that verify the exception is properly
>> caught and reported.
>>
>> ________________________________
>> From: Kilo, Olabusayo <[email protected]>
>> Sent: Friday, September 6, 2019 10:30 AM
>> To: [email protected] <[email protected]>
>> Subject: [DISCUSS] User Defined Functions Capability
>>
>> I'm requesting a discussion on the addition of the User Defined Functions
>> capability to daffodil. The proposal referenced below provides a possible
>> solution for Daffodil to be able to process and use User Defined Functions
>> referenced in the DFDL Schema.
>>
>> The original request can be found at
>> https://issues.apache.org/jira/browse/DAFFODIL-2186 and the proposal can be
>> found
>> https://cwiki.apache.org/confluence/display/DAFFODIL/Proposal%3A+User+Defined+Functions.
>>
--
Best Regards
Lola K.