@Test public void testAbacusComplexityDistributionOnDecorateDirectory() { List<Measure> childrenMeasures = Arrays.asList( new Measure(AbacusMetrics.ABACUS_COMPLEXITY, "Simple"), new Measure(AbacusMetrics.ABACUS_COMPLEXITY, "Simple"), new Measure(AbacusMetrics.ABACUS_COMPLEXITY, "Complex"), new Measure(AbacusMetrics.ABACUS_COMPLEXITY, "Complex"), new Measure(AbacusMetrics.ABACUS_COMPLEXITY, "Complex"), new Measure(AbacusMetrics.ABACUS_COMPLEXITY, "Complex"), new Measure(AbacusMetrics.ABACUS_COMPLEXITY, "Very complex")); when(dc.getChildrenMeasures(AbacusMetrics.ABACUS_COMPLEXITY)).thenReturn(childrenMeasures); abacusDecorator.decorate(new Directory("myDirectory"), dc); verify(dc).saveMeasure(argThat(new IsMeasure(AbacusMetrics.ABACUS_COMPLEXITY_DISTRIBUTION, "Simple=2;Medium=0;Complex=4;Very complex=1"))); }
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);  }