You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2021/06/03 13:46:43 UTC
[GitHub] [daffodil] stevedlawrence commented on a change in pull request #584: Adds diagnostic capability to TDMLTestNotCompatibleException.
stevedlawrence commented on a change in pull request #584:
URL: https://github.com/apache/daffodil/pull/584#discussion_r644806937
##########
File path: daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala
##########
@@ -748,7 +748,23 @@ abstract class TestCase(testCaseXML: NodeSeq, val parent: DFDLTestSuite)
_.newInstance(tdmlException.getMessage, tdmlException).asInstanceOf[Exception]
}
- val exceptionToThrow = junitExceptionInstance.getOrElse(tdmlException)
+ val exceptionToThrow = junitExceptionInstance.getOrElse(
+ // We create a new exception here so that we can propagate the
+ // exception as to why we are not able to construct
+ // an org.junit.AssumptionViolatedException.
+ //
+ // This can be useful if nothing is catching this exception.
+ // The CLI catches this, but won't display the messaging that
+ // elaborates on the cause, because the CLI doesn't utilize junit,
+ // so it expects this to fail.
+ //
+ // But if this isn't caught, and propagates to top level,
+ // then we'll get the diagnostic messaging, including about the
+ // cause.
+ //
+ new TDMLTestNotCompatibleException(testName, implementationName,
+ Option(junitExceptionInstance.failed.get))
Review comment:
Is it worth adding a CLI test to cover this line? It's not possible to hit using sbt tests since they have junit on the classpath.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org