@Test public void acceptTestCornerCases() { NodeBuilder builder = new NodeBuilder(); builder.artifactId( "testArtifact" ); DependencyNode node = builder.build(); List<DependencyNode> parents = new LinkedList<DependencyNode>(); assertTrue( accept( node, "" ) ); assertFalse( new PatternInclusionsDependencyFilter( new LinkedList<String>() ).accept( node, parents ) ); assertFalse( new PatternInclusionsDependencyFilter( (String[]) null ).accept( node, parents ) ); assertFalse( new PatternInclusionsDependencyFilter( (VersionScheme) null, "[1,10]" ).accept( node, parents ) ); }
public boolean accept( final DependencyNode node, List<DependencyNode> parents ) { final Dependency dependency = node.getDependency(); if ( dependency == null ) { return true; } final Artifact artifact = dependency.getArtifact(); for ( final String pattern : patterns ) { final boolean matched = accept( artifact, pattern ); if ( matched ) { return true; } } return false; }
PatternInclusionsDependencyFilter implements DependencyFilter { public boolean accept( final DependencyNode node, List<DependencyNode> parents ) { final Dependency dependency = node.getDependency(); if ( dependency == null ) { return true; } final Artifact artifact = dependency.getArtifact(); for ( final String pattern : patterns ) { final boolean matched = accept( artifact, pattern ); if ( matched ) { return true; } } return false; } }
PatternInclusionsDependencyFilter implements DependencyFilter { public boolean accept( final DependencyNode node, List<DependencyNode> parents ) { final Dependency dependency = node.getDependency(); if ( dependency == null ) { return true; } final Artifact artifact = dependency.getArtifact(); for ( final String pattern : patterns ) { final boolean matched = accept( artifact, pattern ); if ( matched ) { return true; } } return false; } PatternInclusionsDependencyFilter( final String... patterns );  PatternInclusionsDependencyFilter( final VersionScheme versionScheme, final String... patterns );  PatternInclusionsDependencyFilter( final Collection<String> patterns );  PatternInclusionsDependencyFilter( final VersionScheme versionScheme, final Collection<String> patterns ); }
PatternInclusionsDependencyFilter implements DependencyFilter { public boolean accept( final DependencyNode node, List<DependencyNode> parents ) { final Dependency dependency = node.getDependency(); if ( dependency == null ) { return true; } final Artifact artifact = dependency.getArtifact(); for ( final String pattern : patterns ) { final boolean matched = accept( artifact, pattern ); if ( matched ) { return true; } } return false; } PatternInclusionsDependencyFilter( final String... patterns );  PatternInclusionsDependencyFilter( final VersionScheme versionScheme, final String... patterns );  PatternInclusionsDependencyFilter( final Collection<String> patterns );  PatternInclusionsDependencyFilter( final VersionScheme versionScheme, final Collection<String> patterns ); boolean accept( final DependencyNode node, List<DependencyNode> parents ); @Override boolean equals( final Object obj ); @Override int hashCode(); }
PatternInclusionsDependencyFilter implements DependencyFilter { public boolean accept( final DependencyNode node, List<DependencyNode> parents ) { final Dependency dependency = node.getDependency(); if ( dependency == null ) { return true; } final Artifact artifact = dependency.getArtifact(); for ( final String pattern : patterns ) { final boolean matched = accept( artifact, pattern ); if ( matched ) { return true; } } return false; } PatternInclusionsDependencyFilter( final String... patterns );  PatternInclusionsDependencyFilter( final VersionScheme versionScheme, final String... patterns );  PatternInclusionsDependencyFilter( final Collection<String> patterns );  PatternInclusionsDependencyFilter( final VersionScheme versionScheme, final Collection<String> patterns ); boolean accept( final DependencyNode node, List<DependencyNode> parents ); @Override boolean equals( final Object obj ); @Override int hashCode();  }