@Test public void testGetPaths_HandlesCycles() throws Exception { DependencyNode root = parse( "cycle.txt" ); PathRecordingDependencyVisitor visitor = new PathRecordingDependencyVisitor( new ArtifactMatcher(), false ); root.accept( visitor ); List<List<DependencyNode>> paths = visitor.getPaths(); assertEquals( paths.toString(), 4, paths.size() ); assertPath( paths.get( 0 ), "a", "b", "x" ); assertPath( paths.get( 1 ), "a", "x" ); assertPath( paths.get( 2 ), "a", "x", "b", "x" ); assertPath( paths.get( 3 ), "a", "x", "x" ); }
public List<List<DependencyNode>> getPaths() { return paths; }
PathRecordingDependencyVisitor implements DependencyVisitor { public List<List<DependencyNode>> getPaths() { return paths; } }
PathRecordingDependencyVisitor implements DependencyVisitor { public List<List<DependencyNode>> getPaths() { return paths; } PathRecordingDependencyVisitor( DependencyFilter filter );  PathRecordingDependencyVisitor( DependencyFilter filter, boolean excludeChildrenOfMatches ); }
PathRecordingDependencyVisitor implements DependencyVisitor { public List<List<DependencyNode>> getPaths() { return paths; } PathRecordingDependencyVisitor( DependencyFilter filter );  PathRecordingDependencyVisitor( DependencyFilter filter, boolean excludeChildrenOfMatches ); DependencyFilter getFilter(); List<List<DependencyNode>> getPaths(); boolean visitEnter( DependencyNode node ); boolean visitLeave( DependencyNode node ); }
PathRecordingDependencyVisitor implements DependencyVisitor { public List<List<DependencyNode>> getPaths() { return paths; } PathRecordingDependencyVisitor( DependencyFilter filter );  PathRecordingDependencyVisitor( DependencyFilter filter, boolean excludeChildrenOfMatches ); DependencyFilter getFilter(); List<List<DependencyNode>> getPaths(); boolean visitEnter( DependencyNode node ); boolean visitLeave( DependencyNode node );  }