You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Steve Lawrence (Jira)" <ji...@apache.org> on 2022/03/18 19:27:00 UTC

[jira] [Commented] (DAFFODIL-2679) exportJars := true and documentPart type="file" is broken

    [ https://issues.apache.org/jira/browse/DAFFODIL-2679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17509043#comment-17509043 ] 

Steve Lawrence commented on DAFFODIL-2679:
------------------------------------------

For whoever implements this, we can likely build a JarURLConnection from the URL we already have in that code linked. Then we can call getEntry() to get a JarEntry which has a getSize() method.

> exportJars := true and documentPart type="file" is broken
> ---------------------------------------------------------
>
>                 Key: DAFFODIL-2679
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2679
>             Project: Daffodil
>          Issue Type: Bug
>          Components: TDML Runner
>    Affects Versions: 3.1.0
>            Reporter: Steve Lawrence
>            Priority: Major
>
> If exportJars is true and documentPart type="file" then we fail to get the length of the TDML file because it is inside a jar with the "jar" protocol. This leads to an assertion because the length ends up as -1. The code of interest is here:
> https://github.com/apache/daffodil/blob/main/daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala#L2249-L2262
> We should fix this so that we can get the length of TDML resources in jars and so that the TDML runner can use test files from a jar. Or alternatively, just allow length to be unknown in this case and tests have no limit. That is not as ideal, since it means different behavior depending on jar vs non-jar test files.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)