use of org.jacoco.core.runtime.RuntimeData in project jacoco by jacoco.
the class FileOutputTest method testInvalidDestFile.
@Test(expected = IOException.class)
public void testInvalidDestFile() throws Exception {
AgentOptions options = new AgentOptions();
options.setDestfile(folder.newFolder("folder").getAbsolutePath());
FileOutput controller = new FileOutput();
// Startup should fail as the file can not be created:
controller.startup(options, new RuntimeData());
}
use of org.jacoco.core.runtime.RuntimeData in project jacoco by jacoco.
the class ExecuteInstrumentedCodeScenario method getInstrumentedCallable.
@Override
@SuppressWarnings("unchecked")
protected Callable<Void> getInstrumentedCallable() throws Exception {
IRuntime runtime = new LoggerRuntime();
runtime.startup(new RuntimeData());
final Instrumenter instr = new Instrumenter(runtime);
final byte[] original = TargetLoader.getClassDataAsBytes(target);
final byte[] instrumentedBuffer = instr.instrument(original, "");
final TargetLoader loader = new TargetLoader();
return (Callable<Void>) loader.add(target, instrumentedBuffer).newInstance();
}
use of org.jacoco.core.runtime.RuntimeData in project powermock by powermock.
the class JacocoCoverageTest method jacocoOfflineInstShouldCalculateCoverageAfterPowerMockTransformation.
@Test
public void jacocoOfflineInstShouldCalculateCoverageAfterPowerMockTransformation() throws Exception {
final RuntimeData data = new RuntimeData();
runTargetTest(data);
final CoverageBuilder coverageBuilder = collectCoverage(getExecutionDataStore(data));
assertCodeCoverage(coverageBuilder);
}
Aggregations