Package com.google.test.metric

Examples of com.google.test.metric.MetricComputer


  @Override
  protected void setUp() throws Exception {
    super.setUp();
    ClassRepository repo = new JavaClassRepository();
    MetricComputer toDecorate = new MetricComputerBuilder().withClassRepository(repo).build();
    decoratedComputer = new MetricComputerJavaDecorator(toDecorate, repo);
    HypotheticalCostModel hypotheticalCostModel = new HypotheticalCostModel(new CostModel());
    issuesReporter = new IssuesReporter(new LinkedList<ClassIssues>(), hypotheticalCostModel);
  }
View Full Code Here


  @Override
  protected void setUp() throws Exception {
    super.setUp();
    ClassRepository repo = new JavaClassRepository();
    MetricComputer toDecorate = new MetricComputerBuilder().withClassRepository(repo).build();
    decoratedComputer = new MetricComputerJavaDecorator(toDecorate, repo);
    costModel = new HypotheticalCostModel(new CostModel());
    issuesReporter = new IssuesReporter(new LinkedList<ClassIssues>(), this.costModel);
  }
View Full Code Here

    ClassPath classPath =
        new ClassPathFactory().createFromPaths("src/test/java", "core/src/test/java");
    SourceLoader loader = new SourceLoader(classPath);
    report = new SourceReportGenerator(new GradeCategories(0, 0), loader, null, new CostModel(),
            new Date(), 10, new Configuration());
    computer = new MetricComputer(new JavaClassRepository(), null,
            new RegExpWhiteList(), 1);
  }
View Full Code Here

        whitelist.addPackage(packageName);
      }
     
      CostModel costModel = new CostModel(cyclomaticCost, globalCost, constructorMultiplier);
      JavaClassRepository classRepository = new JavaClassRepository(classPath);
      MetricComputer computer = new MetricComputer(classRepository, errorStream, whitelist, printDepth);
      HypotheticalCostModel hypotheticalCostModel = new HypotheticalCostModel(costModel);
      IssuesReporter issuesReporter = new IssuesReporter(
          new TriageIssuesQueue<ClassIssues>(maxAcceptableCost,
              maxClassesInReport, new ClassIssues.TotalCostComparator()), hypotheticalCostModel);
      ReportOptions options = new ReportOptions(cyclomaticCost, globalCost, constructorMultiplier,
View Full Code Here

  MetricComputerJavaDecorator decoratedComputer;

  @Override
  protected void setUp() throws Exception {
    ClassRepository repo = new JavaClassRepository();
    MetricComputer toDecorate = new MetricComputerBuilder().withClassRepository(repo).build();
    decoratedComputer = new MetricComputerJavaDecorator(toDecorate, repo);
  }
View Full Code Here

  private final ClassRepository repo = new JavaClassRepository();
  private MetricComputerJavaDecorator decoratedComputer;

  @Override
  protected void setUp() throws Exception {
    MetricComputer toDecorate = new MetricComputerBuilder().withClassRepository(repo).build();
    decoratedComputer = new MetricComputerJavaDecorator(toDecorate, repo);
  }
View Full Code Here

    this.whitelist = regExpWhitelist;
    return this;
  }

  public MetricComputer build() {
    return new MetricComputer(repo, printStream, whitelist, 1);
  }
View Full Code Here

  MetricComputerJavaDecorator decoratedComputer;

  @Override
  protected void setUp() throws Exception {
    ClassRepository repo = new JavaClassRepository();
    MetricComputer toDecorate = new MetricComputerBuilder().withClassRepository(repo).build();
    decoratedComputer = new MetricComputerJavaDecorator(toDecorate, repo);
  }
View Full Code Here

  private final ClassRepository repo = new JavaClassRepository();
  private MetricComputerJavaDecorator decoratedComputer;

  @Override
  protected void setUp() throws Exception {
    MetricComputer toDecorate = new MetricComputerBuilder().withClassRepository(repo).build();
    decoratedComputer = new MetricComputerJavaDecorator(toDecorate, repo);
  }
View Full Code Here

      this.foo = (foo == null);
    }
  }

  public void testImplicitSetterCostShouldNotBeDoubleCounted() throws Exception {
    MetricComputer computer = new MetricComputer(new JavaClassRepository(), null, new RegExpWhiteList(), 1);
    ClassCost cost = computer.compute(Setters.class.getCanonicalName());
    MethodCost cost1 = cost.getMethodCost("void setFoo(java.lang.String)");
    assertEquals(1, cost1.getTotalCost().getCyclomaticComplexityCost());
  }
View Full Code Here

TOP

Related Classes of com.google.test.metric.MetricComputer

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.