-
Notifications
You must be signed in to change notification settings - Fork 72
Add warning for ock=parsed without ssp=anyEmpty
#1613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
olabusayoT
wants to merge
2
commits into
apache:main
Choose a base branch
from
olabusayoT:daf-2801-ock-parsed-warning
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
134 changes: 134 additions & 0 deletions
134
...est/src/test/resources/org/apache/daffodil/section14/occursCountKind/implicitvparsed.tdml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| Licensed to the Apache Software Foundation (ASF) under one or more | ||
| contributor license agreements. See the NOTICE file distributed with | ||
| this work for additional information regarding copyright ownership. | ||
| The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| (the "License"); you may not use this file except in compliance with | ||
| the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
| <tdml:testSuite xmlns:tdml="http://www.ibm.com/xmlns/dfdl/testData" | ||
| xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
| xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" | ||
| xmlns:ex="http://example.com" suiteName="rothrsreq" description="testing otg gold schemas" defaultRoundTrip="true"> | ||
| <tdml:defineSchema name="otg-schema" elementFormDefault="unqualified" useDefaultNamespace="false"> | ||
| <xs:include schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/> | ||
| <dfdl:defineFormat name="DefaultPropertiesFormat"> | ||
| <dfdl:format ref="ex:GeneralFormat" | ||
| emptyValueDelimiterPolicy="none" | ||
| fillByte="0" | ||
| lengthKind="delimited" | ||
| lengthUnits="characters" | ||
| nilKind="literalValue" | ||
| nilValue="%ES;" | ||
| nilValueDelimiterPolicy="none" | ||
| representation="text" | ||
| separatorPosition="infix" | ||
| separatorSuppressionPolicy="anyEmpty" | ||
| textNumberPadCharacter="0" | ||
| textNumberPattern="###0.###;-###0.###" | ||
| textPadKind="none" | ||
| textStandardZeroRep="" /> | ||
| </dfdl:defineFormat> | ||
| <dfdl:format ref="ex:DefaultPropertiesFormat"/> | ||
|
|
||
| <xs:element name="e1"> | ||
| <xs:complexType> | ||
| <xs:sequence dfdl:separator="/" dfdl:separatorPosition="prefix" dfdl:terminator="%NL;"> | ||
| <xs:element name="se1" type="xs:int"/> | ||
| <xs:element name="se2" type="xs:int"/> | ||
| <xs:element name="arre1" maxOccurs="3" dfdl:occursCountKind="parsed"> | ||
| <xs:complexType> | ||
| <xs:sequence dfdl:separator="-"> | ||
| <xs:choice> | ||
| <xs:element name="ie1" type="xs:int"/> | ||
| <xs:element name="ie2" type="xs:float"/> | ||
| </xs:choice> | ||
| <xs:element name="ie3" type="xs:string"/> | ||
| </xs:sequence> | ||
| </xs:complexType> | ||
| </xs:element> | ||
| <xs:element name="se5" type="xs:string"/> | ||
| <xs:element name="se6" type="xs:int"/> | ||
| </xs:sequence> | ||
| </xs:complexType> | ||
| </xs:element> | ||
|
|
||
| <xs:element name="e2"> | ||
| <xs:complexType> | ||
| <xs:sequence dfdl:separator="/" dfdl:separatorPosition="prefix" dfdl:terminator="%NL;"> | ||
| <xs:element name="se1" type="xs:int"/> | ||
| <xs:element name="se2" type="xs:int"/> | ||
| <xs:element name="arre1" maxOccurs="3" dfdl:occursCountKind="implicit"> | ||
| <xs:complexType> | ||
| <xs:sequence dfdl:separator="-"> | ||
| <xs:choice> | ||
| <xs:element name="ie1" type="xs:int"/> | ||
| <xs:element name="ie2" type="xs:float"/> | ||
| </xs:choice> | ||
| <xs:element name="ie3" type="xs:string"/> | ||
| </xs:sequence> | ||
| </xs:complexType> | ||
| </xs:element> | ||
| <xs:element name="se5" type="xs:string"/> | ||
| <xs:element name="se6" type="xs:int"/> | ||
| </xs:sequence> | ||
| </xs:complexType> | ||
| </xs:element> | ||
| </tdml:defineSchema> | ||
|
|
||
| <tdml:parserTestCase name="test_array_parsed" root="e1" model="otg-schema" roundTrip="none"> | ||
| <tdml:document><![CDATA[/1/2/3.5-one/4-two/a/6 | ||
| ]]></tdml:document> | ||
| <tdml:infoset> | ||
| <tdml:dfdlInfoset> | ||
| <ex:e1> | ||
| <se1>1</se1> | ||
| <se2>2</se2> | ||
| <arre1> | ||
| <ie2>3.5</ie2> | ||
| <ie3>one</ie3> | ||
| </arre1> | ||
| <arre1> | ||
| <ie1>4</ie1> | ||
| <ie3>two</ie3> | ||
| </arre1> | ||
| <se5>a</se5> | ||
| <se6>6</se6> | ||
| </ex:e1> | ||
| </tdml:dfdlInfoset> | ||
| </tdml:infoset> | ||
| </tdml:parserTestCase> | ||
|
|
||
| <tdml:parserTestCase name="test_array_implicit" root="e2" model="otg-schema" roundTrip="none"> | ||
| <tdml:document><![CDATA[/1/2/3.5-one/4-two/a/6 | ||
| ]]></tdml:document> | ||
| <tdml:infoset> | ||
| <tdml:dfdlInfoset> | ||
| <ex:e2> | ||
| <se1>1</se1> | ||
| <se2>2</se2> | ||
| <arre1> | ||
| <ie2>3.5</ie2> | ||
| <ie3>one</ie3> | ||
| </arre1> | ||
| <arre1> | ||
| <ie1>4</ie1> | ||
| <ie3>two</ie3> | ||
| </arre1> | ||
| <se5>a</se5> | ||
| <se6>6</se6> | ||
| </ex:e2> | ||
| </tdml:dfdlInfoset> | ||
| </tdml:infoset> | ||
| </tdml:parserTestCase> | ||
|
|
||
| </tdml:testSuite> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...st/src/test/scala/org/apache/daffodil/section14/occursCountKind/TestImplicitvParsed.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.daffodil.section14.occursCountKind | ||
|
|
||
| import org.apache.daffodil.junit.tdml.TdmlSuite | ||
| import org.apache.daffodil.junit.tdml.TdmlTests | ||
|
|
||
| import org.junit.Test | ||
|
|
||
| object TestImplicitvParsed extends TdmlSuite { | ||
| val tdmlResource = "org/apache/daffodil/section14/occursCountKind/implicitvparsed.tdml" | ||
| } | ||
|
|
||
| class TestImplicitvParsed extends TdmlTests { | ||
| val tdmlSuite = TestImplicitvParsed | ||
|
|
||
| @Test def test_array_parsed = test | ||
| @Test def test_array_implicit = test | ||
|
|
||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes both SSP and OCK. Why change both? Could we jsut change SSP to anyEmpty (which should work with OKC=parsed) or change OCK=implicit with the existing SSP? I'm not sure what the test is trying to test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed both since I think "parsed" was not the right option what with the min/maxOccurs, so implicit seemed like the better option. I also changed SSP because "never" would add in the additional prefix separator for the missing groupOfFields element. Technically nothing needed to change, but OCK=implicit and SSP=anyEmpty seems like the correct thing based on the attributes and the data/infoset