stevedlawrence opened a new pull request, #1389:
URL: https://github.com/apache/daffodil/pull/1389
There is currently a large amount of boilerplate and duplication associated
with defining TDML tests with JUnit. To fix this, this adds two new traits that
can be mixed in to the companion object and class associated with a JUnit test
suite to greatly simplify test suite definitions. Test suites can now be
defined with something like this:
object MyTests extends TdmlSuite {
val tdmlResource = "/resource/path/to/tests.tdml"
}
class MyTests extends TdmlTests {
val tdmlSuite = MyTests
@Test def test1 = test
@Test def test2 = test
@Test def test3 = test
}
To allow use with older versions of Daffodil, this defaults to using
creating a Runner with only the path parameter. This is sufficient for all
known schema projects, since most Runner parameters can either be set directly
in a TDML file (which is preferred), or are intended for use by Daffodil tests
and should not be changed by schema projects.
The sbt-plugin project will eventually be updated to include this as a
dependency for DFDL Schema projects, but until that change is released,
projects that want to use this new syntax should add the following to
dependency to build.sbt file, in addition to any existing daffodil dependencies:
libraryDependencies ++= Seq(
"org.apache.daffodil" %% "daffodil-tdml-junit" % "<version>" % "test"
intransitive()
)
Where "<version>" is hardcoded to the first version that daffodil-tdml-junit
is released for. The new library works with older versions of Daffodil, so by
hardcoding the version and setting it as an intransitive dependency, it allows
the library the be used with TDML tests even when testing older daffodil
versions that do not publish the library. As we no longer need to support older
versions of Daffodil and sbt-daffodil supports the new library, this will not
be needed.
DAFFODIL-2958
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]