Here is a modified version which buffers the received content in-memory only:

https://gist.github.com/marchof/1fd7dc6dd06e0510c814

Is this what you were looking for?

Cheers,
-marc

On 01.09.14 19:36, [email protected] wrote:
Hey, all.

I'm designing a custom server to handle coverage reports coming from a massive 
regression test suite, each with multiple JaCoCo agents running in TCPCLIENT 
mode (no Maven plugins, failsafe, surefire, ant, Jenkins, etc. -- just this and 
a whole ton of agents).

I've solved this problem with agents running in TCPSERVER mode, which was 
pretty easy because my client had more control over synchronization issues, but 
we've since changed our tests to shut down the JVM (as opposed to leaving it 
running) which means coverage reports will be coming in unpredictably, en 
masse, with an unknown time to live.

Because of this, I want to save my reports to a byte array using a 
ByteArrayStream as soon as possible in my business logic, and defer file 
writing and report merging logic stuff to other classes after the socket is 
closed (so I know I have as much time as I need to perform my tasks without 
keeping the JVM waiting). This is both to prevent synchronization issues and to 
dump reports as fast as possible.

The only guiding light I've got is the API usage example here:

http://www.eclemma.org/jacoco/trunk/doc/examples/java/ExecutionDataServer.java

but I've never used a ByteArrayStream before and I'm not sure how to 
incorporate a buffer into this code.

Converting the byte array into a file later on will be easy, but I'm a little 
hung up on how to dump to one in the first place.

Can anyone help me out?


--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to