Package com.google.test.metric

Examples of com.google.test.metric.RegExpWhiteList


      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


        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

      PrintStream reportStream = new PrintStream(new FileOutputStream(
          new File(reportDirectory, TestabilityConstants.HTML_REPORT_FILENAME)));
      PrintStream errorStream = new PrintStream(new FileOutputStream(
          new File(reportDirectory, TestabilityConstants.ERROR_LOG_FILENAME)));

      RegExpWhiteList whitelist = new RegExpWhiteList("java.");
      for (String packageName : whitelistPackages) {
        whitelist.addPackage(packageName);
      }
     
      CostModel costModel = new CostModel(cyclomaticCost, globalCost, constructorMultiplier);
      JavaClassRepository classRepository = new JavaClassRepository(classPath);
      MetricComputer computer = new MetricComputer(classRepository, errorStream, whitelist, printDepth);
View Full Code Here

    checkResultsAreOk();
  }

  private void runTestabilityExplorer() {
    List<String> entries = Arrays.asList(model.getFilter());
    WhiteList packageWhiteList = new RegExpWhiteList(model.getWhiteList());
    final ReportOptions options = setOptions();
    final JavaTestabilityModule module = new JavaTestabilityModule(entries,
        model.getErrorPrintStream(), model.getPrintDepth(), ReportFormat.valueOf(model.getPrint()));
    AbstractModule configModule = new AbstractModule() {
      @Override
View Full Code Here

        testabilityExplorerMojo.maxAcceptableCost,
        testabilityExplorerMojo.worstOffenderCount, 0, 0, testabilityExplorerMojo.printDepth,
        testabilityExplorerMojo.minCost, "", "");
    bind(ReportOptions.class).toInstance(options);
    bind(TestabilityExplorerMojo.class).toInstance(testabilityExplorerMojo);
    bind(WhiteList.class).toInstance(new RegExpWhiteList(testabilityExplorerMojo.whiteList));
    bind(ReportFormat.class).toInstance(ReportFormat.valueOf(testabilityExplorerMojo.format));
    bindConstant().annotatedWith(Names.named("printDepth")).to(testabilityExplorerMojo.printDepth);
    bind(new TypeLiteral<List<String>>() {}).toInstance(Arrays.asList(testabilityExplorerMojo.filter));
    bind(Runnable.class).to(JavaTestabilityRunner.class);
  }
View Full Code Here

  private MetricComputer computer;

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    computer = new MetricComputer(repo, null, new RegExpWhiteList(), new CostModel());
  }
View Full Code Here

TOP

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

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.