Examples of Instrumenter


Examples of org.jacoco.core.instr.Instrumenter

   public InputStream openStream()
   {
      try
      {
         IRuntime runtime = ArquillianRuntime.getInstance();
         Instrumenter instrumenter = new Instrumenter(runtime);
         byte[] instrumented = instrumenter.instrument(asset.openStream(), EX_STRING);
        
         return new ByteArrayInputStream(instrumented);
      }
      catch (Exception e)
      {
View Full Code Here

Examples of org.jacoco.core.instr.Instrumenter

   public InputStream openStream()
   {
      try
      {
         IRuntime runtime = ArquillianRuntime.getInstance();
         Instrumenter instrumenter = new Instrumenter(runtime);
         byte[] instrumented = instrumenter.instrument(asset.openStream());
        
         return new ByteArrayInputStream(instrumented);
      }
      catch (Exception e)
      {
View Full Code Here

Examples of org.jacoco.core.instr.Instrumenter

  @Override
  protected Runnable getInstrumentedRunnable() throws Exception {
    ClassReader reader = new ClassReader(TargetLoader.getClassData(target));
    IRuntime runtime = new LoggerRuntime();
    runtime.startup();
    final Instrumenter instr = new Instrumenter(runtime);
    final byte[] instrumentedBuffer = instr.instrument(reader);
    final TargetLoader loader = new TargetLoader(target, instrumentedBuffer);

    return (Runnable) loader.newTargetInstance();
  }
View Full Code Here

Examples of org.jacoco.core.instr.Instrumenter

  private final WildcardMatcher exclClassloader;

  public CoverageTransformer(IRuntime runtime, AgentOptions options,
      final IExceptionLogger logger) {
    this.instrumenter = new Instrumenter(runtime);
    this.logger = logger;
    // Class names will be reported in VM notation:
    includes = new WildcardMatcher(toWildcard(toVMName(options.getIncludes())));
    excludes = new WildcardMatcher(toWildcard(toVMName(options.getExcludes())));
    exclClassloader = new WildcardMatcher(toWildcard(options.getExclClassloader()));
View Full Code Here

Examples of org.jacoco.core.instr.Instrumenter

  private final WildcardMatcher excludes;

  private final WildcardMatcher exclClassloader;

  public CoverageTransformer(IRuntime runtime, AgentOptions options) {
    this.instrumenter = new Instrumenter(runtime);
    // Class names will be reported in VM notation:
    includes = new WildcardMatcher(toVMName(options.getIncludes()));
    excludes = new WildcardMatcher(toVMName(options.getExcludes()));
    exclClassloader = new WildcardMatcher(options.getExclClassloader());
  }
View Full Code Here

Examples of org.jacoco.core.instr.Instrumenter

    // to collect execution data:
    final IRuntime runtime = new LoggerRuntime();

    // The Instrumenter creates a modified version of our test target class
    // that contains additional probes for execution data recording:
    final Instrumenter instr = new Instrumenter(runtime);
    final byte[] instrumented = instr
        .instrument(getTargetClass(targetName));

    // Now we're ready to run our instrumented class and need to startup the
    // runtime first:
    runtime.startup();
View Full Code Here

Examples of org.jacoco.core.instr.Instrumenter

  private final WildcardMatcher exclClassloader;

  public CoverageTransformer(IRuntime runtime, AgentOptions options,
      final IExceptionLogger logger) {
    this.instrumenter = new Instrumenter(runtime);
    this.logger = logger;
    // Class names will be reported in VM notation:
    includes = new WildcardMatcher(toVMName(options.getIncludes()));
    excludes = new WildcardMatcher(toVMName(options.getExcludes()));
    exclClassloader = new WildcardMatcher(options.getExclClassloader());
View Full Code Here

Examples of org.jacoco.core.instr.Instrumenter

    final String resource = "/" + clazz.getName().replace('.', '/')
        + ".class";
    ClassReader reader = new ClassReader(getClass().getResourceAsStream(
        resource));

    final Instrumenter instr = new Instrumenter(runtime);
    final byte[] instrumentedBuffer = instr.instrument(reader);
    final TargetLoader loader = new TargetLoader(clazz, instrumentedBuffer);

    return (Runnable) loader.newTargetInstance();
  }
View Full Code Here

Examples of org.jacoco.core.instr.Instrumenter

    public void run() {
      for (int i = 0; i < count; i++) {
        ClassReader reader = new ClassReader(buffer);

        final Instrumenter instr = new Instrumenter(runtime);
        instr.instrument(reader);
      }
    }
View Full Code Here

Examples of org.jacoco.core.instr.Instrumenter

    final ClassDataRecorder rec = new ClassDataRecorder();
    final Analyzer analyzer = new Analyzer(rec);
    analyzer.analyze(reader);

    final Instrumenter instr = new Instrumenter(runtime);
    final byte[] instrumentedBuffer = instr.instrument(reader);
    final TargetLoader loader = new TargetLoader(clazz, instrumentedBuffer);

    final Object obj = loader.newTargetInstance();
    if (obj instanceof Runnable) {
      ((Runnable) obj).run();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.