On 2015-06-01 09:33 AM, Miklos Vajna wrote:
On Sat, May 30, 2015 at 04:47:56PM +0200, Lionel Elie Mamane <[email protected]> 
wrote:
I fixed the underlying bug, but I would like to fix the test so that
it fails when one of the threads fails. I tried to not catch the
Exception, but that does not help. (I noticed the thread failure by
looking at workdir/JunitTest/dbaccess_complex/done.log )

Can't you call org.junit.Assert.fail() in the catch block?


That's what the current code is doing, but org.junit.Assert.fail() just throws an AssertionError, so doing that inside a child thread is not useful.

The better way is to use ExecutorService, Callable, and Future.get(), see here 
for an example:

http://stackoverflow.com/questions/6546193/how-to-catch-an-exception-from-a-thread
_______________________________________________
LibreOffice mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to