While debugging SWT, I have the situation where I'm interested in what happens during a particular event (e.g low level drawing issues).
Currently I do a Thread...sleep(..) manually dump the execution. Let the event run and at the end I do System.exit(..).
This gives me a picture of what ran during that event.
However, above method is sometimes hard to use with some events. (e.g Drag and Drop debugging).
Is there any way to programatically initiate a "Dump Execution Data" ? (with "reset data" enabled).
Thank you
but please don't tell anyone that I recommended to do this ;) :D we state on the same page: "Use these options with caution! Invalid entries might break the code coverage launcher."
For the example - below is screenshot of usage of EclEmma for the one of its own UI tests that use SWTBot and are executed inside OSGi container, pay attention on elements marked as covered:
Now let's add reset via MBean and execute this test again:
Thank you very much, exactly what I was looking for :-D.
I updated my blog article and added how to programatically restart code coverage:
https://developers.redhat.com/blog/2017/10/06/java-code-coverage-eclipse/
The api is also quite interesting, thanks for pointing to the relevant sections.
I've been using the above technique to figure out some SWT bugs, very helpful!