kriegaex commented on PR #133:
URL: https://github.com/apache/xalan-java/pull/133#issuecomment-1837031567

   To me this is obvious, but maybe the two of you need an example: Assuming 
that I simply use `System.setErr(mockPrintStream)` before the negative test and 
reset to the original stream again afterwards, which would be easy enough to 
do. That would suppress the logged stack trace. So far, so good.
   
   But what if in the same test another type of error occurs that would be 
helpful to see in stdErr? Maybe unlikely, but tests exist to break if something 
unexpected happens. Otherwise, we would not need them.
   
   Now if we use our modern multi-core computer to run tests in parallel? That 
can be configured easily in Surefire. If multiple tests share one JVM, there is 
only one stdErr. BTW, the Maven process itself also uses that JVM to report 
things, which might end up on stdErr, because the logging framework used points 
there. Everything that would be logged to the mock stdErr stream while our 
negative test runs would be lost. Hence my remark "not thread-safe". Is that 
worth suppressing the call stack? Not to me. I even appreciate to see it in the 
test log,because that is exactly what we are testing. If we configure Surefire 
to create test logs, the error log would be neatly tucked into the report for 
that one test. Only on the console, everything in one long list. If you do not 
like that or, looks at the generated test reports, e.g. 
_xalan/target/surefire-reports/TEST-org.apache.xalan.VersionTest.xml_. You see, 
how the logs are nicely separated by test, e.g.
   
   
![image](https://github.com/apache/xalan-java/assets/1537384/0093961c-bdca-44f5-abcb-4fba6fe51ddb)
   
   Or towards the bottom:
   
   
![image](https://github.com/apache/xalan-java/assets/1537384/f92076d9-ab65-4350-9214-d64e621dfadd)
   
   Of course, this does not replace but only complement the console report. 
There is also the Maven Surefire Report Plugin, which we can use to generate 
HTML reports. Unfortunately for me, the plugin does not have any options to 
include the stdOut and stdErr output into the report, like I know it from my 
Spock reports. I wonder why this option is missing, because converting the XML 
to HTML is just an XML transformation, as you Xalan guys surely understand. No 
idea why they ignore the console log tags and do not even include them 
optionally. Maybe you guys are even happy about it, because you do not want to 
see the log output in the report. I do, because I only mainly look at reports 
when tests are failing, not when they are passing. There might be an 
alternative test report plugin for Maven, I have not checked. Actually, I am 
mostly fine with scanning the console logs. I am used to it, and my mind (and 
mouse) just skip what I am not interested in at the moment, or I use full-text 
sea
 rch to find specific things.


-- 
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: dev-unsubscr...@xalan.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org
For additional commands, e-mail: dev-h...@xalan.apache.org

Reply via email to