コード例 #1
0
 @SuppressWarnings("unchecked")
 @Test
 public void shouldNotReportSingleItemComponents() {
   classGraph.addEdge(dep(foo, bar, AccessType.COMPOSED), foo, bar);
   testee.analyse(new CodeGraphs(classGraph), r);
   verify(r, never()).visitClassStronglyConnectedComponent(any(DirectedGraph.class));
 }
コード例 #2
0
  @SuppressWarnings("unchecked")
  @Test
  public void shouldNotBreakDownSmallConnectedPackageComponents() {
    classGraph.addEdge(dep(foo, bar, AccessType.COMPOSED), foo, bar);
    classGraph.addEdge(dep(bar, foo, AccessType.COMPOSED), bar, foo);

    testee.analyse(new CodeGraphs(classGraph), r);
    verify(r).visitPackageStronglyConnectedComponent(any(DirectedGraph.class));
    verify(r, never()).visitSubCycle(any(DirectedGraph.class));
  }
コード例 #3
0
  @SuppressWarnings("unchecked")
  @Test
  public void shouldFindAndBreakDownStronglyConnectedClassComponentsLargerThanThreshold() {
    classGraph.addEdge(dep(foo, bar, AccessType.COMPOSED), foo, bar);
    classGraph.addEdge(dep(foo, bar, AccessType.COMPOSED), bar, far);
    classGraph.addEdge(dep(foo, bar, AccessType.COMPOSED), far, foo);

    testee.analyse(new CodeGraphs(classGraph), r);
    verify(r).visitClassStronglyConnectedComponent(any(DirectedGraph.class));
    verify(r).endClassStronglyConnectedComponent(any(DirectedGraph.class));
    verify(r).visitClassSubCycle(any(DirectedGraph.class));
  }
コード例 #4
0
 @Test
 public void shouldSendCodeStatsToVisitor() {
   classGraph.addEdge(dep(foo, bar, AccessType.COMPOSED), foo, bar);
   testee.analyse(new CodeGraphs(classGraph), r);
   verify(r).start(any(CodeStats.class));
 }
コード例 #5
0
 @Test
 public void shouldSignalEndOfAnalysis() {
   testee.analyse(new CodeGraphs(classGraph), r);
   verify(r).end();
 }