You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by GitBox <gi...@apache.org> on 2018/09/07 14:33:54 UTC

[GitHub] mbeckerle closed pull request #118: Quick fixes, and moving tests that work from scala-debug.

mbeckerle closed pull request #118: Quick fixes, and moving tests that work from scala-debug.
URL: https://github.com/apache/incubator-daffodil/pull/118
 
 
   

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/build.sbt b/build.sbt
index 57536d3bc..3b26f90da 100644
--- a/build.sbt
+++ b/build.sbt
@@ -91,7 +91,7 @@ lazy val testStdLayout    = Project("daffodil-test-stdLayout", file("test-stdLay
 
 lazy val commonSettings = Seq(
   organization := "org.apache.daffodil",
-  version := "2.2.0",
+  version := "2.3.0-SNAPSHOT",
   scalaVersion := "2.12.6",
   crossScalaVersions := Seq("2.12.6", "2.11.12"),
   scalacOptions ++= Seq(
diff --git a/daffodil-core/src/main/scala/org/apache/daffodil/dsom/RuntimePropertyMixins.scala b/daffodil-core/src/main/scala/org/apache/daffodil/dsom/RuntimePropertyMixins.scala
index 4e34440ae..bffebd93f 100644
--- a/daffodil-core/src/main/scala/org/apache/daffodil/dsom/RuntimePropertyMixins.scala
+++ b/daffodil-core/src/main/scala/org/apache/daffodil/dsom/RuntimePropertyMixins.scala
@@ -365,8 +365,8 @@ trait ElementRuntimeValuedPropertiesMixin
     val res: (LengthUnits, Long) =
       (lengthKind, impliedRepresentation, typeDef.typeNode) match {
         case (Implicit, Binary, HexBinary) => (LengthUnits.Bytes, maxLengthLong) // fixed length
-        case (Implicit, Text, AnySimpleType) => (lengthUnits, textOutputMinLength) // fixed length
         case (Implicit, Text, String) => (lengthUnits, maxLengthLong) // fixed length
+        case (Implicit, Text, AnySimpleType) => (lengthUnits, textOutputMinLength) // fixed length
         case (Explicit, Text, String) => (lengthUnits, minLengthLong)
         case (Explicit, Binary, HexBinary) => (LengthUnits.Bytes, minLengthLong)
         case (Explicit, Text, AnySimpleType) => (lengthUnits, textOutputMinLength)
diff --git a/daffodil-core/src/main/scala/org/apache/daffodil/grammar/ElementBaseGrammarMixin.scala b/daffodil-core/src/main/scala/org/apache/daffodil/grammar/ElementBaseGrammarMixin.scala
index 1373aa952..3c16332ab 100644
--- a/daffodil-core/src/main/scala/org/apache/daffodil/grammar/ElementBaseGrammarMixin.scala
+++ b/daffodil-core/src/main/scala/org/apache/daffodil/grammar/ElementBaseGrammarMixin.scala
@@ -1369,14 +1369,14 @@ trait ElementBaseGrammarMixin
 
     /*
      *  When length kind is explicit, and length is a constant, it is an SDE if
- * the type is a type that uses dfdl:textOutputMinLength, and the length constant
- * is not greater than or equal to that value.
+     * the type is a type that uses dfdl:textOutputMinLength, and the length constant
+     * is not greater than or equal to that value.
      */
 
     val isTypeUsingTextOutputMinLength = typeDef.typeNode match {
       case s: NodeInfo.String.Kind => false
       case s: NodeInfo.HexBinary.Kind => false
-      case s: NodeInfo.AnySimpleType.Kind if (impliedRepresentation eq Representation.Binary) &&
+      case s: NodeInfo.AnySimpleType.Kind if (impliedRepresentation eq Representation.Text) &&
         this.textOutputMinLength > 0 => true
       case _ => false
     }
diff --git a/daffodil-test-ibm1/src/test/resources/test-suite/ibm-contributed/dpaflstrmnum01.dfdl.xsd b/daffodil-test-ibm1/src/test/resources/test-suite/ibm-contributed/dpaflstrmnum01.dfdl.xsd
index 06cb9af74..721bebe36 100644
--- a/daffodil-test-ibm1/src/test/resources/test-suite/ibm-contributed/dpaflstrmnum01.dfdl.xsd
+++ b/daffodil-test-ibm1/src/test/resources/test-suite/ibm-contributed/dpaflstrmnum01.dfdl.xsd
@@ -37,7 +37,8 @@
 				textStandardDecimalSeparator="." textStandardExponentRep="e"
 				textNumberCheckPolicy="lax" textStandardInfinityRep="~"
 				textStandardNaNRep="z" textNumberRoundingMode="roundHalfDown" textNumberRounding="pattern"
-				textStandardZeroRep="" textZonedSignStyle="asciiStandard" escapeSchemeRef=""/>
+				textStandardZeroRep="" textZonedSignStyle="asciiStandard" escapeSchemeRef=""
+                textOutputMinLength="0"/>
 		</xs:appinfo>
 	</xs:annotation>
 
diff --git a/daffodil-test/src/test/resources/org/apache/daffodil/section24/regular_expressions/RegularExpressions.tdml b/daffodil-test/src/test/resources/org/apache/daffodil/section24/regular_expressions/RegularExpressions.tdml
index 7ddff4a74..176b054dc 100644
--- a/daffodil-test/src/test/resources/org/apache/daffodil/section24/regular_expressions/RegularExpressions.tdml
+++ b/daffodil-test/src/test/resources/org/apache/daffodil/section24/regular_expressions/RegularExpressions.tdml
@@ -207,15 +207,11 @@
 
    <tdml:parserTestCase name="testAssertWithPattern1" root="a1"
     model="RegularExpressions-Embedded.dfdl.xsd" 
-    description="Test shows that inside a choice, an assert with pattern expressed on the element definition is not executed.">
+    description="Test shows that inside a choice, an assert with pattern expressed on the element definition must be executed.">
     <tdml:document>1</tdml:document>
-    <tdml:infoset>
-      <tdml:dfdlInfoset>
-         <a1>
-          <data_02>1</data_02>
-        </a1>
-      </tdml:dfdlInfoset>
-    </tdml:infoset>
+    <tdml:errors>
+      <tdml:error>Did not find 1 or 2 or 3</tdml:error>
+    </tdml:errors>
   </tdml:parserTestCase>
 
   <tdml:parserTestCase name="testRegEx_01" root="regExpr_01"
diff --git a/daffodil-test/src/test/scala-debug/org/apache/daffodil/section23/dfdl_expressions/TestDFDLExpressionsDebug.scala b/daffodil-test/src/test/scala-debug/org/apache/daffodil/section23/dfdl_expressions/TestDFDLExpressionsDebug.scala
index 2d2369d39..8d0605f47 100644
--- a/daffodil-test/src/test/scala-debug/org/apache/daffodil/section23/dfdl_expressions/TestDFDLExpressionsDebug.scala
+++ b/daffodil-test/src/test/scala-debug/org/apache/daffodil/section23/dfdl_expressions/TestDFDLExpressionsDebug.scala
@@ -75,9 +75,6 @@ class TestDFDLExpressionsDebug {
   @Test def test_diagnostics_02() { runner.runOneTest("diagnostics_02") }
   @Test def test_diagnostics_03() { runner.runOneTest("diagnostics_03") }
 
-  //DFDL-1221
-  @Test def test_beyondRoot_01() { runner.runOneTest("beyondRoot_01") }
-
   //DFDL-1035 - tests need better diagnostic
   @Test def test_dfdlCheckConstraints() { runner.runOneTest("dfdlCheckConstraints") }
   @Test def test_dfdlCheckConstraints2() { runner.runOneTest("dfdlCheckConstraints2") }
@@ -101,9 +98,6 @@ class TestDFDLExpressionsDebug {
   @Test def test_self_axis_01() { runner.runOneTest("self_axis_01") }
   @Test def test_multiple_axis_01() { runner.runOneTest("multiple_axis_01") }
 
-  //DFDL-711
-  @Test def test_short_parent_axis_01() { runner.runOneTest("short_parent_axis_01") }
-
   //DFDL-1076
   @Test def test_not_04() { runner2.runOneTest("not_04") }
 
diff --git a/daffodil-test/src/test/scala-debug/org/apache/daffodil/section24/regular_expressions/TestRegularExpressionsDebug.scala b/daffodil-test/src/test/scala-debug/org/apache/daffodil/section24/regular_expressions/TestRegularExpressionsDebug.scala
index c9f5e874a..80b0138c9 100644
--- a/daffodil-test/src/test/scala-debug/org/apache/daffodil/section24/regular_expressions/TestRegularExpressionsDebug.scala
+++ b/daffodil-test/src/test/scala-debug/org/apache/daffodil/section24/regular_expressions/TestRegularExpressionsDebug.scala
@@ -41,5 +41,4 @@ class TestRegularExpressionsDebug {
   @Test def test_testRegEx_06() { runner.runOneTest("testRegEx_06") }
   @Test def test_testRegEx_07() { runner.runOneTest("testRegEx_07") }
 
-  @Test def test_assertWithPattern1() { runner.runOneTest("testAssertWithPattern1") }
 }
diff --git a/daffodil-test/src/test/scala/org/apache/daffodil/section12/lengthKind/TestLengthKindExplicit2.scala b/daffodil-test/src/test/scala/org/apache/daffodil/section12/lengthKind/TestLengthKindExplicit2.scala
deleted file mode 100644
index 83c9675cf..000000000
--- a/daffodil-test/src/test/scala/org/apache/daffodil/section12/lengthKind/TestLengthKindExplicit2.scala
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.section12.lengthKind
-
-/*import org.junit.Test */
-import org.apache.daffodil.tdml.Runner
-import org.junit.AfterClass
-
-object TestLengthKindExplicit2 {
-  val testDir = "/org/apache/daffodil/section12/lengthKind/"
-  val runner = Runner(testDir, "ExplicitTests2.tdml")
-
-  @AfterClass def shutDown {
-    runner.reset
-  }
-
-}
-
-class TestLengthKindExplicit2 {
-
-/*  import TestLengthKindExplicit2._ */
-
-}
diff --git a/daffodil-test/src/test/scala/org/apache/daffodil/section23/dfdl_expressions/TestDFDLExpressions.scala b/daffodil-test/src/test/scala/org/apache/daffodil/section23/dfdl_expressions/TestDFDLExpressions.scala
index b237035d3..a4ab3825a 100644
--- a/daffodil-test/src/test/scala/org/apache/daffodil/section23/dfdl_expressions/TestDFDLExpressions.scala
+++ b/daffodil-test/src/test/scala/org/apache/daffodil/section23/dfdl_expressions/TestDFDLExpressions.scala
@@ -41,8 +41,13 @@ object TestDFDLExpressions {
   val runner_fun = Runner(testDir, "functions.tdml")
   val runner5 = Runner(testDir, "valueLength.tdml")
 
+    val testDir6 = "/org/apache/daffodil/section23/dfdl_expressions/"
+  val runner6 = Runner(testDir6, "expressions.tdml")
+
   val runner7 = Runner(testDir, "expressions2.tdml", compileAllTopLevel = true)
 
+
+
   @AfterClass def shutDown() {
     runner4.reset
     runner.reset
@@ -1009,4 +1014,16 @@ class TestDFDLExpressions {
   // DFDL-1804
   @Test def test_traceComplex { runner7.runOneTest("traceComplex") }
 
+  //DFDL-1076
+  @Test def test_nilled_01() { runner2.runOneTest("nilled_01") }
+
+  // DFDL-1617 - should detect errors due to query-style expressions
+  @Test def test_query_style_01 { runner6.runOneTest("query_style_01") }
+  @Test def test_query_style_02 { runner6.runOneTest("query_style_02") }
+
+  //DFDL-1221
+  @Test def test_beyondRoot_01() { runner.runOneTest("beyondRoot_01") }
+
+  //DFDL-711
+  @Test def test_short_parent_axis_01() { runner.runOneTest("short_parent_axis_01") }
 }
diff --git a/daffodil-test/src/test/scala/org/apache/daffodil/section23/dfdl_expressions/TestDFDLExpressionsNew.scala b/daffodil-test/src/test/scala/org/apache/daffodil/section23/dfdl_expressions/TestDFDLExpressionsNew.scala
deleted file mode 100644
index 358cb9596..000000000
--- a/daffodil-test/src/test/scala/org/apache/daffodil/section23/dfdl_expressions/TestDFDLExpressionsNew.scala
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.section23.dfdl_expressions
-
-import org.junit.Test
-import org.apache.daffodil.tdml.Runner
-import org.junit.AfterClass
-
-object TestDFDLExpressionsNew {
-
-  val testDir2 = "/org/apache/daffodil/section23/dfdl_functions/"
-  val runner2 = Runner(testDir2, "Functions.tdml")
-  val testDir5 = "/org/apache/daffodil/section23/dfdl_expressions/"
-  val runner5 = Runner(testDir5, "expressions.tdml")
-  @AfterClass def shutdown = {
-    runner2.reset
-    runner5.reset
-
-  }
-}
-
-class TestDFDLExpressionsNew {
-  import TestDFDLExpressionsNew._
-
-  //DFDL-1076
-  @Test def test_nilled_01() { runner2.runOneTest("nilled_01") }
-
-  // DFDL-1617 - should detect errors due to query-style expressions
-  @Test def test_query_style_01 { runner5.runOneTest("query_style_01") }
-  @Test def test_query_style_02 { runner5.runOneTest("query_style_02") }
-}
diff --git a/daffodil-test/src/test/scala/org/apache/daffodil/section24/regular_expressions/TestRegularExpressions.scala b/daffodil-test/src/test/scala/org/apache/daffodil/section24/regular_expressions/TestRegularExpressions.scala
index 9db7b4f12..ef31df7e4 100644
--- a/daffodil-test/src/test/scala/org/apache/daffodil/section24/regular_expressions/TestRegularExpressions.scala
+++ b/daffodil-test/src/test/scala/org/apache/daffodil/section24/regular_expressions/TestRegularExpressions.scala
@@ -49,4 +49,11 @@ class TestRegularExpressions {
   // @Test def test_testRegEx_05() { runner.runOneTest("testRegEx_05") }
   // @Test def test_testRegEx_06() { runner.runOneTest("testRegEx_06") }
   // @Test def test_testRegEx_07() { runner.runOneTest("testRegEx_07") }
+
+  // DFDL-922
+  @Test def test_testRegEx_08() { runner.runOneTest("testDFDL-922") }
+  @Test def test_testRegEx_09() { runner.runOneTest("testDFDL-922_2") }
+
+  // DAFFODIL-809
+  @Test def test_assertWithPattern1() { runner.runOneTest("testAssertWithPattern1") }
 }
diff --git a/daffodil-test/src/test/scala/org/apache/daffodil/section24/regular_expressions/TestRegularExpressionsNew.scala b/daffodil-test/src/test/scala/org/apache/daffodil/section24/regular_expressions/TestRegularExpressionsNew.scala
deleted file mode 100644
index 237516135..000000000
--- a/daffodil-test/src/test/scala/org/apache/daffodil/section24/regular_expressions/TestRegularExpressionsNew.scala
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.section24.regular_expressions
-
-import org.junit.Test
-import org.apache.daffodil.util._
-import org.apache.daffodil.tdml.DFDLTestSuite
-
-object TestRegularExpressionsNew {
-  val testDir = "/org/apache/daffodil/section24/regular_expressions/"
-  val tdml = testDir + "RegularExpressions.tdml"
-  lazy val runner = new DFDLTestSuite(Misc.getRequiredResource(tdml))
-}
-
-class TestRegularExpressionsNew {
-  import TestRegularExpressionsNew._
-
-  // testDFDL-922
-  @Test def test_testRegEx_08() { runner.runOneTest("testDFDL-922") }
-  @Test def test_testRegEx_09() { runner.runOneTest("testDFDL-922_2") }
-}


 

----------------------------------------------------------------
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@infra.apache.org


With regards,
Apache Git Services