[ 
https://issues.apache.org/jira/browse/DAFFODIL-2381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17267939#comment-17267939
 ] 

John Wass commented on DAFFODIL-2381:
-------------------------------------

A reference implementation in the CLI tests for Schematron in [PR#463 Embedded 
Schematron|https://github.com/apache/incubator-daffodil/pull/463]

> Refactor test util to eliminate redundant windows baggage from CLI Tests
> ------------------------------------------------------------------------
>
>                 Key: DAFFODIL-2381
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2381
>             Project: Daffodil
>          Issue Type: Improvement
>          Components: Clean Ups, CLI, QA
>            Reporter: Mike Beckerle
>            Priority: Major
>              Labels: beginner
>
> The CLI tests have lots of verbose things explicit in test after test that 
> should be pushed into libraries so that all the tests don't have to express 
> them over and over.
> {code:java}
>  val DAFFODIL_JAVA_OPTS = Map("DAFFODIL_JAVA_OPTS" -> "-Xms256m -Xmx2048m 
> -Djline.terminal=jline.UnsupportedTerminal -Dfile.encoding=UTF-8")
>   //  Dubugging tests were not executing under Windows and especially under 
> Eclipse
>   //  due to the use of a non-interactive console.
>   //  Set the DAFFODIL_JAVA_OPTS environment variable for Debugger tests to 
> specify
>   //  the use of an unsupported terminal: 
> -Djline.terminal=jline.UnsupportedTerminal
>   //  Also added a Java option to specify the character encoding: 
> -Dfile.encoding=UTF-8
>   @Test def test_3385_CLI_Debugger_invalidExpressions(): Unit = {
>     val schemaFile = 
> Util.daffodilPath("daffodil-test/src/test/resources/org/apache/daffodil/section06/entities/charClassEntities.dfdl.xsd")
>     val inputFile = 
> Util.daffodilPath("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input1.txt")
>     val (testSchemaFile, testInputFile) = if (Util.isWindows) 
> (Util.cmdConvert(schemaFile), Util.cmdConvert(inputFile)) else (schemaFile, 
> inputFile)
>     val shell = if (Util.isWindows) Util.start("", envp = DAFFODIL_JAVA_OPTS) 
> else Util.start("")
> {code}
> All this Util.isWindows conditionalization should be pushed down into the 
> Util libraries so that tests don't have to contain this kind of 
> conditionalization. 
> Every test in the file where the above code is taken has this same  start:
> {code}
>     val schemaFile = 
> Util.daffodilPath("daffodil-test/src/test/resources/org/apache/daffodil/section06/entities/charClassEntities.dfdl.xsd")
>     val inputFile = 
> Util.daffodilPath("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/input/input2.txt")
>     val (testSchemaFile, testInputFile) = if (Util.isWindows) 
> (Util.cmdConvert(schemaFile), Util.cmdConvert(inputFile)) else (schemaFile, 
> inputFile)
> {code}
> This conditional call to Util.cmdConvert should be pushed down into 
> Util.daffodilPath, which should probably be shortened to just Util.path. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to