Examples of ICounter


Examples of com.mountainminds.eclemma.core.analysis.ICounter

          IJavaElementCoverage c = CoverageTools.getCoverageInfo(element);
          if (c == null || c.getInstructionCounter().getTotalCount() == 0) {
            return false;
          }
          if (settings.getHideUnusedTypes()) {
            ICounter cnt = c.getTypeCounter();
            return cnt.getTotalCount() == 0 || cnt.getCoveredCount() != 0;
          }
          return true;
        }
      }
    });
View Full Code Here

Examples of com.mountainminds.eclemma.core.analysis.ICounter

    });
  }
 
  public int compare(Viewer viewer, Object e1, Object e2) {
    ICounterMode mode = settings.getCounterMode();
    ICounter c1 = mode.getCounter(CoverageTools.getCoverageInfo(e1));
    ICounter c2 = mode.getCounter(CoverageTools.getCoverageInfo(e2));
    int res = 0;
    switch (settings.getSortColumn()) {
      case CoverageView.COLUMN_ELEMENT:
        res = elementsorter.compare(viewer, e1, e2);
        break;
      case CoverageView.COLUMN_RATIO:
        res = Double.compare(c1.getRatio(), c2.getRatio());
        break;
      case CoverageView.COLUMN_COVERED:
        res = (int) (c1.getCoveredCount() - c2.getCoveredCount());
        break;
      case CoverageView.COLUMN_TOTAL:
        res = (int) (c1.getTotalCount() - c2.getTotalCount());
        break;
    }
    if (res == 0) {
      res = elementsorter.compare(viewer, e1, e2);
    } else {
View Full Code Here

Examples of com.mountainminds.eclemma.core.analysis.ICounter

          IJavaElementCoverage c = CoverageTools.getCoverageInfo(element);
          if (c == null || c.getInstructionCounter().getTotalCount() == 0) {
            return false;
          }
          if (settings.getHideUnusedTypes()) {
            ICounter cnt = c.getTypeCounter();
            return cnt.getTotalCount() == 0 || cnt.getCoveredCount() != 0;
          }
          return true;
        }
      }
    });
View Full Code Here

Examples of net.floodlightcontroller.counter.ICounter

     * Then convert the rate to an absolute number for the
     * FLOW_RECONCILE_PERIOD.
     * @return
     */
    protected int getCurrentCapacity() {
        ICounter pktInCounter =
            counterStore.getCounter(controllerPktInCounterName);
        int minFlows = MIN_FLOW_RECONCILE_PER_SECOND *
                        FLOW_RECONCILE_DELAY_MILLISEC / 1000;

        // If no packetInCounter, then there shouldn't be any flow.
        if (pktInCounter == null ||
            pktInCounter.getCounterDate() == null ||
            pktInCounter.getCounterValue() == null) {
            logger.debug("counter {} doesn't exist",
                        controllerPktInCounterName);
            return minFlows;
        }

View Full Code Here

Examples of org.jacoco.core.analysis.ICounter

    // Report result:
    coverage.ensureCapacity(firstLine, lastLine);
    for (final Instruction i : instructions) {
      final int total = i.getBranches();
      final int covered = i.getCoveredBranches();
      final ICounter instructions = covered == 0 ? CounterImpl.COUNTER_1_0
          : CounterImpl.COUNTER_0_1;
      final ICounter branches = total > 1 ? CounterImpl.getInstance(total
          - covered, covered) : CounterImpl.COUNTER_0_0;
      coverage.increment(instructions, branches, i.getLine());
    }
  }
View Full Code Here

Examples of org.jacoco.core.analysis.ICounter

    element.close();
  }

  private void createCounterElement(final CounterEntity counterEntity)
      throws IOException {
    final ICounter counter = node.getCounter(counterEntity);
    if (counter.getTotalCount() > 0) {
      final XMLElement counterNode = this.element.element("counter");
      counterNode.attr("type", counterEntity.name());
      counterNode.attr("covered", counter.getCoveredCount());
      counterNode.attr("missed", counter.getMissedCount());
      counterNode.close();
    }
  }
View Full Code Here

Examples of org.jacoco.core.analysis.ICounter

    for (int nr = source.getFirstLine(); nr <= last; nr++) {
      final ILine line = source.getLine(nr);
      if (line.getStatus() != ICounter.EMPTY) {
        final XMLElement element = parent.element("line");
        element.attr("nr", nr);
        final ICounter insn = line.getInstructionCounter();
        element.attr("mi", insn.getMissedCount());
        element.attr("ci", insn.getCoveredCount());
        final ICounter branches = line.getBranchCounter();
        element.attr("mb", branches.getMissedCount());
        element.attr("cb", branches.getCoveredCount());
      }
    }
  }
View Full Code Here

Examples of org.jacoco.core.analysis.ICounter

  }

  @Override
  public boolean equals(final Object obj) {
    if (obj instanceof ICounter) {
      final ICounter that = (ICounter) obj;
      return this.missed == that.getMissedCount()
          && this.covered == that.getCoveredCount();
    } else {
      return false;
    }
  }
View Full Code Here

Examples of org.jacoco.core.analysis.ICounter

    // Report result:
    coverage.ensureCapacity(firstLine, lastLine);
    for (final Instruction i : instructions) {
      final int total = i.getBranches();
      final int covered = i.getCoveredBranches();
      final ICounter instructions = covered == 0 ? CounterImpl.COUNTER_1_0
          : CounterImpl.COUNTER_0_1;
      final ICounter branches = total > 1 ? CounterImpl.getInstance(total
          - covered, covered) : CounterImpl.COUNTER_0_0;
      coverage.increment(instructions, branches, i.getLine());
    }
  }
View Full Code Here

Examples of org.jacoco.core.analysis.ICounter

    // Report result:
    coverage.ensureCapacity(firstLine, lastLine);
    for (final Instruction i : instructions) {
      final int total = i.getBranches();
      final int covered = i.getCoveredBranches();
      final ICounter instrCounter = covered == 0 ? CounterImpl.COUNTER_1_0
          : CounterImpl.COUNTER_0_1;
      final ICounter branchCounter = total > 1 ? CounterImpl.getInstance(
          total - covered, covered) : CounterImpl.COUNTER_0_0;
      coverage.increment(instrCounter, branchCounter, i.getLine());
    }
    coverage.incrementMethodCounter();
  }
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.