This is an automated email from the ASF dual-hosted git repository.
slawrence 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 55c2206 Update all dependencies to latest versions
55c2206 is described below
commit 55c220683b0fc442586044e3b84f83919f76a19b
Author: Steve Lawrence <[email protected]>
AuthorDate: Fri Oct 23 12:16:06 2020 -0400
Update all dependencies to latest versions
- Updated all dependencies to match the latest and verified that no
dependencies have license changes that affect usage
- Fix deprecation warnings with Apache Commons NullOutputStream
- New ICU version fixed some issues and changes some behaviors. It now
correctly unparses INF, -INF, and NaN according to the inf/nan rep
properties so we do not need to manually handle that. It now also
correctly obeys optional decimal points in some patterns. When
unparsing, it also now rounds floating point numbers if the pattern
does not contain decimal separators. Tests added to verify this
behavior in case it changes again.
- Updates sbt to latest version, which now requires testOptions to
maintain current test output behavior
- This does exclude updates to the latest scala 2.12.x version, there is
a issue related to serialization
- Remove TestDaffodilXMLResolver tests. These tests are not thread-safe
and the new sbt version seems to cause these error to crop up more. If
we do need this functionality tested, we should add an alterantive
method (see DAFFODIL-2424).
DAFFODIL-2269
---
.gitignore | 1 +
build.sbt | 8 +-
containers/release-candidate/setup-container.sh | 2 +-
daffodil-cli/bin.LICENSE | 12 +-
daffodil-cli/bin.NOTICE | 24 +-
.../src/main/scala/org/apache/daffodil/Main.scala | 30 +-
.../org/apache/daffodil/infoset/TestInfoset.scala | 2 +-
.../scala/org/apache/daffodil/util/TestUtils.scala | 43 +--
.../unparsers/ConvertTextNumberUnparser.scala | 15 -
.../apache/daffodil/processors/input/TestICU.scala | 26 +-
.../text_number_props/TextNumberProps.tdml | 30 +-
.../calc_value_properties/outputValueCalc2.tdml | 2 +-
.../text_number_props/TestTextNumberProps.scala | 1 +
.../xml/test/unit/TestDaffodilXMLLoader.scala | 382 ---------------------
project/Dependencies.scala | 18 +-
project/build.properties | 2 +-
16 files changed, 107 insertions(+), 491 deletions(-)
diff --git a/.gitignore b/.gitignore
index f1c623d..65b4c1d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,6 +18,7 @@
# in the Daffodil source tree.
#
*.sbt
+.bsp/
!build.sbt
.cache-main
.cache-tests
diff --git a/build.sbt b/build.sbt
index cfa1542..80cb91f 100644
--- a/build.sbt
+++ b/build.sbt
@@ -146,7 +146,8 @@ lazy val commonSettings = Seq(
sourceManaged := baseDirectory.value / "src_managed",
resourceManaged := baseDirectory.value / "resource_managed",
libraryDependencies ++= Dependencies.common,
- parallelExecution in IntegrationTest := false
+ parallelExecution in IntegrationTest := false,
+ testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v"),
) ++ Defaults.itSettings
def scalacCrossOptions(scalaVersion: String) =
@@ -177,6 +178,7 @@ lazy val libManagedSettings = Seq(
genManaged := {
(genProps in Compile).value
(genSchemas in Compile).value
+ ()
},
genProps in Compile := {
val cp = (dependencyClasspath in Runtime in propgen).value
@@ -200,7 +202,7 @@ lazy val libManagedSettings = Seq(
val br = new java.io.BufferedReader(isr)
val iterator = Iterator.continually(br.readLine()).takeWhile(_ != null)
val files = iterator.map { f =>
- stream.log.info("Generated %s".format(f))
+ stream.log.info("generated %s".format(f))
new File(f)
}.toSet
files
@@ -216,7 +218,7 @@ lazy val libManagedSettings = Seq(
schemas.map { schema =>
val out = outdir / "org" / "apache" / "daffodil" / "xsd" /
schema.getName
IO.copyFile(schema, out)
- stream.log.info("Generated %s".format(out))
+ stream.log.info("generated %s".format(out))
out
}
}
diff --git a/containers/release-candidate/setup-container.sh
b/containers/release-candidate/setup-container.sh
index 004f4ca..7b747be 100755
--- a/containers/release-candidate/setup-container.sh
+++ b/containers/release-candidate/setup-container.sh
@@ -40,6 +40,6 @@ sh -c "echo 'addSbtPlugin(\"com.jsuereth\" % \"sbt-pgp\" %
\"2.0.1\")' >> /root/
TMP_SBT_PROJECT=/tmp/sbt-project/
mkdir -p $TMP_SBT_PROJECT
pushd $TMP_SBT_PROJECT &> /dev/null
-sbt --sbt-version 1.3.9 exit
+sbt --sbt-version 1.4.1 exit
popd &> /dev/null
rm -rf $TMP_SBT_PROJECT
diff --git a/daffodil-cli/bin.LICENSE b/daffodil-cli/bin.LICENSE
index f104e28..a235878 100644
--- a/daffodil-cli/bin.LICENSE
+++ b/daffodil-cli/bin.LICENSE
@@ -283,14 +283,14 @@ subcomponents is subject to the terms and conditions of
the following licenses.
copyright holders.
This product bundles 'ICU4J', including the following files:
- - lib/com.ibm.icu.icu4j-62.1.jar
+ - lib/com.ibm.icu.icu4j-67.1.jar
These files are available under the Unicode License. For details, see
-
https://ssl.icu-project.org/repos/icu/tags/release-62-1/icu4j/main/shared/licenses/LICENSE
+ https://github.com/unicode-org/icu/blob/release-67-1/icu4c/LICENSE
COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later)
- Copyright © 1991-2018 Unicode, Inc. All rights reserved.
- Distributed under the Terms of Use in
http://www.unicode.org/copyright.html.
+ Copyright © 1991-2020 Unicode, Inc. All rights reserved.
+ Distributed under the Terms of Use in
https://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
@@ -796,7 +796,7 @@ subcomponents is subject to the terms and conditions of the
following licenses.
OF THE POSSIBILITY OF SUCH DAMAGE.
This product bundles 'Scallop', including the following files:
- - lib/org.rogach.scallop_2.12-3.1.3.jar
+ - lib/org.rogach.scallop_2.12-3.5.1.jar
These files are available under under an MIT License. For details, see
https://github.com/scallop/scallop/blob/develop/license.txt
@@ -821,7 +821,7 @@ subcomponents is subject to the terms and conditions of the
following licenses.
SOFTWARE.
This product product bundles 'Stax 2 API', including the following files:
- - lib/org.codehaus.woodstox.stax2-api-4.1.jar
+ - lib/org.codehaus.woodstox.stax2-api-4.2.1.jar
These files are available under the BSD-2-Clause license:
Copyright 2010- FasterXML.com
diff --git a/daffodil-cli/bin.NOTICE b/daffodil-cli/bin.NOTICE
index 66d9b5a..6cfa3fe 100644
--- a/daffodil-cli/bin.NOTICE
+++ b/daffodil-cli/bin.NOTICE
@@ -11,9 +11,16 @@ Based on source code originally developed by
The following NOTICE information applies to binary components distributed with
this project:
+Apache Commons IO (lib/commons-io.commons-io-2.8.0.jar)
+ Apache Commons IO
+ Copyright 2002-2020 The Apache Software Foundation
+
+ This product includes software developed at
+ The Apache Software Foundation (https://www.apache.org/).
+
Apache Xerces Java (lib/xerces.xercesImpl-2.12.0.jar)
Apache Xerces Java
- Copyright 1999-2010 The Apache Software Foundation
+ Copyright 1999-2018 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
@@ -60,7 +67,7 @@ Jansi (lib/org.fusesource.jansi.jansi-1.17.1.jar)
Copyright (C) 2009, Progress Software Corporation and/or its
subsidiaries or affiliates. All rights reserved.
-Jackson JSON processor (lib/com.fasterxml.jackson.core.jackson-core-2.10.2.jar)
+Jackson JSON processor (lib/com.fasterxml.jackson.core.jackson-core-2.11.3.jar)
# Jackson JSON processor
Jackson is a high-performance, Free/Open Source JSON processing library.
@@ -84,7 +91,7 @@ Jackson JSON processor
(lib/com.fasterxml.jackson.core.jackson-core-2.10.2.jar)
Scala (lib/org.scala-lang.scala-library-2.12.11.jar)
(org/apache/daffodil/util/UniquenessCache.class in
lib/org.apache.daffodil.daffodil-lib-<VERSION>.jar)
- Scala parser combinators
+ Scala
Copyright (c) 2002-2020 EPFL
Copyright (c) 2011-2020 Lightbend, Inc.
@@ -97,7 +104,7 @@ Scala (lib/org.scala-lang.scala-library-2.12.11.jar)
and can be found in:
daffodil-lib/src/main/scala/org/apache/daffodil/util/UniquenessCache.scala
-Scala Parser Combinators
(lib/org.scala-lang.modules.scala-parser-combinators_2.12-1.1.1.jar)
+Scala Parser Combinators
(lib/org.scala-lang.modules.scala-parser-combinators_2.12-1.1.2.jar)
Scala parser combinators
Copyright (c) 2002-2020 EPFL
Copyright (c) 2011-2020 Lightbend, Inc.
@@ -106,7 +113,7 @@ Scala Parser Combinators
(lib/org.scala-lang.modules.scala-parser-combinators_2.
LAMP/EPFL (https://lamp.epfl.ch/) and
Lightbend, Inc. (https://www.lightbend.com/).
-Scala XML (lib/org.scala-lang.modules.scala-xml_2.12-1.1.0.jar)
+Scala XML (lib/org.scala-lang.modules.scala-xml_2.12-1.3.0.jar)
scala-xml
Copyright (c) 2002-2020 EPFL
Copyright (c) 2011-2020 Lightbend, Inc.
@@ -114,10 +121,3 @@ Scala XML
(lib/org.scala-lang.modules.scala-xml_2.12-1.1.0.jar)
scala-xml includes software developed at
LAMP/EPFL (https://lamp.epfl.ch/) and
Lightbend, Inc. (https://www.lightbend.com/).
-
-Woodstox (lib/com.fasterxml.woodstox.woodstox-core-5.1.0.jar)
- This product currently only contains code developed by authors
- of specific components, as identified by the source code files.
-
- Since product implements StAX API, it has dependencies to StAX API
- classes.
diff --git a/daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
b/daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
index 66c57d4..4f06c9a 100644
--- a/daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
+++ b/daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
@@ -22,7 +22,6 @@ import java.io.File
import java.io.FileInputStream
import java.io.FileOutputStream
import java.io.InputStream
-import java.io.OutputStream
import java.net.URI
import java.nio.ByteBuffer
import java.nio.channels.Channels
@@ -42,7 +41,10 @@ import javax.xml.parsers.DocumentBuilderFactory
import javax.xml.transform.TransformerFactory
import javax.xml.transform.dom.DOMSource
import javax.xml.transform.stream.StreamResult
+
import org.apache.commons.io.IOUtils
+import org.apache.commons.io.output.NullOutputStream
+
import org.apache.daffodil.api.DFDL
import org.apache.daffodil.api.DFDL.ParseResult
import org.apache.daffodil.api.DaffodilTunables
@@ -102,24 +104,6 @@ import org.rogach.scallop.ArgType
import org.rogach.scallop.ScallopOption
import org.rogach.scallop.ValueConverter
-class NullOutputStream extends OutputStream {
- override def close(): Unit = {
- //do nothing
- }
- override def flush(): Unit = {
- //do nothing
- }
- override def write(b: Array[Byte]): Unit = {
- //do nothing
- }
- override def write(b: Array[Byte], off: Int, len: Int): Unit = {
- //do nothing
- }
- override def write(b: Int): Unit = {
- //do nothing
- }
-}
-
class CommandLineSAXErrorHandler() extends org.xml.sax.ErrorHandler with
Logging {
def warning(exception: SAXParseException) = {
@@ -1099,11 +1083,11 @@ object Main extends Logging {
}
}
- val nullChannelForUnparse =
java.nio.channels.Channels.newChannel(new NullOutputStream)
- val nullOutputStreamForParse = new NullOutputStream()
+ val nullChannelForUnparse =
Channels.newChannel(NullOutputStream.NULL_OUTPUT_STREAM)
+ val nullOutputStreamForParse = NullOutputStream.NULL_OUTPUT_STREAM
//the following line allows output verification
- //val nullChannelForUnparse =
java.nio.channels.Channels.newChannel(System.out)
+ //val nullChannelForUnparse = Channels.newChannel(System.out)
val NSConvert = 1000000000.0
val (totalTime, results) = Timer.getTimeResult({
val tasks = inputsWithIndex.map {
@@ -1190,7 +1174,7 @@ object Main extends Logging {
case Some(file) => new FileOutputStream(file)
}
- val outChannel = java.nio.channels.Channels.newChannel(output)
+ val outChannel = Channels.newChannel(output)
//
// We are not loading a schema here, we're loading the infoset to
unparse.
//
diff --git
a/daffodil-core/src/test/scala/org/apache/daffodil/infoset/TestInfoset.scala
b/daffodil-core/src/test/scala/org/apache/daffodil/infoset/TestInfoset.scala
index 901a508..249df7d 100644
--- a/daffodil-core/src/test/scala/org/apache/daffodil/infoset/TestInfoset.scala
+++ b/daffodil-core/src/test/scala/org/apache/daffodil/infoset/TestInfoset.scala
@@ -61,7 +61,7 @@ object TestInfoset {
// what maintains the schema dynamic runtime context.
//
val inputter = new ScalaXMLInfosetInputter(xmlElem)
- val dummyOutStream = new NullOutputStream
+ val dummyOutStream = NullOutputStream.NULL_OUTPUT_STREAM
val unparseResult = dp.unparse(inputter, dummyOutStream)
val infosetRootNode = {
val ustate = unparseResult.resultState.asInstanceOf[UStateMain]
diff --git
a/daffodil-core/src/test/scala/org/apache/daffodil/util/TestUtils.scala
b/daffodil-core/src/test/scala/org/apache/daffodil/util/TestUtils.scala
index df9ade1..c1cfdec 100644
--- a/daffodil-core/src/test/scala/org/apache/daffodil/util/TestUtils.scala
+++ b/daffodil-core/src/test/scala/org/apache/daffodil/util/TestUtils.scala
@@ -17,33 +17,36 @@
package org.apache.daffodil.util
-import scala.xml._
-import org.apache.daffodil.xml.XMLUtils
import java.io.File
import java.io.FileNotFoundException
-
-import org.apache.daffodil.Implicits._
-import org.apache.daffodil.grammar.VariableMapFactory
-object INoWarnU2 { ImplicitsSuppressUnusedImportWarning() }
-import org.apache.daffodil.compiler.Compiler
+import java.nio.channels.Channels
import java.nio.channels.ReadableByteChannel
+import java.nio.channels.WritableByteChannel
+
+import scala.util.Try
+import scala.xml._
+
+import org.apache.commons.io.output.NullOutputStream
+
import org.junit.Assert.assertEquals
-import org.apache.daffodil.dsom._
-import org.apache.daffodil.xml._
-import org.apache.daffodil.api._
-import org.apache.daffodil.externalvars.Binding
+
+import org.apache.daffodil.Implicits._; object INoWarnU2 {
ImplicitsSuppressUnusedImportWarning() }
import org.apache.daffodil.api.DFDL
-import org.apache.daffodil.processors.DataProcessor
+import org.apache.daffodil.api._
+import org.apache.daffodil.compiler.Compiler
import org.apache.daffodil.debugger._
-import java.nio.channels.Channels
-import org.apache.daffodil.processors.VariableMap
-import org.apache.daffodil.infoset.ScalaXMLInfosetOutputter
-import org.apache.daffodil.infoset.ScalaXMLInfosetInputter
-import org.apache.daffodil.infoset.InfosetOutputter
+import org.apache.daffodil.dsom._
+import org.apache.daffodil.externalvars.Binding
+import org.apache.daffodil.grammar.VariableMapFactory
import org.apache.daffodil.infoset.InfosetInputter
+import org.apache.daffodil.infoset.InfosetOutputter
+import org.apache.daffodil.infoset.ScalaXMLInfosetInputter
+import org.apache.daffodil.infoset.ScalaXMLInfosetOutputter
import org.apache.daffodil.io.InputSourceDataInputStream
-import java.nio.channels.WritableByteChannel
-import scala.util.Try
+import org.apache.daffodil.processors.DataProcessor
+import org.apache.daffodil.processors.VariableMap
+import org.apache.daffodil.xml.XMLUtils
+import org.apache.daffodil.xml._
/*
* This is not a file of tests.
@@ -251,7 +254,7 @@ object TestUtils {
}
def testCompileTime(resourcePathString: String): Unit = {
- val nos = new org.apache.commons.io.output.NullOutputStream()
+ val nos = NullOutputStream.NULL_OUTPUT_STREAM
val nullChannel = java.nio.channels.Channels.newChannel(nos)
val compiler = Compiler()
val uri = Misc.getRequiredResource(resourcePathString)
diff --git
a/daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/ConvertTextNumberUnparser.scala
b/daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/ConvertTextNumberUnparser.scala
index 1f9f641..ec0e045 100644
---
a/daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/ConvertTextNumberUnparser.scala
+++
b/daffodil-runtime1-unparser/src/main/scala/org/apache/daffodil/processors/unparsers/ConvertTextNumberUnparser.scala
@@ -17,9 +17,6 @@
package org.apache.daffodil.processors.unparsers
-import java.lang.{ Double => JDouble }
-import java.lang.{ Float => JFloat }
-
import org.apache.daffodil.processors._
import org.apache.daffodil.util.Maybe
import org.apache.daffodil.processors.TextNumberFormatEv
@@ -67,18 +64,6 @@ case class ConvertTextNumberUnparser(
val strRep = value.getAnyRef match {
case n: Number if n == 0 && zeroRep.isDefined => zeroRep.get
- // We need to special case infinity and NaN because ICU4J has a bug and
- // will add an exponent to inf/nan (e.g. INFx10^0) if defined in the
- // pattern, which we don't want. We need to manually output the inf/nan
- // rep plus the prefix and suffix
- case f: JFloat if f.isInfinite =>
- if (f > 0) df.getPositivePrefix + dfs.getInfinity +
df.getPositiveSuffix
- else df.getNegativePrefix + dfs.getInfinity + df.getNegativeSuffix
- case f: JFloat if f.isNaN => dfs.getNaN
- case d: JDouble if d.isInfinite =>
- if (d > 0) df.getPositivePrefix + dfs.getInfinity +
df.getPositiveSuffix
- else df.getNegativePrefix + dfs.getInfinity + df.getNegativeSuffix
- case d: JDouble if d.isNaN => dfs.getNaN
case _ =>
try {
df.format(value.getAnyRef)
diff --git
a/daffodil-runtime1/src/test/scala/org/apache/daffodil/processors/input/TestICU.scala
b/daffodil-runtime1/src/test/scala/org/apache/daffodil/processors/input/TestICU.scala
index afc0ddb..79633d7 100644
---
a/daffodil-runtime1/src/test/scala/org/apache/daffodil/processors/input/TestICU.scala
+++
b/daffodil-runtime1/src/test/scala/org/apache/daffodil/processors/input/TestICU.scala
@@ -66,14 +66,14 @@ class TestICU {
r.foreach(parseFractionalSeconds)
}
- // The three following tests show an ICU bug where if the decimal pattern
+ // The three following tests show an old ICU bug where if the decimal pattern
// uses scientific notation and the number to format/unparse is positive
- // infinity, negative infinity, or not a number, ICU still includes the
- // exponent separator when it shouldn't. We currently work around this in
- // Daffodil by handling INF, -INF, and NaN ourselves. If ICU a subsequent
- // release of ICU fixes this issue, these tests should fail and we can remove
- // the code that manually converts these values to strings. The real expected
- // values are commented at the end of each function.
+ // infinity, negative infinity, or not a number, ICU would include the
+ // exponent separator when it shouldn't. We used to work around this in
+ // Daffodil by handling INF, -INF, and NaN ourselves. As of ICU 67.1, this
+ // bug appears to be fixed. These tests are kept around to ensure ICU does
+ // not have a regression of this issue. The old broken values that ICU would
+ // create are commented out to show what used to be broken.
@Test def test_scientific_pos_inf = {
val dfs = new DecimalFormatSymbols()
@@ -83,8 +83,8 @@ class TestICU {
val df = new DecimalFormat("000.0#E0", dfs)
val posInf = java.lang.Double.POSITIVE_INFINITY
val str = df.format(posInf)
- assertEquals("INFx10^0", str)
- //assertEquals("INF", str)
+ //assertEquals("INFx10^0", str)
+ assertEquals("INF", str)
}
@Test def test_scientific_neg_inf = {
@@ -95,8 +95,8 @@ class TestICU {
val df = new DecimalFormat("000.0#E0", dfs)
val negInf = java.lang.Double.NEGATIVE_INFINITY
val str = df.format(negInf)
- assertEquals("-INFx10^0", str)
- //assertEquals("-INF", str)
+ //assertEquals("-INFx10^0", str)
+ assertEquals("-INF", str)
}
@Test def test_scientific_nan = {
@@ -107,8 +107,8 @@ class TestICU {
val df = new DecimalFormat("000.0#E0", dfs)
val nan = java.lang.Double.NaN
val str = df.format(nan)
- assertEquals("NaNx10^0", str)
- //assertEquals("NaN", str)
+ //assertEquals("NaNx10^0", str)
+ assertEquals("NaN", str)
}
// The following test shows that ICU does not reqiure a positive pattern.
diff --git
a/daffodil-test/src/test/resources/org/apache/daffodil/section13/text_number_props/TextNumberProps.tdml
b/daffodil-test/src/test/resources/org/apache/daffodil/section13/text_number_props/TextNumberProps.tdml
index c731f02..230ef20 100644
---
a/daffodil-test/src/test/resources/org/apache/daffodil/section13/text_number_props/TextNumberProps.tdml
+++
b/daffodil-test/src/test/resources/org/apache/daffodil/section13/text_number_props/TextNumberProps.tdml
@@ -4267,15 +4267,15 @@
</tdml:parserTestCase>
<!--
- Test Name: textStandardFloatPatternNoSeparators
+ Test Name: textStandardFloatPatternNoSeparators1
Schema: textNumberPattern
Root: tnp96
- Purpose: This test shows what even if the textNumberPattern contains
+ Purpose: This test shows that even if the textNumberPattern contains
no grouping/decimal separators, we still require and use the
- properties because ICU uses them for non-integer types
+ properties because ICU uses them when parsing non-integer types
-->
- <tdml:parserTestCase name="textStandardFloatPatternNoSeparators1"
root="tnp96" model="textNumberPattern">
+ <tdml:parserTestCase name="textStandardFloatPatternNoSeparators1"
root="tnp96" model="textNumberPattern" roundTrip="none">
<tdml:document>
<tdml:documentPart type="text">10,1</tdml:documentPart>
@@ -4288,4 +4288,26 @@
</tdml:parserTestCase>
+ <!--
+ Test Name: textStandardFloatPatternNoSeparators2
+ Schema: textNumberPattern
+ Root: tnp96
+ Purpose: This test shows that when the textNumberPattern contains
+ no grouping/decimal separators, when unparsing, ICU will round the
+ result to match the pattern.
+ -->
+
+ <tdml:unparserTestCase name="textStandardFloatPatternNoSeparators2"
root="tnp96" model="textNumberPattern" roundTrip="none">
+
+ <tdml:document>
+ <tdml:documentPart type="text">11</tdml:documentPart>
+ </tdml:document>
+ <tdml:infoset>
+ <tdml:dfdlInfoset>
+ <tnp96>10.9</tnp96>
+ </tdml:dfdlInfoset>
+ </tdml:infoset>
+
+ </tdml:unparserTestCase>
+
</tdml:testSuite>
diff --git
a/daffodil-test/src/test/resources/org/apache/daffodil/section17/calc_value_properties/outputValueCalc2.tdml
b/daffodil-test/src/test/resources/org/apache/daffodil/section17/calc_value_properties/outputValueCalc2.tdml
index dd8ed02..d71c610 100644
---
a/daffodil-test/src/test/resources/org/apache/daffodil/section17/calc_value_properties/outputValueCalc2.tdml
+++
b/daffodil-test/src/test/resources/org/apache/daffodil/section17/calc_value_properties/outputValueCalc2.tdml
@@ -494,7 +494,7 @@
</tdml:dfdlInfoset>
</tdml:infoset>
<tdml:document>
- <tdml:documentPart type="text">XYZ5.0X038.0Y41.23Z008</tdml:documentPart>
+ <tdml:documentPart type="text">XYZ5X038.0Y41.23Z008</tdml:documentPart>
</tdml:document>
</tdml:unparserTestCase>
diff --git
a/daffodil-test/src/test/scala/org/apache/daffodil/section13/text_number_props/TestTextNumberProps.scala
b/daffodil-test/src/test/scala/org/apache/daffodil/section13/text_number_props/TestTextNumberProps.scala
index 8f5ef1a..64be5d0 100644
---
a/daffodil-test/src/test/scala/org/apache/daffodil/section13/text_number_props/TestTextNumberProps.scala
+++
b/daffodil-test/src/test/scala/org/apache/daffodil/section13/text_number_props/TestTextNumberProps.scala
@@ -239,4 +239,5 @@ class TestTextNumberProps {
@Test def test_textStandardDistinctValues3(): Unit = {
runner.runOneTest("textStandardDistinctValues3") }
@Test def test_textStandardFloatPatternNoSeparators1(): Unit = {
runner.runOneTest("textStandardFloatPatternNoSeparators1") }
+ @Test def test_textStandardFloatPatternNoSeparators2(): Unit = {
runner.runOneTest("textStandardFloatPatternNoSeparators2") }
}
diff --git
a/daffodil-test/src/test/scala/org/apache/daffodil/xml/test/unit/TestDaffodilXMLLoader.scala
b/daffodil-test/src/test/scala/org/apache/daffodil/xml/test/unit/TestDaffodilXMLLoader.scala
deleted file mode 100644
index c711f80..0000000
---
a/daffodil-test/src/test/scala/org/apache/daffodil/xml/test/unit/TestDaffodilXMLLoader.scala
+++ /dev/null
@@ -1,382 +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.xml.test.unit
-
-import scala.xml._
-import org.apache.daffodil.xml.XMLUtils
-import org.apache.daffodil.xml.DaffodilXMLLoader
-import org.junit.Assert._
-import org.junit.Test
-import java.io.File
-import org.apache.daffodil.Implicits._
-import org.apache.daffodil.util.Misc
-import org.apache.daffodil.api.URISchemaSource
-
-/**
- * This unit test cannot be in the regular daffodil-core library due
- * to needing to populate a file into a directory that is on the
- * classpath.
- *
- * In daffodil-test there is no problem with us creating such a
- * directory dynamically, and having it be on the classpath of the
- * project. At least under Eclipse anyway.
- *
- * TODO: is the above a security hole? If so, is there a better way
- * to test this? Do we have to make a whole separate project just
- * to test this?
- */
-class TestDaffodilXMLLoader {
-
- /**
- * This test makes sure that a CatalogManager.properties file
- * will be read and catalogs it specifies will be loaded and used.
- *
- * It tests this by validating some data that is invalid with respect
- * to a schema supplied by way of the CatalogManager.properties file.
- *
- * If the error is detected, then it must have found and used the
- * user-specified catalog.
- */
- @Test def testThisTestRig(): Unit = {
-
- // LoggingDefaults.setLoggingLevel(LogLevel.Debug)
-
- val test = new CatalogTestBase {
-
- override val testCatalog = <catalog
xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
- <uri name="foobar" uri={
tmpSchemaFileName.getAbsolutePath }/>
- </catalog>
-
- // The '5' for line should cause a validation error because it doesn't
match
- // the 'A' enum in the schema.
- val testData =
- <onlyAnAWillDo xmlns="foobar">5</onlyAnAWillDo>
-
- val testSchema =
- <schema xmlns={ xsd } targetNamespace="foobar" xmlns:xsd={ xsd }>
- <!-- in our internal schema line is an int, in this schema it is a
string.
- So if our internal schema is being used, a validation against
that will cause an error
- for anything that doesn't obey the syntax of an int. So we want
to demonstrate
- that we get that error.
- -->
- <xsd:element name="onlyAnAWillDo">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="A"/>
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:element>
- </schema>
-
- override def runTest(): Boolean = {
- if (!super.runTest()) {
- System.err.println("test skipped.")
- return false
- }
- // but when it has to resolve our dafint namespace, we don't want it
to take the
- // one we created here, rather we want it to take our internal one.
- val excs = exceptionList
-
- println(excs)
- //
- // Now, our internal dafint schema requires the line attribute to be a
- // xs:int, so using 'A' above means we should get an error on the line
attribute.
- //
- // these checks pass if we got an error complaining about the 'line'
- //
- assertTrue(excs.length >= 1)
- // check that we got an error message complaining about the element.
- val hasError = excs.exists { _.getMessage().contains("onlyAnAWillDo") }
- assertTrue(hasError)
- true
- }
- }
-
- test.runTest
- }
-
- /**
- * This test insures that a user catalog doesn't get priority over
- * our internal catalog by defining a catalog and schema that uses
- * one of our namespaces.
- *
- * Our dafint.xsd defines testElement and the line and col attributes
- * must be type xs:int. The data here has dafint:line with value 'A',
- * so if the built-in schema is used, it will find this error. So the
- * test passes if the error is detected.
- */
- @Test def testThatUserCatalogCannotOverrideDaffodilInternalCatalog1(): Unit
= {
-
- // LoggingDefaults.setLoggingLevel(LogLevel.Debug)
-
- val test = new CatalogTestBase {
-
- // The 'A' for line should cause a validation error if it is using our
internal schema
- // We want an error, becasue we want it using our internal catalog, not
the user supplied one.
- val testData =
- <dafint:testElement xmlns={ ns } xmlns:dafint={ ns } dafint:line="A"
dafint:col="6">5</dafint:testElement>
-
- val testSchema =
- <schema xmlns={ xsd } targetNamespace={ ns } xmlns:dafint={ ns }
xmlns:xsd={ xsd }>
- <!-- in our internal schema line is an int, in this schema it is a
string.
- So if our internal schema is being used, a validation against
that will cause an error
- for anything that doesn't obey the syntax of an int. So we want
to demonstrate
- that we get that error.
- -->
- <attribute name="line" type="xsd:string"/>
- <attribute name="col" type="xsd:string"/>
- <element name="testElement">
- <complexType>
- <simpleContent>
- <extension base="xsd:integer">
- <attribute ref="dafint:line"/>
- <attribute ref="dafint:col"/>
- </extension>
- </simpleContent>
- </complexType>
- </element>
- </schema>
-
- override def runTest(): Boolean = {
- if (!super.runTest()) {
- System.err.println("test skipped.")
- return false
- }
- // but when it has to resolve our dafint namespace, we don't want it
to take the
- // one we created here, rather we want it to take our internal one.
- val excs = exceptionList
-
- println(excs)
- //
- // Now, our internal dafint schema requires the line attribute to be a
- // xs:int, so using 'A' above means we should get an error on the line
attribute.
- //
- // these checks pass if we got an error complaining about the 'line'
- //
- assertTrue(excs.length >= 1)
- val hasLineError = excs.exists { _.getMessage().contains("line") }
- assertTrue(hasLineError)
- true
- }
- }
-
- test.runTest
- }
-
- /**
- * This test is similar to the above, but makes sure that our internal
- * dafint.xsd is being used because the data would be invalid and cause
- * invalid error if the user-supplied schema was being used.
- *
- * Test passes if there is no invalid data error.
- */
- @Test def testThatUserCatalogCannotOverrideDaffodilInternalCatalog2(): Unit
= {
-
- // LoggingDefaults.setLoggingLevel(LogLevel.Debug)
-
- val test = new CatalogTestBase {
- val testData =
- // The '5' for line NOT cause a validation error because it is an INT
- // however, this is a weak test because 5 is also a perfectly good
string.
- // so we override the schema too below to use an enumeration to insist
on
- // the string being 'A' not compatible with an int.
- <e xmlns={ ns } xmlns:dafint={ ns } dafint:line="5"
dafint:col="6">5</e>
-
- // So if this schema is being used, the load will cause an error.
- // We don't want that error.
- val testSchema =
- <schema xmlns={ xsd } targetNamespace={ ns } xmlns:dafint={ ns }
xmlns:xsd={ xsd }>
- <!-- in our internal schema this is an int, in this schema it is a
string
- that is NOT an int enforced by the enumeration facet.
- So if our internal schema is being used, a validation against
that will be ok.
- But if THIS schema is being used, a validation against our data
will fail.
- -->
- <attribute name="line">
- <simpleType>
- <restriction base="xsd:string">
- <enumeration value="A"/>
- </restriction>
- </simpleType>
- </attribute>
- <element name="e">
- <complexType>
- <simpleContent>
- <extension base="xsd:integer">
- <attribute ref="dafint:line"/>
- </extension>
- </simpleContent>
- </complexType>
- </element>
- </schema>
-
- override def runTest(): Boolean = {
- if (!super.runTest()) {
- System.err.println("test skipped.")
- return false
- }
- // but when it has to resolve our dafint namespace, we don't want it
to take the
- // one we created here, rather we want it to take our internal one.
- val excs = exceptionList
-
- println(excs)
- //
- // Now, our internal dafint schema requires the line attribute to be a
- // xs:int, so using '5' above will be ok.
- //
- // these checks pass only if we did NOT get an error.
- assertTrue(excs.length == 0)
- true
- }
- }
-
- test.runTest
- }
-
-}
-
-abstract class CatalogTestBase {
-
- val cd = new File(".")
- val cdpath = cd.getAbsolutePath()
- System.err.println("cd = " + cdpath)
- val testCPDirPath =
- if (cdpath.endsWith("daffodil-test/.")) "testData_OnClassPath"
- else if ((new File(cdpath, "daffodil-test" )).isDirectory)
"daffodil-test/testData_OnClassPath"
- else {
- System.err.println("Can't run catalog tests because we are not in a
directory where they are runnable.")
- ""
- }
- val testCPDir = new File(testCPDirPath)
- val tmpSchemaFileName = new File(testCPDir.getAbsolutePath() + "/sch.xsd")
- val tmpDataFileName = new File(testCPDir.getAbsolutePath() + "/data.xml")
- val tmpCatalogFileName = new File(testCPDir.getAbsolutePath() +
"/testCatalog.xml")
- val tmpCatalogManagerPropFile = new File(testCPDir.getAbsolutePath() +
"/CatalogManager.properties")
-
- // Take the # off of the verbosity line if you want more output
- // to see what's happening with catalog/uri resolution
- val CMPropsContent =
- """#verbosity=4
-relative-catalogs=true
-catalogs=testData_OnClassPath/testCatalog.xml
-"""
-
- // This is one of our internal namespaces. Let's make a schema that uses it
- // and see whose gets loaded, this one, or our internal one.
-
- val ns = XMLUtils.INT_NS
- val xsd = XMLUtils.XSD_NAMESPACE
- val ex = XMLUtils.EXAMPLE_NAMESPACE
-
- def testSchema: scala.xml.Node
-
- def testData: scala.xml.Node
-
- val testCatalog = <catalog
xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
- <uri name={ ns } uri={ tmpSchemaFileName.getAbsolutePath
}/>
- </catalog>
-
- var exceptionList: List[Exception] = Nil
-
- /**
- * returns false if the test can't be executed because we can't create the
file
- * and it should be bypassed without failing.
- */
- def runTest(): Boolean = {
-
- if (testCPDirPath == "") return false
- // user will have their own catalogs, we need to still use ours
- // even if they have the same URI/URNs as namespaces in their
- // catalogs.
-
- // classpath will have the subdirectory of this project named
- // test_OnClasspath on the classpath.
- // Create it if it doesn't exist
-
- if (testCPDir.exists() && testCPDir.isDirectory() & testCPDir.canWrite()) {
- // we're good to go
- } else {
- try {
- System.err.println("Creating test directory " +
testCPDir.getAbsolutePath())
- testCPDir.mkdir()
- } catch {
- case e: SecurityException => {
- System.err.println("Required test directory does not exist, and
cannot be created.")
- return false
- }
- }
- }
-
- using(new java.io.FileWriter(tmpSchemaFileName)) {
- fw =>
- fw.write(testSchema.toString())
- }
- using(new java.io.FileWriter(tmpCatalogManagerPropFile)) {
- fw =>
- fw.write(CMPropsContent)
- }
- using(new java.io.FileWriter(tmpCatalogFileName)) {
- fw =>
- fw.write(testCatalog.toString())
- }
- using(new java.io.FileWriter(tmpDataFileName)) {
- fw =>
- fw.write(testData.toString())
- }
-
- try {
- // At this point, these files should be on the classpath.
- // Let's make sure by trying to retrieve one as a resource.
- Misc.getResourceOption("/CatalogManager.properties") match {
- case (Some(res), path) => // ok. It exists.
- case (None, path) => {
- System.err.println("Unable to get required resource: " + path + "
from the classpath.")
- return false
- }
- }
-
- val loader = new DaffodilXMLLoader(new org.xml.sax.ErrorHandler {
-
- def warning(exception: SAXParseException) = {
- exceptionList = exception :: exceptionList
- System.err.println("Warning " + exception.getMessage())
- }
-
- def error(exception: SAXParseException) = {
- exceptionList = exception :: exceptionList
- System.err.println("Error: " + exception.getMessage())
- }
- def fatalError(exception: SAXParseException) = {
- exceptionList = exception :: exceptionList
- System.err.println("Fatal: " + exception.getMessage())
- }
- })
-
- val src = URISchemaSource(tmpDataFileName.toURI)
- // val elem =
- loader.load(src) // that should validate it.
- // println(elem)
- true // returned to indicate that things worked
- } finally {
- tmpSchemaFileName.delete()
- tmpDataFileName.delete()
- tmpCatalogFileName.delete()
- tmpCatalogManagerPropFile.delete()
- testCPDir.delete()
- }
- }
-}
diff --git a/project/Dependencies.scala b/project/Dependencies.scala
index cb7cd36..91a7ebb 100644
--- a/project/Dependencies.scala
+++ b/project/Dependencies.scala
@@ -22,30 +22,30 @@ object Dependencies {
lazy val common = core ++ infoset ++ test
lazy val core = Seq(
- "org.scala-lang.modules" %% "scala-xml" % "1.1.0",
- "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.1",
- "com.ibm.icu" % "icu4j" % "62.1",
+ "org.scala-lang.modules" %% "scala-xml" % "1.3.0",
+ "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2",
+ "com.ibm.icu" % "icu4j" % "67.1",
"xerces" % "xercesImpl" % "2.12.0",
"xml-resolver" % "xml-resolver" % "1.2",
- "commons-io" % "commons-io" % "2.6",
+ "commons-io" % "commons-io" % "2.8.0",
"jline" % "jline" % "2.14.6",
)
lazy val infoset = Seq(
"org.jdom" % "jdom2" % "2.0.6",
- "com.fasterxml.woodstox" % "woodstox-core" % "5.1.0",
- "com.fasterxml.jackson.core" % "jackson-core" % "2.10.2"
+ "com.fasterxml.woodstox" % "woodstox-core" % "6.2.3",
+ "com.fasterxml.jackson.core" % "jackson-core" % "2.11.3"
)
lazy val cli = Seq(
"org.fusesource.jansi" % "jansi" % "1.17.1",
- "org.rogach" %% "scallop" % "3.1.3",
+ "org.rogach" %% "scallop" % "3.5.1",
"net.sf.expectit" % "expectit-core" % "0.9.0" % "it,test"
)
lazy val test = Seq(
- "junit" % "junit" % "4.12" % "it,test",
+ "junit" % "junit" % "4.13.1" % "it,test",
"com.novocode" % "junit-interface" % "0.11" % "it,test",
- "org.scalacheck" %% "scalacheck" % "1.14.0" % "it,test"
+ "org.scalacheck" %% "scalacheck" % "1.14.3" % "it,test"
)
}
diff --git a/project/build.properties b/project/build.properties
index b134b76..18f5ff8 100644
--- a/project/build.properties
+++ b/project/build.properties
@@ -15,4 +15,4 @@
* limitations under the License.
*/
-sbt.version=1.3.9
+sbt.version=1.4.1