@Inject
private Instance<ServiceLoader> serviceLoader;
public void writeCoverageData(@Observes AfterSuite arqEvent) throws Exception {
IRuntime runtime = runtimeInst.get();
if (runtime != null) {
ByteArrayOutputStream coverageOutputStream = null;
try {
coverageOutputStream = new ByteArrayOutputStream();
ExecutionDataWriter writer = new ExecutionDataWriter(coverageOutputStream);
runtime.collect(writer, writer, true);
} finally {
runtime.shutdown();
if (coverageOutputStream != null) {
try {
coverageOutputStream.close();
} catch (Exception e) {
throw new RuntimeException("Could not close coverage file", e);