@Test public void testTraverseDependency() { Dependency dependency = new Dependency( new DefaultArtifact( "g:a:v:1" ), "runtime" ); DependencyTraverser traverser = new AndDependencyTraverser(); assertTrue( traverser.traverseDependency( dependency ) ); traverser = new AndDependencyTraverser( new DummyDependencyTraverser( false ), new DummyDependencyTraverser( false ) ); assertFalse( traverser.traverseDependency( dependency ) ); traverser = new AndDependencyTraverser( new DummyDependencyTraverser( true ), new DummyDependencyTraverser( false ) ); assertFalse( traverser.traverseDependency( dependency ) ); traverser = new AndDependencyTraverser( new DummyDependencyTraverser( true ), new DummyDependencyTraverser( true ) ); assertTrue( traverser.traverseDependency( dependency ) ); }
public boolean traverseDependency( Dependency dependency ) { for ( DependencyTraverser traverser : traversers ) { if ( !traverser.traverseDependency( dependency ) ) { return false; } } return true; }
AndDependencyTraverser implements DependencyTraverser { public boolean traverseDependency( Dependency dependency ) { for ( DependencyTraverser traverser : traversers ) { if ( !traverser.traverseDependency( dependency ) ) { return false; } } return true; } }
AndDependencyTraverser implements DependencyTraverser { public boolean traverseDependency( Dependency dependency ) { for ( DependencyTraverser traverser : traversers ) { if ( !traverser.traverseDependency( dependency ) ) { return false; } } return true; } AndDependencyTraverser( DependencyTraverser... traversers );  AndDependencyTraverser( Collection<? extends DependencyTraverser> traversers ); private  AndDependencyTraverser( Set<DependencyTraverser> traversers ); }
AndDependencyTraverser implements DependencyTraverser { public boolean traverseDependency( Dependency dependency ) { for ( DependencyTraverser traverser : traversers ) { if ( !traverser.traverseDependency( dependency ) ) { return false; } } return true; } AndDependencyTraverser( DependencyTraverser... traversers );  AndDependencyTraverser( Collection<? extends DependencyTraverser> traversers ); private  AndDependencyTraverser( Set<DependencyTraverser> traversers ); static DependencyTraverser newInstance( DependencyTraverser traverser1, DependencyTraverser traverser2 ); boolean traverseDependency( Dependency dependency ); DependencyTraverser deriveChildTraverser( DependencyCollectionContext context ); @Override boolean equals( Object obj ); @Override int hashCode(); }
AndDependencyTraverser implements DependencyTraverser { public boolean traverseDependency( Dependency dependency ) { for ( DependencyTraverser traverser : traversers ) { if ( !traverser.traverseDependency( dependency ) ) { return false; } } return true; } AndDependencyTraverser( DependencyTraverser... traversers );  AndDependencyTraverser( Collection<? extends DependencyTraverser> traversers ); private  AndDependencyTraverser( Set<DependencyTraverser> traversers ); static DependencyTraverser newInstance( DependencyTraverser traverser1, DependencyTraverser traverser2 ); boolean traverseDependency( Dependency dependency ); DependencyTraverser deriveChildTraverser( DependencyCollectionContext context ); @Override boolean equals( Object obj ); @Override int hashCode();  }