use of org.jacoco.core.runtime.SystemPropertiesRuntime in project jacoco by jacoco.
the class ClassFileVersionsTest method testVersion.
private void testVersion(int version, boolean frames) throws IOException {
final byte[] original = createClass(version);
IRuntime runtime = new SystemPropertiesRuntime();
Instrumenter instrumenter = new Instrumenter(runtime);
byte[] instrumented = instrumenter.instrument(original, "TestTarget");
assertFrames(instrumented, frames);
}
use of org.jacoco.core.runtime.SystemPropertiesRuntime in project jacoco by jacoco.
the class CyclomaticComplexityTest method setup.
@Before
public void setup() throws Exception {
data = new RuntimeData();
runtime = new SystemPropertiesRuntime();
runtime.startup(data);
}
use of org.jacoco.core.runtime.SystemPropertiesRuntime in project jacoco by jacoco.
the class FramesTest method testFrames.
private void testFrames(byte[] source) throws IOException {
IRuntime runtime = new SystemPropertiesRuntime();
Instrumenter instrumenter = new Instrumenter(runtime);
source = calculateFrames(source);
byte[] actual = instrumenter.instrument(source, "TestTarget");
byte[] expected = calculateFrames(actual);
assertEquals(dump(expected), dump(actual));
}
use of org.jacoco.core.runtime.SystemPropertiesRuntime in project jacoco by jacoco.
the class StructuredLockingTest method assertStructuredLocking.
private void assertStructuredLocking(byte[] source) throws Exception {
IRuntime runtime = new SystemPropertiesRuntime();
Instrumenter instrumenter = new Instrumenter(runtime);
byte[] instrumented = instrumenter.instrument(source, "TestTarget");
final int version = BytecodeVersion.get(instrumented);
instrumented = BytecodeVersion.downgradeIfNeeded(version, instrumented);
ClassNode cn = new ClassNode();
new ClassReader(instrumented).accept(cn, 0);
for (MethodNode mn : cn.methods) {
assertStructuredLocking(cn.name, mn);
}
}
Aggregations