@Test public void testAbacusComplexityOnDecorateProject() { when(dc.getMeasure(CoreMetrics.FILE_COMPLEXITY)).thenReturn(new Measure(CoreMetrics.FILE_COMPLEXITY, 5.0)); abacusDecorator.decorate(myProject, dc); verify(dc).saveMeasure(argThat(new IsMeasure(AbacusMetrics.ABACUS_COMPLEXITY, "Simple"))); when(dc.getMeasure(CoreMetrics.FILE_COMPLEXITY)).thenReturn(new Measure(CoreMetrics.FILE_COMPLEXITY, 50.0)); abacusDecorator.decorate(myProject, dc); verify(dc).saveMeasure(argThat(new IsMeasure(AbacusMetrics.ABACUS_COMPLEXITY, "Medium"))); when(dc.getMeasure(CoreMetrics.FILE_COMPLEXITY)).thenReturn(new Measure(CoreMetrics.FILE_COMPLEXITY, 50.5)); abacusDecorator.decorate(myProject, dc); verify(dc).saveMeasure(argThat(new IsMeasure(AbacusMetrics.ABACUS_COMPLEXITY, "Complex"))); when(dc.getMeasure(CoreMetrics.FILE_COMPLEXITY)).thenReturn(new Measure(CoreMetrics.FILE_COMPLEXITY, 1000.0)); abacusDecorator.decorate(myProject, dc); verify(dc).saveMeasure(argThat(new IsMeasure(AbacusMetrics.ABACUS_COMPLEXITY, "Very complex"))); }
public void decorate(Resource rsrc, DecoratorContext dc) { computeAbacusComplexity(rsrc, dc); computeAbacusComplexityDistribution(rsrc, dc); }
AbacusDecorator implements Decorator { public void decorate(Resource rsrc, DecoratorContext dc) { computeAbacusComplexity(rsrc, dc); computeAbacusComplexityDistribution(rsrc, dc); } }
AbacusDecorator implements Decorator { public void decorate(Resource rsrc, DecoratorContext dc) { computeAbacusComplexity(rsrc, dc); computeAbacusComplexityDistribution(rsrc, dc); } AbacusDecorator(Settings settings); }
AbacusDecorator implements Decorator { public void decorate(Resource rsrc, DecoratorContext dc) { computeAbacusComplexity(rsrc, dc); computeAbacusComplexityDistribution(rsrc, dc); } AbacusDecorator(Settings settings); @DependsUpon List<Metric> dependsOn(); @DependedUpon List<Metric> dependedOn(); boolean shouldExecuteOnProject(Project project); void decorate(Resource rsrc, DecoratorContext dc); }
AbacusDecorator implements Decorator { public void decorate(Resource rsrc, DecoratorContext dc) { computeAbacusComplexity(rsrc, dc); computeAbacusComplexityDistribution(rsrc, dc); } AbacusDecorator(Settings settings); @DependsUpon List<Metric> dependsOn(); @DependedUpon List<Metric> dependedOn(); boolean shouldExecuteOnProject(Project project); void decorate(Resource rsrc, DecoratorContext dc);  }