Package org.jacoco.core.instr

Examples of org.jacoco.core.instr.MethodRecorder


  }

  @Test
  public void testRuntimeClassName() throws Exception {
    generator = new OfflineInstrumentationAccessGenerator();
    MethodRecorder actual = new MethodRecorder();
    generator.generateDataAccessor(987654321, "foo/Bar", 17,
        actual.getVisitor());

    MethodRecorder expected = new MethodRecorder();
    expected.getVisitor().visitLdcInsn(Long.valueOf(987654321));
    expected.getVisitor().visitLdcInsn("foo/Bar");
    expected.getVisitor().visitIntInsn(Opcodes.BIPUSH, 17);
    String rtname = JaCoCo.RUNTIMEPACKAGE.replace('.', '/') + "/Offline";
    expected.getVisitor().visitMethodInsn(Opcodes.INVOKESTATIC, rtname,
        "getProbes", "(JLjava/lang/String;I)[Z", false);

    assertEquals(expected, actual);
  }
View Full Code Here


  private MethodRecorder expected;
  private MethodVisitor eliminator;

  @Before
  public void setup() {
    actual = new MethodRecorder();
    expected = new MethodRecorder();
    eliminator = new DuplicateFrameEliminator(actual.getVisitor());
  }
View Full Code Here

  @Before
  public void setup() {
    label = new Label();
    id = 1000;
    expected = new MethodRecorder();
    expectedVisitor = new TraceAdapter(expected);
    actual = new MethodRecorder();
    MethodProbesVisitor actualVisitor = new TraceAdapter(actual);
    MethodProbesAdapter probesAdapter = new MethodProbesAdapter(
        actualVisitor, this);
    final AnalyzerAdapter analyzer = new AnalyzerAdapter("Foo", 0, "doit",
        "()V", probesAdapter);
View Full Code Here

  private void assertOutput() {
    assertEquals(dump(expected), dump(actual));
  }

  private MethodRecorder dump(MethodNode node) {
    MethodRecorder rec = new MethodRecorder();
    node.accept(rec.getVisitor());
    return rec;
  }
View Full Code Here

  private IProbeArrayStrategy arrayStrategy;

  @Before
  public void setup() {
    actual = new MethodRecorder();
    actualVisitor = actual.getVisitor();
    expected = new MethodRecorder();
    expectedVisitor = expected.getVisitor();
    arrayStrategy = new IProbeArrayStrategy() {

      public int storeInstance(MethodVisitor mv, int variable) {
        mv.visitLdcInsn("init");
View Full Code Here

  private IFrame frame;

  @Before
  public void setup() {
    actual = new MethodRecorder();
    expected = new MethodRecorder();
    expectedVisitor = expected.getVisitor();
    final IProbeInserter probeInserter = new IProbeInserter() {

      public void insertProbe(int id) {
        actual.getVisitor().visitLdcInsn("Probe " + id);
View Full Code Here

TOP

Related Classes of org.jacoco.core.instr.MethodRecorder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.