git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] stevedlawrence closed pull request #67: Add test showing inability to read data after a layer


stevedlawrence closed pull request #67: Add test showing inability to read data after a layer
URL: https://github.com/apache/incubator-daffodil/pull/67
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/daffodil-test/src/test/resources/org/apache/daffodil/layers/layers.tdml b/daffodil-test/src/test/resources/org/apache/daffodil/layers/layers.tdml
index c5027c7b9..91beae008 100644
--- a/daffodil-test/src/test/resources/org/apache/daffodil/layers/layers.tdml
+++ b/daffodil-test/src/test/resources/org/apache/daffodil/layers/layers.tdml
@@ -253,5 +253,50 @@ xxx]]></tdml:documentPart>
       <tdml:error>separator</tdml:error>
     </tdml:errors>
   </tdml:parserTestCase>
+  
+  <tdml:defineSchema name="s4" elementFormDefault="unqualified">
+    <dfdl:defineFormat name="general">
+      <dfdl:format ref="ex:GeneralFormat" lengthKind="delimited" outputNewLine="%CR;%LF;" />
+    </dfdl:defineFormat>
+    <dfdl:defineFormat name="folded">
+      <dfdl:format ref="ex:general" layerTransform="lineFolded_IMF" layerLengthKind="implicit" layerLengthUnits="bytes"
+        layerEncoding="iso-8859-1" />
+    </dfdl:defineFormat>
+    <dfdl:format ref="ex:general" />
+
+    <xs:element name="root">
+      <xs:complexType>
+        <xs:sequence>
+          <xs:sequence dfdl:ref="folded">
+            <xs:element name="header" dfdl:terminator="%CR;%LF;%CR;%LF;">
+              <xs:complexType>
+                <xs:sequence dfdl:separator="%CR;%LF;">
+                  <xs:element name="field" type="xs:string" maxOccurs="unbounded" />
+                </xs:sequence>
+              </xs:complexType>
+            </xs:element>
+          </xs:sequence>
+          <xs:element name="body" type="xs:string" dfdl:initiator="" />
+        </xs:sequence>
+      </xs:complexType>
+    </xs:element>
+  </tdml:defineSchema>
+
+  <tdml:parserTestCase name="layers4" root="root" model="s4" roundTrip="true">
+    <tdml:document>
+      <tdml:documentPart type="text" replaceDFDLEntities="true"><![CDATA[this is%CR;%LF; folded one%CR;%LF;this%CR;%LF; is folded two%CR;%LF;%CR;%LF;this is the body]]></tdml:documentPart>
+    </tdml:document>
+    <tdml:infoset>
+      <tdml:dfdlInfoset>
+        <ex:root>
+          <header>
+            <field>this is folded one</field>
+            <field>this is folded two</field>
+          </header>
+          <body>this is the body</body>
+        </ex:root>
+      </tdml:dfdlInfoset>
+    </tdml:infoset>
+  </tdml:parserTestCase>
 
-</tdml:testSuite>
\ No newline at end of file
+</tdml:testSuite>
diff --git a/daffodil-test/src/test/scala-debug/org/apache/daffodil/layers/TestLayersDebug.scala b/daffodil-test/src/test/scala-debug/org/apache/daffodil/layers/TestLayersDebug.scala
new file mode 100644
index 000000000..85c6b9a22
--- /dev/null
+++ b/daffodil-test/src/test/scala-debug/org/apache/daffodil/layers/TestLayersDebug.scala
@@ -0,0 +1,43 @@
+/*
+ * 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.layers
+
+/* This section00 is for testing general features of DFDL that are
+ * not related to any specific requirement
+ */
+
+import org.junit.Test
+import org.apache.daffodil.tdml.Runner
+import org.junit.AfterClass
+
+object TestLayersDebug {
+  lazy val testDir = "/org/apache/daffodil/layers/"
+  lazy val runner = Runner(testDir, "layers.tdml")
+
+  @AfterClass def shutDown() {
+    runner.reset
+  }
+}
+
+class TestLayersDebug {
+
+  import TestLayersDebug._
+
+  @Test def test_layers4() { runner.runOneTest("layers4") }
+
+}
diff --git a/daffodil-test/src/test/scala/org/apache/daffodil/layers/TestLayers.scala b/daffodil-test/src/test/scala/org/apache/daffodil/layers/TestLayers.scala
index 0f9752db7..1bc15d02c 100644
--- a/daffodil-test/src/test/scala/org/apache/daffodil/layers/TestLayers.scala
+++ b/daffodil-test/src/test/scala/org/apache/daffodil/layers/TestLayers.scala
@@ -43,4 +43,7 @@ class TestLayers {
   @Test def test_layers3() { runner.runOneTest("layers3") }
   @Test def test_layersErr1() { runner.runOneTest("layersErr1") }
 
+  // DAFFODIL-1934
+  //@Test def test_layers4() { runner.runOneTest("layers4") }
+
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@xxxxxxxxxxxxxxxx


With regards,
Apache Git Services