You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by mb...@apache.org on 2018/09/07 14:33:54 UTC
[incubator-daffodil] branch master updated: Quick fixes,
and moving tests that work from scala-debug.
This is an automated email from the ASF dual-hosted git repository.
mbeckerle pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-daffodil.git
The following commit(s) were added to refs/heads/master by this push:
new cd439d1 Quick fixes, and moving tests that work from scala-debug.
cd439d1 is described below
commit cd439d16294a0fc6a23783c3333dd49544d88c95
Author: Michael Beckerle <mb...@tresys.com>
AuthorDate: Thu Aug 16 12:25:22 2018 -0400
Quick fixes, and moving tests that work from scala-debug.
Change release target to version 2.3.0-SNAPSHOT in build.sbt
Consolidate some "...New" test classes that don't need to be
separate classes.
DAFFODIL-1988, DAFFODIL-711, DAFFODIL-1221, DAFFODIL-809
---
build.sbt | 2 +-
.../daffodil/dsom/RuntimePropertyMixins.scala | 2 +-
.../daffodil/grammar/ElementBaseGrammarMixin.scala | 6 +--
.../ibm-contributed/dpaflstrmnum01.dfdl.xsd | 3 +-
.../regular_expressions/RegularExpressions.tdml | 12 ++----
.../TestDFDLExpressionsDebug.scala | 6 ---
.../TestRegularExpressionsDebug.scala | 1 -
.../lengthKind/TestLengthKindExplicit2.scala | 38 ------------------
.../dfdl_expressions/TestDFDLExpressions.scala | 17 ++++++++
.../dfdl_expressions/TestDFDLExpressionsNew.scala | 46 ----------------------
.../TestRegularExpressions.scala | 7 ++++
.../TestRegularExpressionsNew.scala | 36 -----------------
12 files changed, 35 insertions(+), 141 deletions(-)
diff --git a/build.sbt b/build.sbt
index 57536d3..3b26f90 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 4e34440..bffebd9 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 1373aa9..3c16332 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 06cb9af..721bebe 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 7ddff4a..176b054 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 2d2369d..8d0605f 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 c9f5e87..80b0138 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 83c9675..0000000
--- 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 b237035..a4ab382 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 358cb95..0000000
--- 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 9db7b4f..ef31df7 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 2375161..0000000
--- 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") }
-}