From: Eric S. <pub...@da...> - 2013-10-24 19:12:26
|
On 10/23/2013 03:31 PM, Bill Ross wrote: > It looks like this is an artifact of println rather than XMLUnit: when I add this to the end of my test, it triggers ok: > System.out.println("@@@"); > //napMilliSeconds(2000); > Assert.fail("Should fail here."); > > With the ‘nap’, all the prints appear, but in any case the assert is reached and fires. So, are you saying that: - with the nap, you get both the System.out output and the "Should fail here" test failure, as expected? - without the nap, you get the (still-expected) test failure, but nothing printed on System.out? If so, it sounds as though, when the test finishes (whether failing, as here, or passing, as in your original post), System.out's buffer is discarded instead of being flushed. I'm not sure why that would be timing-dependent. Try replacing the nap with: System.out.flush(); and see what happens. Also try removing XmlUnit from the equation entirely. I'd do both of those at once by making a set of tests that do: {XmlUnit code | nothing} println // The other 12 combinations, without the println, are of no interest {nap | flush | nothing} {fail | nothing} And see which ones do or do not produce the println output. If, as I expect: - nap and flush both cause the println output to appear, but with neither of them, it's suppressed - presence or absence of the preceding XmlUnit stuff makes no difference - presence or absence of the final Assert.fail call also makes no difference then you have a solid bug report for the IntelliJ folks :-) (Of course, it being timing-dependent, the results may not be entirely identical from run to run. I'd expect nap (and flush, if my theory is correct) to *reliably* produce the output, but having neither of them to only sometimes suppress it.) - Eric |