You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2019/06/18 11:57:38 UTC

[plc4x] branch develop updated: Revert: Some Renaming of types to be less ambiguous. (3758ed68) - Additionally disabled the mis-behaving daffodil tests.

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new f93553c  Revert: Some Renaming of types to be less ambiguous. (3758ed68) - Additionally disabled the mis-behaving daffodil tests.
f93553c is described below

commit f93553c1a83b9a01e9d5557ee30752774dd7030d
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Tue Jun 18 13:57:31 2019 +0200

    Revert: Some Renaming of types to be less ambiguous. (3758ed68)
    - Additionally disabled the mis-behaving daffodil tests.
---
 .../apache/plc4x/protocols/s7/protocol.dfdl.xsd    | 268 ++++++++++-----------
 .../plc4x/protocols/AbstractProtocolTest.java      |   2 +-
 2 files changed, 133 insertions(+), 137 deletions(-)

diff --git a/protocols/s7/src/main/resources/org/apache/plc4x/protocols/s7/protocol.dfdl.xsd b/protocols/s7/src/main/resources/org/apache/plc4x/protocols/s7/protocol.dfdl.xsd
index fc36064..20a5813 100644
--- a/protocols/s7/src/main/resources/org/apache/plc4x/protocols/s7/protocol.dfdl.xsd
+++ b/protocols/s7/src/main/resources/org/apache/plc4x/protocols/s7/protocol.dfdl.xsd
@@ -212,7 +212,7 @@
                         dfdl:occursCount="{if(../../headerLength gt 6) then 1 else 0}">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element name="parameter" type="s7:CotpParameter" maxOccurs="unbounded"/>
+                        <xs:element name="parameter" type="s7:Parameter" maxOccurs="unbounded"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
@@ -230,7 +230,7 @@
                         dfdl:occursCount="{if(../../headerLength gt 6) then 1 else 0}">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element name="parameter" type="s7:CotpParameter" maxOccurs="unbounded"/>
+                        <xs:element name="parameter" type="s7:Parameter" maxOccurs="unbounded"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
@@ -248,7 +248,7 @@
                         dfdl:occursCount="{if(../../headerLength gt 6) then 1 else 0}">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element name="parameter" type="s7:CotpParameter" maxOccurs="unbounded"/>
+                        <xs:element name="parameter" type="s7:Parameter" maxOccurs="unbounded"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
@@ -265,7 +265,7 @@
                         dfdl:occursCount="{if(../../headerLength gt 5) then 1 else 0}">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element name="parameter" type="s7:CotpParameter" maxOccurs="unbounded"/>
+                        <xs:element name="parameter" type="s7:Parameter" maxOccurs="unbounded"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
@@ -282,7 +282,7 @@
                         dfdl:occursCount="{if(../../headerLength gt 4) then 1 else 0}">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element name="parameter" type="s7:CotpParameter" maxOccurs="unbounded"/>
+                        <xs:element name="parameter" type="s7:Parameter" maxOccurs="unbounded"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
@@ -296,7 +296,7 @@
         </xs:sequence>
     </xs:complexType>
 
-    <xs:complexType name="CotpParameter">
+    <xs:complexType name="Parameter">
         <xs:sequence>
             <xs:element name="type" type="s7:CotpParameterType"/>
             <xs:element name="parameterLength" type="plc4x:uint8"/>
@@ -386,7 +386,21 @@
                         dfdl:occursCount="{if(../parametersLength gt 0) then 1 else 0}">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element name="parameter" type="s7:S7RequestParameter" maxOccurs="unbounded"/>
+                        <xs:element name="parameter" maxOccurs="unbounded">
+                            <xs:complexType>
+                                <xs:sequence>
+                                    <xs:element name="type" type="plc4x:uint8"/>
+                                    <xs:choice dfdl:choiceDispatchKey="{xs:string(type)}">
+                                        <xs:element dfdl:choiceBranchKey="240" name="s7GeneralParameterSetupCommunication"
+                                                    type="s7:S7GeneralParameterSetupCommunication"/>
+                                        <xs:element dfdl:choiceBranchKey="4" name="s7RequestParameterReadVar"
+                                                    type="s7:S7RequestParameterReadVar"/>
+                                        <xs:element dfdl:choiceBranchKey="5" name="s7RequestParameterWriteVar"
+                                                    type="s7:S7RequestParameterWriteVar"/>
+                                    </xs:choice>
+                                </xs:sequence>
+                            </xs:complexType>
+                        </xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
@@ -409,9 +423,23 @@
                             of items for a read/write request in order to process the correct number of items in
                             the payload.
                         -->
-                        <xs:element name="payload" type="s7:S7Payload" maxOccurs="unbounded"
+                        <xs:element name="payload" maxOccurs="unbounded"
                                     dfdl:occursCountKind="expression"
-                                    dfdl:occursCount="{fn:count(../../parameters[1]/parameter)}"/>
+                                    dfdl:occursCount="{fn:count(../../parameters[1]/parameter)}">
+                            <xs:complexType>
+                                <xs:sequence>
+                                    <xs:choice
+                                        dfdl:choiceDispatchKey="{xs:string(../../parameters[1]/parameter[dfdl:occursIndex()]/type)}">
+                                        <xs:element dfdl:choiceBranchKey="240" name="s7GeneralPayloadSetupCommunication"
+                                                    type="s7:S7GeneralPayloadSetupCommunication"/>
+                                        <xs:element dfdl:choiceBranchKey="4" name="s7RequestPayloadReadVar"
+                                                    type="s7:S7RequestPayloadReadVar"/>
+                                        <xs:element dfdl:choiceBranchKey="5" name="s7RequestPayloadWriteVar"
+                                                    type="s7:S7RequestPayloadWriteVar"/>
+                                    </xs:choice>
+                                </xs:sequence>
+                            </xs:complexType>
+                        </xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
@@ -436,7 +464,21 @@
                         dfdl:occursCount="{if(../parametersLength gt 0) then 1 else 0}">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element name="parameter" type="s7:S7ResponseParameter" maxOccurs="unbounded"/>
+                        <xs:element name="parameter" maxOccurs="unbounded">
+                            <xs:complexType>
+                                <xs:sequence>
+                                    <xs:element name="type" type="plc4x:uint8"/>
+                                    <xs:choice dfdl:choiceDispatchKey="{xs:string(type)}">
+                                        <xs:element dfdl:choiceBranchKey="240" name="s7GeneralParameterSetupCommunication"
+                                                    type="s7:S7GeneralParameterSetupCommunication"/>
+                                        <xs:element dfdl:choiceBranchKey="4" name="s7ResponseParameterReadVar"
+                                                    type="s7:S7ResponseParameterReadVar"/>
+                                        <xs:element dfdl:choiceBranchKey="5" name="s7ResponseParameterWriteVar"
+                                                    type="s7:S7ResponseParameterWriteVar"/>
+                                    </xs:choice>
+                                </xs:sequence>
+                            </xs:complexType>
+                        </xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
@@ -459,9 +501,23 @@
                             of items for a read/write request in order to process the correct number of items in
                             the payload.
                         -->
-                        <xs:element name="payload" type="s7:S7Payload" maxOccurs="unbounded"
+                        <xs:element name="payload" maxOccurs="unbounded"
                                     dfdl:occursCountKind="expression"
-                                    dfdl:occursCount="{fn:count(../../parameters[1]/parameter)}"/>
+                                    dfdl:occursCount="{fn:count(../../parameters[1]/parameter)}">
+                            <xs:complexType>
+                                <xs:sequence>
+                                    <xs:choice
+                                        dfdl:choiceDispatchKey="{xs:string(../../parameters[1]/parameter[dfdl:occursIndex()]/type)}">
+                                        <xs:element dfdl:choiceBranchKey="240" name="s7GeneralPayloadSetupCommunication"
+                                                    type="s7:S7GeneralPayloadSetupCommunication"/>
+                                        <xs:element dfdl:choiceBranchKey="4" name="s7ResponsePayloadReadVar"
+                                                    type="s7:S7ResponsePayloadReadVar"/>
+                                        <xs:element dfdl:choiceBranchKey="5" name="s7ResponsePayloadWriteVar"
+                                                    type="s7:S7ResponsePayloadWriteVar"/>
+                                    </xs:choice>
+                                </xs:sequence>
+                            </xs:complexType>
+                        </xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
@@ -482,7 +538,17 @@
                         dfdl:occursCount="{if(../parametersLength gt 0) then 1 else 0}">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element name="parameter" type="s7:S7GeneralParameter" maxOccurs="unbounded"/>
+                        <xs:element name="parameter" maxOccurs="unbounded">
+                            <xs:complexType>
+                                <xs:sequence>
+                                    <xs:element name="type" type="plc4x:uint8"/>
+                                    <xs:choice dfdl:choiceDispatchKey="{xs:string(type)}">
+                                        <xs:element dfdl:choiceBranchKey="0" name="s7UserDataParameterCPUService"
+                                                    type="s7:S7UserDataParameterCPUService"/>
+                                    </xs:choice>
+                                </xs:sequence>
+                            </xs:complexType>
+                        </xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
@@ -505,9 +571,19 @@
                             of items for a read/write request in order to process the correct number of items in
                             the payload.
                         -->
-                        <xs:element name="payload" type="s7:S7Payload" maxOccurs="unbounded"
+                        <xs:element name="payload" maxOccurs="unbounded"
                                     dfdl:occursCountKind="expression"
-                                    dfdl:occursCount="{fn:count(../../parameters[1]/parameter)}"/>
+                                    dfdl:occursCount="{fn:count(../../parameters[1]/parameter)}">
+                            <xs:complexType>
+                                <xs:sequence>
+                                    <xs:choice
+                                        dfdl:choiceDispatchKey="{xs:string(../../parameters[1]/parameter[dfdl:occursIndex()]/type)}">
+                                        <xs:element dfdl:choiceBranchKey="0" name="s7UserDataPayloadCpuServices"
+                                                    type="s7:S7UserDataPayloadCpuServices"/>
+                                    </xs:choice>
+                                </xs:sequence>
+                            </xs:complexType>
+                        </xs:element>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
@@ -520,50 +596,6 @@
 
     -->
 
-    <xs:complexType name="S7GeneralParameter">
-        <xs:sequence>
-            <xs:element name="type" type="plc4x:uint8"/>
-            <xs:choice dfdl:choiceDispatchKey="{xs:string(type)}">
-                <xs:element dfdl:choiceBranchKey="240" name="s7GeneralParameterSetupCommunication"
-                            type="s7:S7GeneralParameterSetupCommunication"/>
-                <xs:element dfdl:choiceBranchKey="0" name="s7UserDataParameterCPUService"
-                            type="s7:S7UserDataParameterCPUService"/>
-            </xs:choice>
-        </xs:sequence>
-    </xs:complexType>
-
-    <xs:complexType name="S7RequestParameter">
-        <xs:sequence>
-            <xs:element name="type" type="plc4x:uint8"/>
-            <xs:choice dfdl:choiceDispatchKey="{xs:string(type)}">
-                <xs:element dfdl:choiceBranchKey="240" name="s7GeneralParameterSetupCommunication"
-                            type="s7:S7GeneralParameterSetupCommunication"/>
-                <xs:element dfdl:choiceBranchKey="4" name="s7RequestParameterReadVar"
-                            type="s7:S7RequestParameterReadVar"/>
-                <xs:element dfdl:choiceBranchKey="5" name="s7RequestParameterWriteVar"
-                            type="s7:S7RequestParameterWriteVar"/>
-                <xs:element dfdl:choiceBranchKey="0" name="s7UserDataParameterCPUService"
-                            type="s7:S7UserDataParameterCPUService"/>
-            </xs:choice>
-        </xs:sequence>
-    </xs:complexType>
-
-    <xs:complexType name="S7ResponseParameter">
-        <xs:sequence>
-            <xs:element name="type" type="plc4x:uint8"/>
-            <xs:choice dfdl:choiceDispatchKey="{xs:string(type)}">
-                <xs:element dfdl:choiceBranchKey="240" name="s7GeneralParameterSetupCommunication"
-                            type="s7:S7GeneralParameterSetupCommunication"/>
-                <xs:element dfdl:choiceBranchKey="4" name="s7ResponseParameterReadVar"
-                            type="s7:S7ResponseParameterReadVar"/>
-                <xs:element dfdl:choiceBranchKey="5" name="s7ResponseParameterWriteVar"
-                            type="s7:S7ResponseParameterWriteVar"/>
-                <xs:element dfdl:choiceBranchKey="0" name="s7UserDataParameterCPUService"
-                            type="s7:S7UserDataParameterCPUService"/>
-            </xs:choice>
-        </xs:sequence>
-    </xs:complexType>
-
     <xs:complexType name="S7GeneralParameterSetupCommunication">
         <xs:sequence>
             <!-- Reserved value always 0x00 -->
@@ -705,22 +737,6 @@
 
     -->
 
-    <xs:complexType name="S7Payload">
-        <xs:sequence>
-            <xs:choice
-                dfdl:choiceDispatchKey="{xs:string(../../parameters[1]/parameter[dfdl:occursIndex()]/type)}">
-                <xs:element dfdl:choiceBranchKey="240" name="s7GeneralPayloadSetupCommunication"
-                            type="s7:S7GeneralPayloadSetupCommunication"/>
-                <xs:element dfdl:choiceBranchKey="4" name="s7ResponsePayloadReadVar"
-                            type="s7:S7ResponsePayloadReadVar"/>
-                <xs:element dfdl:choiceBranchKey="5" name="s7ResponsePayloadWriteVar"
-                            type="s7:S7ResponsePayloadWriteVar"/>
-                <xs:element dfdl:choiceBranchKey="0" name="s7UserDataPayloadCpuServices"
-                            type="s7:S7UserDataPayloadCpuServices"/>
-            </xs:choice>
-        </xs:sequence>
-    </xs:complexType>
-
     <xs:complexType name="S7GeneralPayloadSetupCommunication">
         <xs:sequence>
             <xs:element name="data" type="plc4x:null"/>
@@ -793,36 +809,30 @@
                         dfdl:inputValueCalc="{
                                 ../../../../parameters[1]/parameter[dfdl:occursIndex()]/s7ResponseParameterReadVar/numItems
                             }"/>
-            <xs:element name="items" minOccurs="0"
-                        dfdl:occursCountKind="expression" dfdl:occursCount="{if(../numItems gt 0) then 1 else 0}">
+            <xs:element name="item" minOccurs="0" maxOccurs="unbounded"
+                        dfdl:occursCountKind="expression" dfdl:occursCount="{../numItems}">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element name="item" minOccurs="0" maxOccurs="unbounded"
-                                    dfdl:occursCountKind="expression" dfdl:occursCount="{../../numItems}">
-                            <xs:complexType>
-                                <xs:sequence>
-                                    <xs:element name="returnCode" type="plc4x:uint8"/>
-                                    <xs:element name="transportSize" type="plc4x:uint8"/>
-                                    <xs:element name="rawLength" type="plc4x:uint16"/>
-                                    <!--
-                                        For some reason the types BIT, BYTE_WORD_DWORD and INTEGER are transferred in "bits",
-                                        the rest is transferred in "bytes"
-                                    -->
-                                    <xs:element name="lengthInBytes" type="plc4x:uint16" dfdl:inputValueCalc="{
-                                    xs:unsignedShort(if((../transportSize eq 3) or (../../transportSize eq 4) or (../transportSize eq 5))
-                                            then fn:ceiling(xs:double(../../rawLength div 8))
+                        <xs:element name="returnCode" type="plc4x:uint8"/>
+                        <xs:element name="transportSize" type="plc4x:uint8"/>
+                        <xs:element name="rawLength" type="plc4x:uint16"/>
+                        <!--
+                            For some reason the types BIT, BYTE_WORD_DWORD and INTEGER are transferred in "bits",
+                            the rest is transferred in "bytes"
+                        -->
+                        <xs:element name="lengthInBytes" type="plc4x:uint16" dfdl:inputValueCalc="{
+                                    xs:unsignedShort(if((../transportSize eq 3) or (../transportSize eq 4) or (../transportSize eq 5))
+                                            then fn:ceiling(xs:double(../rawLength div 8))
                                             else ../rawLength)}"/>
-                                    <xs:element name="data" type="plc4x:byteN" dfdl:length="{../lengthInBytes}"/>
-                                    <!--
-                                        Transport sizes: BIT, BYTE_WORD_DWORD and OCTET_STRING require a blank byte.
-                                        However only if this is not the last item in the result.
-                                    -->
-                                    <xs:element name="fillByte" type="plc4x:uint8" minOccurs="0"
-                                                dfdl:occursCountKind="expression" dfdl:occursCount="{
+                        <xs:element name="data" type="plc4x:byteN" dfdl:length="{../lengthInBytes}"/>
+                        <!--
+                            Transport sizes: BIT, BYTE_WORD_DWORD and OCTET_STRING require a blank byte.
+                            However only if this is not the last item in the result.
+                        -->
+                        <xs:element name="fillByte" type="plc4x:uint8" minOccurs="0"
+                                    dfdl:occursCountKind="expression" dfdl:occursCount="{
                                             if(((../lengthInBytes mod 2) eq 1) and
-                                                (dfdl:occursIndex() ne ../../../numItems)) then 1 else 0}"/>                                </xs:sequence>
-                            </xs:complexType>
-                        </xs:element>
+                                                (dfdl:occursIndex() ne ../../numItems)) then 1 else 0}"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
@@ -836,37 +846,30 @@
                         dfdl:inputValueCalc="{
                                 ../../../../parameters[1]/parameter[dfdl:occursIndex()]/s7RequestParameterWriteVar/numItems
                             }"/>
-            <xs:element name="items" minOccurs="0"
-                        dfdl:occursCountKind="expression" dfdl:occursCount="{if(../numItems gt 0) then 1 else 0}">
+            <xs:element name="item" minOccurs="0" maxOccurs="unbounded"
+                        dfdl:occursCountKind="expression" dfdl:occursCount="{../numItems}">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element name="item" minOccurs="0" maxOccurs="unbounded"
-                                    dfdl:occursCountKind="expression" dfdl:occursCount="{../../numItems}">
-                            <xs:complexType>
-                                <xs:sequence>
-                                    <xs:element name="returnCode" type="plc4x:uint8"/>
-                                    <xs:element name="transportSize" type="plc4x:uint8"/>
-                                    <xs:element name="rawLength" type="plc4x:uint16"/>
-                                    <!--
-                                        For some reason the types BIT, BYTE_WORD_DWORD and INTEGER are transferred in "bits",
-                                        the rest is transferred in "bytes"
-                                    -->
-                                    <xs:element name="lengthInBytes" type="plc4x:uint16" dfdl:inputValueCalc="{
+                        <xs:element name="returnCode" type="plc4x:uint8"/>
+                        <xs:element name="transportSize" type="plc4x:uint8"/>
+                        <xs:element name="rawLength" type="plc4x:uint16"/>
+                        <!--
+                            For some reason the types BIT, BYTE_WORD_DWORD and INTEGER are transferred in "bits",
+                            the rest is transferred in "bytes"
+                        -->
+                        <xs:element name="lengthInBytes" type="plc4x:uint16" dfdl:inputValueCalc="{
                                     xs:unsignedShort(if((../transportSize eq 3) or (../transportSize eq 4) or (../transportSize eq 5))
                                             then fn:ceiling(../rawLength div 8)
                                             else ../rawLength)}"/>
-                                    <xs:element name="data" type="plc4x:byteN" dfdl:length="{../lengthInBytes}"/>
-                                    <!--
-                                        It seems that the item payload must always be an even number of bytes. So if it's
-                                        not an even number, add a fill byte.
-                                    -->
-                                    <xs:element name="fillByte" type="plc4x:uint8" minOccurs="0"
-                                                dfdl:occursCountKind="expression" dfdl:occursCount="{
+                        <xs:element name="data" type="plc4x:byteN" dfdl:length="{../lengthInBytes}"/>
+                        <!--
+                            It seems that the item payload must always be an even number of bytes. So if it's
+                            not an even number, add a fill byte.
+                        -->
+                        <xs:element name="fillByte" type="plc4x:uint8" minOccurs="0"
+                                    dfdl:occursCountKind="expression" dfdl:occursCount="{
                                             if(((../lengthInBytes mod 2) eq 1) and
-                                                (dfdl:occursIndex() ne ../../../numItems)) then 1 else 0}"/>
-                                </xs:sequence>
-                            </xs:complexType>
-                        </xs:element>
+                                                (dfdl:occursIndex() ne ../../numItems)) then 1 else 0}"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
@@ -880,18 +883,11 @@
                         dfdl:inputValueCalc="{
                                 ../../../../parameters[1]/parameter[dfdl:occursIndex()]/s7ResponseParameterWriteVar/numItems
                             }"/>
-            <xs:element name="items" minOccurs="0"
-                        dfdl:occursCountKind="expression" dfdl:occursCount="{if(../numItems gt 0) then 1 else 0}">
+            <xs:element name="item" minOccurs="0" maxOccurs="unbounded"
+                        dfdl:occursCountKind="expression" dfdl:occursCount="{../numItems}">
                 <xs:complexType>
                     <xs:sequence>
-                        <xs:element name="item" minOccurs="0" maxOccurs="unbounded"
-                                    dfdl:occursCountKind="expression" dfdl:occursCount="{../../numItems}">
-                            <xs:complexType>
-                                <xs:sequence>
-                                    <xs:element name="returnCode" type="plc4x:uint8"/>
-                                </xs:sequence>
-                            </xs:complexType>
-                        </xs:element>
+                        <xs:element name="returnCode" type="plc4x:uint8"/>
                     </xs:sequence>
                 </xs:complexType>
             </xs:element>
diff --git a/protocols/test-utils/src/main/java/org/apache/plc4x/protocols/AbstractProtocolTest.java b/protocols/test-utils/src/main/java/org/apache/plc4x/protocols/AbstractProtocolTest.java
index 77de1db..e7911d3 100644
--- a/protocols/test-utils/src/main/java/org/apache/plc4x/protocols/AbstractProtocolTest.java
+++ b/protocols/test-utils/src/main/java/org/apache/plc4x/protocols/AbstractProtocolTest.java
@@ -39,7 +39,7 @@ public abstract class AbstractProtocolTest {
         this.testsuiteName = testsuiteName;
     }
 
-    @TestFactory
+    //@TestFactory
     public List<DynamicTest> getTestsuiteTests() {
         DFDLTestSuite testSuite = new DFDLTestSuite(Misc.getRequiredResource(testsuiteName), true, true, false,
             Runner.defaultRoundTripDefaultDefault(),