How to have seperate sessions for each junit testcase in a JUNIT suite

38 views
Skip to first unread message

Mario Ackerl

unread,
Apr 23, 2015, 10:05:07 AM4/23/15
to jac...@googlegroups.com
Hello together,

I want to record each junit testcase in a seperate session. Additionally I record one session for code outside of any test (between finish of one test case and beginning of the next one).

I call ICoverageLaunch.requestDump(true) at the beginning and at the end of every junit test. Unfortunately for very fast tests the sessions are wrong. Code of one test, is found in the session of the next one and so on.

The reason seems to be, that requestDump is a pure asynchronous call. How can I find out, if the dump is fully send, so that I can wait for that, before going on with the next test?

greetings

Mario Ackerl

unread,
Apr 23, 2015, 10:16:01 AM4/23/15
to jac...@googlegroups.com
Forgot to mention, that I work with two Eclipse Instances. A host Eclipse controlling Eclemma and a Target Eclipse, where Jacoco is instrumented through the host eclipse. ( Jacoco rt not available on target Eclipse). 

On the host side I call requestDump, whenever I got the information that a test is started or finished. I've got a socket connection between the two eclipse instances, but I do not know when requestDump is finished on the host side ... so I can only wait a little time after requestDump before sending back, that the target eclipse can continue.

Marc Hoffmann

unread,
Apr 23, 2015, 10:58:58 AM4/23/15
to jac...@googlegroups.com
You could wait until the new session is created: For this register a
ISessionListener at the ISessionManager.

Regards,
-marc
> --
> You received this message because you are subscribed to the Google
> Groups "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to jacoco+un...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/9b7460d6-b9a7-48a8-a814-c336c76f58ac%40googlegroups.com
> [1].
> For more options, visit https://groups.google.com/d/optout [2].
>
>
> Links:
> ------
> [1]
> https://groups.google.com/d/msgid/jacoco/9b7460d6-b9a7-48a8-a814-c336c76f58ac%40googlegroups.com?utm_medium=email&utm_source=footer
> [2] https://groups.google.com/d/optout

Mario Ackerl

unread,
Apr 27, 2015, 1:43:34 AM4/27/15
to jac...@googlegroups.com
Seems to work, thanks

mario
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages