use of org.jacoco.core.tools.ExecFileLoader in project jacoco by jacoco.
the class ReportGenerator method loadExecutionData.
private void loadExecutionData() throws IOException {
execFileLoader = new ExecFileLoader();
execFileLoader.load(executionDataFile);
}
use of org.jacoco.core.tools.ExecFileLoader in project jacoco by jacoco.
the class DumpMojo method executeMojo.
@Override
public void executeMojo() throws MojoExecutionException {
final ExecDumpClient client = new ExecDumpClient() {
@Override
protected void onConnecting(final InetAddress address, final int port) {
getLog().info(format("Connecting to %s:%s", address, Integer.valueOf(port)));
}
@Override
protected void onConnectionFailure(final IOException exception) {
getLog().info(exception.getMessage());
}
};
client.setDump(dump);
client.setReset(reset);
client.setRetryCount(retryCount);
try {
final ExecFileLoader loader = client.dump(address, port);
if (dump) {
getLog().info(format("Dumping execution data to %s", destFile.getAbsolutePath()));
loader.save(destFile, append);
}
} catch (final IOException e) {
throw new MojoExecutionException("Unable to dump coverage data", e);
}
}
use of org.jacoco.core.tools.ExecFileLoader in project jacoco by jacoco.
the class MergeMojo method executeMerge.
private void executeMerge() throws MojoExecutionException {
final ExecFileLoader loader = new ExecFileLoader();
load(loader);
save(loader);
}
use of org.jacoco.core.tools.ExecFileLoader in project jacoco by jacoco.
the class AgentTest method getExecutionData_should_return_probes_and_session_id.
@Test
public void getExecutionData_should_return_probes_and_session_id() throws IOException {
Agent agent = createAgent();
agent.startup();
agent.getData().getExecutionData(Long.valueOf(0x12345678), "Foo", 1).getProbes()[0] = true;
byte[] data = agent.getExecutionData(true);
ExecFileLoader loader = new ExecFileLoader();
loader.load(new ByteArrayInputStream(data));
assertEquals("Foo", loader.getExecutionDataStore().get(0x12345678).getName());
assertEquals("test", loader.getSessionInfoStore().getInfos().get(0).getId());
}
Aggregations