maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject svn commit: r1694580 [1/2] - in /maven/shared/trunk/maven-common-artifact-filters/src: main/java/org/apache/maven/shared/artifact/filter/resolve/ main/java/org/apache/maven/shared/artifact/filter/resolve/transform/ test/java/org/apache/maven/shared/art...
Date Thu, 06 Aug 2015 21:52:08 GMT
Author: rfscholte
Date: Thu Aug  6 21:52:07 2015
New Revision: 1694580

URL: http://svn.apache.org/r1694580
Log:
Set svn EOL to native

Modified:
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/AbstractFilter.java   (contents, props changed)
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/Node.java   (contents, props changed)
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeFilterTransformer.java   (contents, props changed)
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeNode.java   (contents, props changed)
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherNode.java   (contents, props changed)
    maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/SonatypeAetherNode.java   (contents, props changed)
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeFilterTransformerTest.java   (contents, props changed)
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeNodeTest.java   (contents, props changed)
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherNodeTest.java   (contents, props changed)
    maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/SonatypeAetherNodeTest.java   (contents, props changed)

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/AbstractFilter.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/AbstractFilter.java?rev=1694580&r1=1694579&r2=1694580&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/AbstractFilter.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/AbstractFilter.java Thu Aug  6 21:52:07 2015
@@ -1,40 +1,40 @@
-package org.apache.maven.shared.artifact.filter.resolve;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.util.List;
-
-/**
- * Abstract filter for custom implementations
- * 
- * @author Robert Scholte
- * @since 3.0
- */
-public abstract class AbstractFilter implements TransformableFilter
-{
-
-    @Override
-    public final <T> T transform( FilterTransformer<T> transformer )
-    {
-        return transformer.transform( this );
-    }
-
-    public abstract boolean accept( Node node, List<Node> parents );
-}
+package org.apache.maven.shared.artifact.filter.resolve;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.List;
+
+/**
+ * Abstract filter for custom implementations
+ * 
+ * @author Robert Scholte
+ * @since 3.0
+ */
+public abstract class AbstractFilter implements TransformableFilter
+{
+
+    @Override
+    public final <T> T transform( FilterTransformer<T> transformer )
+    {
+        return transformer.transform( this );
+    }
+
+    public abstract boolean accept( Node node, List<Node> parents );
+}

Propchange: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/AbstractFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/Node.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/Node.java?rev=1694580&r1=1694579&r2=1694580&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/Node.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/Node.java Thu Aug  6 21:52:07 2015
@@ -1,33 +1,33 @@
-package org.apache.maven.shared.artifact.filter.resolve;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Represents a node of a dependency graph
- * 
- * @author Robert Scholte
- * @since 3.0
- *
- */
-public interface Node
-{
-    org.apache.maven.model.Dependency getDependency();
-
-}
+package org.apache.maven.shared.artifact.filter.resolve;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Represents a node of a dependency graph
+ * 
+ * @author Robert Scholte
+ * @since 3.0
+ *
+ */
+public interface Node
+{
+    org.apache.maven.model.Dependency getDependency();
+
+}

Propchange: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/Node.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeFilterTransformer.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeFilterTransformer.java?rev=1694580&r1=1694579&r2=1694580&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeFilterTransformer.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeFilterTransformer.java Thu Aug  6 21:52:07 2015
@@ -1,158 +1,158 @@
-package org.apache.maven.shared.artifact.filter.resolve.transform;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
-import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter;
-import org.apache.maven.shared.artifact.filter.PatternExcludesArtifactFilter;
-import org.apache.maven.shared.artifact.filter.PatternIncludesArtifactFilter;
-import org.apache.maven.shared.artifact.filter.resolve.AbstractFilter;
-import org.apache.maven.shared.artifact.filter.resolve.AndFilter;
-import org.apache.maven.shared.artifact.filter.resolve.ExclusionsFilter;
-import org.apache.maven.shared.artifact.filter.resolve.FilterTransformer;
-import org.apache.maven.shared.artifact.filter.resolve.OrFilter;
-import org.apache.maven.shared.artifact.filter.resolve.PatternExclusionsFilter;
-import org.apache.maven.shared.artifact.filter.resolve.PatternInclusionsFilter;
-import org.apache.maven.shared.artifact.filter.resolve.ScopeFilter;
-import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter;
-
-/**
- * Makes it possible to use the TransformableFilters for Aether and as classic Maven ArtifactFilter. 
- * 
- * <strong>Note:</strong> the {@link AndFilter} and {@link ExclusionsFilter} are transformed to {@link ArtifactFilter}
- * implementations of Maven Core
- * 
- * @author Robert Scholte
- * @since 3.0
- */
-public class ArtifactIncludeFilterTransformer implements FilterTransformer<ArtifactFilter>
-{
-
-    @Override
-    public ArtifactFilter transform( final ScopeFilter scopeFilter )
-    {
-        return new ArtifactFilter()
-        {
-            @Override
-            public boolean include( Artifact artifact )
-            {
-                boolean isIncluded;
-                
-                if ( scopeFilter.getIncluded() != null )
-                {
-                    isIncluded = scopeFilter.getIncluded().contains( artifact.getScope() );
-                }
-                else
-                {
-                    isIncluded = true;
-                }
-                
-                boolean isExcluded;
-
-                if ( scopeFilter.getExcluded() != null )
-                {
-                    isExcluded = scopeFilter.getExcluded().contains( artifact.getScope() ); 
-                }
-                else
-                {
-                    isExcluded = false;
-                }
-
-                return isIncluded && !isExcluded;
-            }
-        };
-    }
-
-    @Override
-    public AndArtifactFilter transform( AndFilter andFilter )
-    {
-        AndArtifactFilter filter = new AndArtifactFilter();
-
-        for ( TransformableFilter subFilter : andFilter.getFilters() )
-        {
-            filter.add( subFilter.transform( this ) );
-        }
-
-        return filter;
-    }
-
-    @Override
-    public ArtifactFilter transform( final ExclusionsFilter exclusionsFilter )
-    {
-        return new ExcludesArtifactFilter( new ArrayList<String>( exclusionsFilter.getExcludes() ) );
-    }
-
-    @Override
-    public ArtifactFilter transform( OrFilter orFilter )
-    {
-        final Collection<ArtifactFilter> filters = new ArrayList<ArtifactFilter>( orFilter.getFilters().size() );
-
-        for ( TransformableFilter subFilter : orFilter.getFilters() )
-        {
-            filters.add( subFilter.transform( this ) );
-        }
-
-        return new ArtifactFilter()
-        {
-            @Override
-            public boolean include( Artifact artifact )
-            {
-                for ( ArtifactFilter filter : filters )
-                {
-                    if ( filter.include( artifact ) )
-                    {
-                        return true;
-                    }
-                }
-                return false;
-            }
-        };
-    }
-
-    @Override
-    public ArtifactFilter transform( PatternExclusionsFilter patternExclusionsFilter )
-    {
-        return new PatternExcludesArtifactFilter( patternExclusionsFilter.getExcludes() );
-    }
-
-    @Override
-    public ArtifactFilter transform( PatternInclusionsFilter patternInclusionsFilter )
-    {
-        return new PatternIncludesArtifactFilter( patternInclusionsFilter.getIncludes() );
-    }
-
-    @Override
-    public ArtifactFilter transform( final AbstractFilter filter )
-    {
-        return new ArtifactFilter()
-        {
-            @Override
-            public boolean include( Artifact artifact )
-            {
-                return filter.accept( new ArtifactIncludeNode( artifact ), null );
-            }
-        };
-    }
-}
+package org.apache.maven.shared.artifact.filter.resolve.transform;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter;
+import org.apache.maven.shared.artifact.filter.PatternExcludesArtifactFilter;
+import org.apache.maven.shared.artifact.filter.PatternIncludesArtifactFilter;
+import org.apache.maven.shared.artifact.filter.resolve.AbstractFilter;
+import org.apache.maven.shared.artifact.filter.resolve.AndFilter;
+import org.apache.maven.shared.artifact.filter.resolve.ExclusionsFilter;
+import org.apache.maven.shared.artifact.filter.resolve.FilterTransformer;
+import org.apache.maven.shared.artifact.filter.resolve.OrFilter;
+import org.apache.maven.shared.artifact.filter.resolve.PatternExclusionsFilter;
+import org.apache.maven.shared.artifact.filter.resolve.PatternInclusionsFilter;
+import org.apache.maven.shared.artifact.filter.resolve.ScopeFilter;
+import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter;
+
+/**
+ * Makes it possible to use the TransformableFilters for Aether and as classic Maven ArtifactFilter. 
+ * 
+ * <strong>Note:</strong> the {@link AndFilter} and {@link ExclusionsFilter} are transformed to {@link ArtifactFilter}
+ * implementations of Maven Core
+ * 
+ * @author Robert Scholte
+ * @since 3.0
+ */
+public class ArtifactIncludeFilterTransformer implements FilterTransformer<ArtifactFilter>
+{
+
+    @Override
+    public ArtifactFilter transform( final ScopeFilter scopeFilter )
+    {
+        return new ArtifactFilter()
+        {
+            @Override
+            public boolean include( Artifact artifact )
+            {
+                boolean isIncluded;
+                
+                if ( scopeFilter.getIncluded() != null )
+                {
+                    isIncluded = scopeFilter.getIncluded().contains( artifact.getScope() );
+                }
+                else
+                {
+                    isIncluded = true;
+                }
+                
+                boolean isExcluded;
+
+                if ( scopeFilter.getExcluded() != null )
+                {
+                    isExcluded = scopeFilter.getExcluded().contains( artifact.getScope() ); 
+                }
+                else
+                {
+                    isExcluded = false;
+                }
+
+                return isIncluded && !isExcluded;
+            }
+        };
+    }
+
+    @Override
+    public AndArtifactFilter transform( AndFilter andFilter )
+    {
+        AndArtifactFilter filter = new AndArtifactFilter();
+
+        for ( TransformableFilter subFilter : andFilter.getFilters() )
+        {
+            filter.add( subFilter.transform( this ) );
+        }
+
+        return filter;
+    }
+
+    @Override
+    public ArtifactFilter transform( final ExclusionsFilter exclusionsFilter )
+    {
+        return new ExcludesArtifactFilter( new ArrayList<String>( exclusionsFilter.getExcludes() ) );
+    }
+
+    @Override
+    public ArtifactFilter transform( OrFilter orFilter )
+    {
+        final Collection<ArtifactFilter> filters = new ArrayList<ArtifactFilter>( orFilter.getFilters().size() );
+
+        for ( TransformableFilter subFilter : orFilter.getFilters() )
+        {
+            filters.add( subFilter.transform( this ) );
+        }
+
+        return new ArtifactFilter()
+        {
+            @Override
+            public boolean include( Artifact artifact )
+            {
+                for ( ArtifactFilter filter : filters )
+                {
+                    if ( filter.include( artifact ) )
+                    {
+                        return true;
+                    }
+                }
+                return false;
+            }
+        };
+    }
+
+    @Override
+    public ArtifactFilter transform( PatternExclusionsFilter patternExclusionsFilter )
+    {
+        return new PatternExcludesArtifactFilter( patternExclusionsFilter.getExcludes() );
+    }
+
+    @Override
+    public ArtifactFilter transform( PatternInclusionsFilter patternInclusionsFilter )
+    {
+        return new PatternIncludesArtifactFilter( patternInclusionsFilter.getIncludes() );
+    }
+
+    @Override
+    public ArtifactFilter transform( final AbstractFilter filter )
+    {
+        return new ArtifactFilter()
+        {
+            @Override
+            public boolean include( Artifact artifact )
+            {
+                return filter.accept( new ArtifactIncludeNode( artifact ), null );
+            }
+        };
+    }
+}

Propchange: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeFilterTransformer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeNode.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeNode.java?rev=1694580&r1=1694579&r2=1694580&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeNode.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeNode.java Thu Aug  6 21:52:07 2015
@@ -1,64 +1,64 @@
-package org.apache.maven.shared.artifact.filter.resolve.transform;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.model.Dependency;
-import org.apache.maven.shared.artifact.filter.resolve.Node;
-
-/**
- * 
- * @author Robert Scholte
- * @since 3.0
- */
-class ArtifactIncludeNode implements Node
-{
-    private final Artifact artifact;
-    
-    public ArtifactIncludeNode( Artifact artifact )
-    {
-        this.artifact = artifact;
-    }
-    
-    /**
-     * Note: an artifact doesn't contain exclusion information, so it won't be available here.
-     * When required switch to filtering based on Aether
-     * 
-     * @see EclipseAetherNode
-     * @see SonatypeAetherNode
-     */
-    @Override
-    public Dependency getDependency()
-    {
-        org.apache.maven.model.Dependency mavenDependency = new org.apache.maven.model.Dependency();
-        mavenDependency.setGroupId( artifact.getGroupId() );
-        mavenDependency.setArtifactId( artifact.getArtifactId() );
-        mavenDependency.setVersion( artifact.getVersion() );
-        mavenDependency.setClassifier( artifact.getClassifier() );
-        mavenDependency.setType( artifact.getType() );
-        mavenDependency.setScope( artifact.getScope() );
-        mavenDependency.setOptional( artifact.isOptional() );
-        // no setExcludes possible
-        
-        return mavenDependency;
-    }
-
-    
-}
+package org.apache.maven.shared.artifact.filter.resolve.transform;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.shared.artifact.filter.resolve.Node;
+
+/**
+ * 
+ * @author Robert Scholte
+ * @since 3.0
+ */
+class ArtifactIncludeNode implements Node
+{
+    private final Artifact artifact;
+    
+    public ArtifactIncludeNode( Artifact artifact )
+    {
+        this.artifact = artifact;
+    }
+    
+    /**
+     * Note: an artifact doesn't contain exclusion information, so it won't be available here.
+     * When required switch to filtering based on Aether
+     * 
+     * @see EclipseAetherNode
+     * @see SonatypeAetherNode
+     */
+    @Override
+    public Dependency getDependency()
+    {
+        org.apache.maven.model.Dependency mavenDependency = new org.apache.maven.model.Dependency();
+        mavenDependency.setGroupId( artifact.getGroupId() );
+        mavenDependency.setArtifactId( artifact.getArtifactId() );
+        mavenDependency.setVersion( artifact.getVersion() );
+        mavenDependency.setClassifier( artifact.getClassifier() );
+        mavenDependency.setType( artifact.getType() );
+        mavenDependency.setScope( artifact.getScope() );
+        mavenDependency.setOptional( artifact.isOptional() );
+        // no setExcludes possible
+        
+        return mavenDependency;
+    }
+
+    
+}

Propchange: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeNode.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherNode.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherNode.java?rev=1694580&r1=1694579&r2=1694580&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherNode.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherNode.java Thu Aug  6 21:52:07 2015
@@ -1,91 +1,91 @@
-package org.apache.maven.shared.artifact.filter.resolve.transform;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.maven.shared.artifact.filter.resolve.Node;
-import org.eclipse.aether.artifact.ArtifactProperties;
-import org.eclipse.aether.graph.Dependency;
-import org.eclipse.aether.graph.DependencyNode;
-import org.eclipse.aether.graph.Exclusion;
-
-/**
- * Adapter of an Eclipse Aether DependencyNode for common Node 
- * 
- * @author Robert Scholte
- * @since 3.0
- */
-class EclipseAetherNode implements Node
-{
-
-    private final DependencyNode node;
-
-    EclipseAetherNode( DependencyNode node )
-    {
-        this.node = node;
-    }
-
-    @Override
-    public org.apache.maven.model.Dependency getDependency()
-    {
-        Dependency nodeDependency = node.getDependency();
-
-        if ( nodeDependency == null )
-        {
-            return null;
-        }
-
-        org.apache.maven.model.Dependency mavenDependency = new org.apache.maven.model.Dependency();
-        mavenDependency.setGroupId( nodeDependency.getArtifact().getGroupId() );
-        mavenDependency.setArtifactId( nodeDependency.getArtifact().getArtifactId() );
-        mavenDependency.setVersion( nodeDependency.getArtifact().getVersion() );
-        mavenDependency.setClassifier( nodeDependency.getArtifact().getClassifier() );
-        mavenDependency.setType( nodeDependency.getArtifact().getProperty( ArtifactProperties.TYPE, null ) );
-        mavenDependency.setScope( nodeDependency.getScope() );
-        // Eclipse Aether supports three-valued logic
-        if ( nodeDependency.getOptional() != null )
-        {
-            mavenDependency.setOptional( nodeDependency.isOptional() );
-        }
-        if ( nodeDependency.getExclusions() != null )
-        {
-            List<org.apache.maven.model.Exclusion> mavenExclusions =
-                new ArrayList<org.apache.maven.model.Exclusion>( nodeDependency.getExclusions().size() );
-
-            for ( Exclusion aetherExclusion : nodeDependency.getExclusions() )
-            {
-                org.apache.maven.model.Exclusion mavenExclusion = new org.apache.maven.model.Exclusion();
-
-                mavenExclusion.setGroupId( aetherExclusion.getGroupId() );
-                mavenExclusion.setArtifactId( aetherExclusion.getArtifactId() );
-                // that's all folks, although Aether has more metadata
-
-                mavenExclusions.add( mavenExclusion );
-            }
-
-            mavenDependency.setExclusions( mavenExclusions );
-        }
-
-        return mavenDependency;
-    }
-     
-}
+package org.apache.maven.shared.artifact.filter.resolve.transform;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.shared.artifact.filter.resolve.Node;
+import org.eclipse.aether.artifact.ArtifactProperties;
+import org.eclipse.aether.graph.Dependency;
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.graph.Exclusion;
+
+/**
+ * Adapter of an Eclipse Aether DependencyNode for common Node 
+ * 
+ * @author Robert Scholte
+ * @since 3.0
+ */
+class EclipseAetherNode implements Node
+{
+
+    private final DependencyNode node;
+
+    EclipseAetherNode( DependencyNode node )
+    {
+        this.node = node;
+    }
+
+    @Override
+    public org.apache.maven.model.Dependency getDependency()
+    {
+        Dependency nodeDependency = node.getDependency();
+
+        if ( nodeDependency == null )
+        {
+            return null;
+        }
+
+        org.apache.maven.model.Dependency mavenDependency = new org.apache.maven.model.Dependency();
+        mavenDependency.setGroupId( nodeDependency.getArtifact().getGroupId() );
+        mavenDependency.setArtifactId( nodeDependency.getArtifact().getArtifactId() );
+        mavenDependency.setVersion( nodeDependency.getArtifact().getVersion() );
+        mavenDependency.setClassifier( nodeDependency.getArtifact().getClassifier() );
+        mavenDependency.setType( nodeDependency.getArtifact().getProperty( ArtifactProperties.TYPE, null ) );
+        mavenDependency.setScope( nodeDependency.getScope() );
+        // Eclipse Aether supports three-valued logic
+        if ( nodeDependency.getOptional() != null )
+        {
+            mavenDependency.setOptional( nodeDependency.isOptional() );
+        }
+        if ( nodeDependency.getExclusions() != null )
+        {
+            List<org.apache.maven.model.Exclusion> mavenExclusions =
+                new ArrayList<org.apache.maven.model.Exclusion>( nodeDependency.getExclusions().size() );
+
+            for ( Exclusion aetherExclusion : nodeDependency.getExclusions() )
+            {
+                org.apache.maven.model.Exclusion mavenExclusion = new org.apache.maven.model.Exclusion();
+
+                mavenExclusion.setGroupId( aetherExclusion.getGroupId() );
+                mavenExclusion.setArtifactId( aetherExclusion.getArtifactId() );
+                // that's all folks, although Aether has more metadata
+
+                mavenExclusions.add( mavenExclusion );
+            }
+
+            mavenDependency.setExclusions( mavenExclusions );
+        }
+
+        return mavenDependency;
+    }
+     
+}

Propchange: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherNode.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/SonatypeAetherNode.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/SonatypeAetherNode.java?rev=1694580&r1=1694579&r2=1694580&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/SonatypeAetherNode.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/SonatypeAetherNode.java Thu Aug  6 21:52:07 2015
@@ -1,88 +1,88 @@
-package org.apache.maven.shared.artifact.filter.resolve.transform;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.maven.shared.artifact.filter.resolve.Node;
-import org.sonatype.aether.graph.Dependency;
-import org.sonatype.aether.graph.DependencyNode;
-import org.sonatype.aether.graph.Exclusion;
-import org.sonatype.aether.util.artifact.ArtifactProperties;
-
-/**
- * Adapter of a Sonatype Aether DependencyNode for common Node
- * 
- * @author Robert Scholte
- * @since 3.0
- */
-class SonatypeAetherNode implements Node
-{
-
-    private final DependencyNode node;
-
-    SonatypeAetherNode( DependencyNode node )
-    {
-        this.node = node;
-    }
-
-
-    @Override
-    public org.apache.maven.model.Dependency getDependency()
-    {
-        Dependency nodeDependency = node.getDependency();
-
-        if ( nodeDependency == null )
-        {
-            return null;
-        }
-        
-        org.apache.maven.model.Dependency mavenDependency = new org.apache.maven.model.Dependency();
-        mavenDependency.setGroupId( nodeDependency.getArtifact().getGroupId() );
-        mavenDependency.setArtifactId( nodeDependency.getArtifact().getArtifactId() );
-        mavenDependency.setVersion( nodeDependency.getArtifact().getVersion() );
-        mavenDependency.setClassifier( nodeDependency.getArtifact().getClassifier() );
-        mavenDependency.setType( nodeDependency.getArtifact().getProperty( ArtifactProperties.TYPE, null ) );
-        mavenDependency.setScope( nodeDependency.getScope() );
-        mavenDependency.setOptional( nodeDependency.isOptional() );
-        if ( nodeDependency.getExclusions() != null )
-        {
-            List<org.apache.maven.model.Exclusion> mavenExclusions =
-                new ArrayList<org.apache.maven.model.Exclusion>( nodeDependency.getExclusions().size() );
-
-            for ( Exclusion aetherExclusion : nodeDependency.getExclusions() )
-            {
-                org.apache.maven.model.Exclusion mavenExclusion = new org.apache.maven.model.Exclusion();
-
-                mavenExclusion.setGroupId( aetherExclusion.getGroupId() );
-                mavenExclusion.setArtifactId( aetherExclusion.getArtifactId() );
-                // that's all folks, although Aether has more metadata
-
-                mavenExclusions.add( mavenExclusion );
-            }
-
-            mavenDependency.setExclusions( mavenExclusions );
-        }
-
-        return mavenDependency;
-    }
-     
-}
+package org.apache.maven.shared.artifact.filter.resolve.transform;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.shared.artifact.filter.resolve.Node;
+import org.sonatype.aether.graph.Dependency;
+import org.sonatype.aether.graph.DependencyNode;
+import org.sonatype.aether.graph.Exclusion;
+import org.sonatype.aether.util.artifact.ArtifactProperties;
+
+/**
+ * Adapter of a Sonatype Aether DependencyNode for common Node
+ * 
+ * @author Robert Scholte
+ * @since 3.0
+ */
+class SonatypeAetherNode implements Node
+{
+
+    private final DependencyNode node;
+
+    SonatypeAetherNode( DependencyNode node )
+    {
+        this.node = node;
+    }
+
+
+    @Override
+    public org.apache.maven.model.Dependency getDependency()
+    {
+        Dependency nodeDependency = node.getDependency();
+
+        if ( nodeDependency == null )
+        {
+            return null;
+        }
+        
+        org.apache.maven.model.Dependency mavenDependency = new org.apache.maven.model.Dependency();
+        mavenDependency.setGroupId( nodeDependency.getArtifact().getGroupId() );
+        mavenDependency.setArtifactId( nodeDependency.getArtifact().getArtifactId() );
+        mavenDependency.setVersion( nodeDependency.getArtifact().getVersion() );
+        mavenDependency.setClassifier( nodeDependency.getArtifact().getClassifier() );
+        mavenDependency.setType( nodeDependency.getArtifact().getProperty( ArtifactProperties.TYPE, null ) );
+        mavenDependency.setScope( nodeDependency.getScope() );
+        mavenDependency.setOptional( nodeDependency.isOptional() );
+        if ( nodeDependency.getExclusions() != null )
+        {
+            List<org.apache.maven.model.Exclusion> mavenExclusions =
+                new ArrayList<org.apache.maven.model.Exclusion>( nodeDependency.getExclusions().size() );
+
+            for ( Exclusion aetherExclusion : nodeDependency.getExclusions() )
+            {
+                org.apache.maven.model.Exclusion mavenExclusion = new org.apache.maven.model.Exclusion();
+
+                mavenExclusion.setGroupId( aetherExclusion.getGroupId() );
+                mavenExclusion.setArtifactId( aetherExclusion.getArtifactId() );
+                // that's all folks, although Aether has more metadata
+
+                mavenExclusions.add( mavenExclusion );
+            }
+
+            mavenDependency.setExclusions( mavenExclusions );
+        }
+
+        return mavenDependency;
+    }
+     
+}

Propchange: maven/shared/trunk/maven-common-artifact-filters/src/main/java/org/apache/maven/shared/artifact/filter/resolve/transform/SonatypeAetherNode.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeFilterTransformerTest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeFilterTransformerTest.java?rev=1694580&r1=1694579&r2=1694580&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeFilterTransformerTest.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeFilterTransformerTest.java Thu Aug  6 21:52:07 2015
@@ -1,171 +1,171 @@
-package org.apache.maven.shared.artifact.filter.resolve.transform;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.ArtifactUtils;
-import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
-import org.apache.maven.plugin.testing.ArtifactStubFactory;
-import org.apache.maven.shared.artifact.filter.PatternExcludesArtifactFilter;
-import org.apache.maven.shared.artifact.filter.PatternIncludesArtifactFilter;
-import org.apache.maven.shared.artifact.filter.resolve.AbstractFilter;
-import org.apache.maven.shared.artifact.filter.resolve.AndFilter;
-import org.apache.maven.shared.artifact.filter.resolve.ExclusionsFilter;
-import org.apache.maven.shared.artifact.filter.resolve.Node;
-import org.apache.maven.shared.artifact.filter.resolve.OrFilter;
-import org.apache.maven.shared.artifact.filter.resolve.PatternExclusionsFilter;
-import org.apache.maven.shared.artifact.filter.resolve.PatternInclusionsFilter;
-import org.apache.maven.shared.artifact.filter.resolve.ScopeFilter;
-import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter;
-import org.junit.Test;
-
-public class ArtifactIncludeFilterTransformerTest
-{
-
-    private ArtifactIncludeFilterTransformer transformer = new ArtifactIncludeFilterTransformer();
-
-    private ArtifactStubFactory artifactFactory = new ArtifactStubFactory();
-
-    @Test
-    public void testTransformAndFilter()
-        throws Exception
-    {
-        AndFilter filter =
-            new AndFilter(
-                           Arrays.<TransformableFilter>asList( ScopeFilter.including( "compile" ),
-                                                        new ExclusionsFilter( Collections.singletonList( "x:a" ) ) ) );
-
-        AndArtifactFilter dependencyFilter = (AndArtifactFilter) filter.transform( transformer );
-
-        assertTrue( dependencyFilter.include( newArtifact( "g:a:v", "compile" ) ) );
-
-        assertFalse( dependencyFilter.include( newArtifact( "x:a:v", "compile" ) ) );
-
-        assertFalse( dependencyFilter.include( newArtifact( "g:a:v", "test" ) ) );
-
-        assertFalse( dependencyFilter.include( newArtifact( "x:a:v", "test" ) ) );
-    }
-
-    @Test
-    public void testTransformExclusionsFilter()
-        throws Exception
-    {
-        ExclusionsFilter filter = new ExclusionsFilter( Collections.singletonList( "x:a" ) );
-
-        ArtifactFilter dependencyFilter = (ArtifactFilter) filter.transform( transformer );
-
-        assertTrue( dependencyFilter.include( newArtifact( "g:a:v", "compile" ) ) );
-
-        assertFalse( dependencyFilter.include( newArtifact( "x:a:v", "compile" ) ) );
-    }
-
-    @Test
-    public void testTransformOrFilter()
-        throws Exception
-    {
-        OrFilter filter =
-            new OrFilter( Arrays.<TransformableFilter>asList( ScopeFilter.including( "compile" ),
-                                                              ScopeFilter.including( "test" ) ) );
-
-        ArtifactFilter dependencyFilter = (ArtifactFilter) filter.transform( transformer );
-
-        assertTrue( dependencyFilter.include( newArtifact( "g:a:v", "compile" ) ) );
-
-        assertTrue( dependencyFilter.include( newArtifact( "g:a:v", "test" ) ) );
-
-        assertFalse( dependencyFilter.include( newArtifact( "g:a:v", "runtime" ) ) );
-    }
-
-    @Test
-    public void testTransformScopeFilter()
-        throws Exception
-    {
-        ScopeFilter filter = ScopeFilter.including( Collections.singletonList( "runtime" ) );
-
-        ArtifactFilter dependencyFilter = (ArtifactFilter) filter.transform( transformer );
-
-        assertTrue( dependencyFilter.include( newArtifact( "g:a:v", "runtime" ) ) );
-
-        assertFalse( dependencyFilter.include( newArtifact( "g:a:v", "compile" ) ) );
-
-        assertFalse( dependencyFilter.include( newArtifact( "g:a:v", "test" ) ) );
-    }
-
-    @Test
-    public void testTransformPatternExclusionsFilter()
-        throws Exception
-    {
-        PatternExclusionsFilter filter = new PatternExclusionsFilter( Collections.singletonList( "x:*" ) );
-
-        PatternExcludesArtifactFilter dependencyFilter = (PatternExcludesArtifactFilter) filter.transform( transformer );
-
-        assertTrue( dependencyFilter.include( newArtifact( "g:a:v", "runtime" ) ) );
-
-        assertFalse( dependencyFilter.include( newArtifact( "x:a:v", "runtime" ) ) );
-    }
-
-    @Test
-    public void testTransformPatternInclusionsFilter()
-        throws Exception
-    {
-        PatternInclusionsFilter filter = new PatternInclusionsFilter( Collections.singletonList( "g:*" ) );
-
-        PatternIncludesArtifactFilter dependencyFilter = (PatternIncludesArtifactFilter) filter.transform( transformer );
-
-        assertTrue( dependencyFilter.include( newArtifact( "g:a:v", "runtime" ) ) );
-
-        assertFalse( dependencyFilter.include( newArtifact( "x:a:v", "runtime" ) ) );
-    }
-    
-    @Test
-    public void testTransformAbstractFilter() throws Exception
-    {
-        AbstractFilter snapshotFilter = new AbstractFilter()
-        {
-            @Override
-            public boolean accept( Node node, List<Node> parents )
-            {
-                return ArtifactUtils.isSnapshot( node.getDependency().getVersion() );
-            }
-        };
-        
-        ArtifactFilter dependencyFilter = snapshotFilter.transform( transformer );
-        
-        assertTrue( dependencyFilter.include( newArtifact( "g:a:1.0-SNAPSHOT", "compile" ) ) );
-
-        assertFalse( dependencyFilter.include( newArtifact( "g:a:1.0", "compile" ) ) );
-    }
-
-    private Artifact newArtifact( String coor, String scope )
-        throws Exception
-    {
-        String[] gav = coor.split( ":" );
-        return artifactFactory.createArtifact( gav[0], gav[1], gav[2], scope );
-    }
-
-}
+package org.apache.maven.shared.artifact.filter.resolve.transform;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.ArtifactUtils;
+import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+import org.apache.maven.plugin.testing.ArtifactStubFactory;
+import org.apache.maven.shared.artifact.filter.PatternExcludesArtifactFilter;
+import org.apache.maven.shared.artifact.filter.PatternIncludesArtifactFilter;
+import org.apache.maven.shared.artifact.filter.resolve.AbstractFilter;
+import org.apache.maven.shared.artifact.filter.resolve.AndFilter;
+import org.apache.maven.shared.artifact.filter.resolve.ExclusionsFilter;
+import org.apache.maven.shared.artifact.filter.resolve.Node;
+import org.apache.maven.shared.artifact.filter.resolve.OrFilter;
+import org.apache.maven.shared.artifact.filter.resolve.PatternExclusionsFilter;
+import org.apache.maven.shared.artifact.filter.resolve.PatternInclusionsFilter;
+import org.apache.maven.shared.artifact.filter.resolve.ScopeFilter;
+import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter;
+import org.junit.Test;
+
+public class ArtifactIncludeFilterTransformerTest
+{
+
+    private ArtifactIncludeFilterTransformer transformer = new ArtifactIncludeFilterTransformer();
+
+    private ArtifactStubFactory artifactFactory = new ArtifactStubFactory();
+
+    @Test
+    public void testTransformAndFilter()
+        throws Exception
+    {
+        AndFilter filter =
+            new AndFilter(
+                           Arrays.<TransformableFilter>asList( ScopeFilter.including( "compile" ),
+                                                        new ExclusionsFilter( Collections.singletonList( "x:a" ) ) ) );
+
+        AndArtifactFilter dependencyFilter = (AndArtifactFilter) filter.transform( transformer );
+
+        assertTrue( dependencyFilter.include( newArtifact( "g:a:v", "compile" ) ) );
+
+        assertFalse( dependencyFilter.include( newArtifact( "x:a:v", "compile" ) ) );
+
+        assertFalse( dependencyFilter.include( newArtifact( "g:a:v", "test" ) ) );
+
+        assertFalse( dependencyFilter.include( newArtifact( "x:a:v", "test" ) ) );
+    }
+
+    @Test
+    public void testTransformExclusionsFilter()
+        throws Exception
+    {
+        ExclusionsFilter filter = new ExclusionsFilter( Collections.singletonList( "x:a" ) );
+
+        ArtifactFilter dependencyFilter = (ArtifactFilter) filter.transform( transformer );
+
+        assertTrue( dependencyFilter.include( newArtifact( "g:a:v", "compile" ) ) );
+
+        assertFalse( dependencyFilter.include( newArtifact( "x:a:v", "compile" ) ) );
+    }
+
+    @Test
+    public void testTransformOrFilter()
+        throws Exception
+    {
+        OrFilter filter =
+            new OrFilter( Arrays.<TransformableFilter>asList( ScopeFilter.including( "compile" ),
+                                                              ScopeFilter.including( "test" ) ) );
+
+        ArtifactFilter dependencyFilter = (ArtifactFilter) filter.transform( transformer );
+
+        assertTrue( dependencyFilter.include( newArtifact( "g:a:v", "compile" ) ) );
+
+        assertTrue( dependencyFilter.include( newArtifact( "g:a:v", "test" ) ) );
+
+        assertFalse( dependencyFilter.include( newArtifact( "g:a:v", "runtime" ) ) );
+    }
+
+    @Test
+    public void testTransformScopeFilter()
+        throws Exception
+    {
+        ScopeFilter filter = ScopeFilter.including( Collections.singletonList( "runtime" ) );
+
+        ArtifactFilter dependencyFilter = (ArtifactFilter) filter.transform( transformer );
+
+        assertTrue( dependencyFilter.include( newArtifact( "g:a:v", "runtime" ) ) );
+
+        assertFalse( dependencyFilter.include( newArtifact( "g:a:v", "compile" ) ) );
+
+        assertFalse( dependencyFilter.include( newArtifact( "g:a:v", "test" ) ) );
+    }
+
+    @Test
+    public void testTransformPatternExclusionsFilter()
+        throws Exception
+    {
+        PatternExclusionsFilter filter = new PatternExclusionsFilter( Collections.singletonList( "x:*" ) );
+
+        PatternExcludesArtifactFilter dependencyFilter = (PatternExcludesArtifactFilter) filter.transform( transformer );
+
+        assertTrue( dependencyFilter.include( newArtifact( "g:a:v", "runtime" ) ) );
+
+        assertFalse( dependencyFilter.include( newArtifact( "x:a:v", "runtime" ) ) );
+    }
+
+    @Test
+    public void testTransformPatternInclusionsFilter()
+        throws Exception
+    {
+        PatternInclusionsFilter filter = new PatternInclusionsFilter( Collections.singletonList( "g:*" ) );
+
+        PatternIncludesArtifactFilter dependencyFilter = (PatternIncludesArtifactFilter) filter.transform( transformer );
+
+        assertTrue( dependencyFilter.include( newArtifact( "g:a:v", "runtime" ) ) );
+
+        assertFalse( dependencyFilter.include( newArtifact( "x:a:v", "runtime" ) ) );
+    }
+    
+    @Test
+    public void testTransformAbstractFilter() throws Exception
+    {
+        AbstractFilter snapshotFilter = new AbstractFilter()
+        {
+            @Override
+            public boolean accept( Node node, List<Node> parents )
+            {
+                return ArtifactUtils.isSnapshot( node.getDependency().getVersion() );
+            }
+        };
+        
+        ArtifactFilter dependencyFilter = snapshotFilter.transform( transformer );
+        
+        assertTrue( dependencyFilter.include( newArtifact( "g:a:1.0-SNAPSHOT", "compile" ) ) );
+
+        assertFalse( dependencyFilter.include( newArtifact( "g:a:1.0", "compile" ) ) );
+    }
+
+    private Artifact newArtifact( String coor, String scope )
+        throws Exception
+    {
+        String[] gav = coor.split( ":" );
+        return artifactFactory.createArtifact( gav[0], gav[1], gav[2], scope );
+    }
+
+}

Propchange: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeFilterTransformerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeNodeTest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeNodeTest.java?rev=1694580&r1=1694579&r2=1694580&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeNodeTest.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeNodeTest.java Thu Aug  6 21:52:07 2015
@@ -1,166 +1,166 @@
-package org.apache.maven.shared.artifact.filter.resolve.transform;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import static org.junit.Assert.assertEquals;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.versioning.VersionRange;
-import org.apache.maven.model.Dependency;
-import org.apache.maven.plugin.testing.ArtifactStubFactory;
-import org.apache.maven.shared.artifact.filter.resolve.Node;
-import org.eclipse.aether.graph.DependencyNode;
-import org.junit.Test;
-
-public class ArtifactIncludeNodeTest
-{
-    private ArtifactStubFactory artifactFactory = new ArtifactStubFactory();
-
-    @Test
-    public void testGAV() throws Exception
-    {
-        Node node = new ArtifactIncludeNode( newArtifact( "g:a:v", null ) );
-
-        Dependency dependency = node.getDependency();
-
-        assertEquals( "g", dependency.getGroupId() );
-        assertEquals( "a", dependency.getArtifactId() );
-        assertEquals( "v", dependency.getVersion() );
-        assertEquals( "", dependency.getClassifier() );
-        // This is different compared to AetherNodes. Here it's based on artifact, which in the end always has a type.
-        assertEquals( "jar", dependency.getType() );
-    }
-
-    @Test
-    public void testClassifier() throws Exception
-    {
-        Node node = new ArtifactIncludeNode( newArtifact( "g:a::c:v", null ) );
-
-        Dependency dependency = node.getDependency();
-
-        assertEquals( "g", dependency.getGroupId() );
-        assertEquals( "a", dependency.getArtifactId() );
-        assertEquals( "v", dependency.getVersion() );
-        assertEquals( "c", dependency.getClassifier() );
-        // empty type stays empty type when using ArtifactStubFactory
-        assertEquals( "", dependency.getType() );
-    }
-
-    @Test
-    public void testType() throws Exception
-    {
-        Node node = new ArtifactIncludeNode( newArtifact( "g:a:pom:v", null ) );
-
-        Dependency dependency = node.getDependency();
-
-        assertEquals( "g", dependency.getGroupId() );
-        assertEquals( "a", dependency.getArtifactId() );
-        assertEquals( "v", dependency.getVersion() );
-        assertEquals( null, dependency.getClassifier() );
-        assertEquals( "pom", dependency.getType() );
-    }
-
-    @Test
-    public void testScope() throws Exception
-    {
-        Node node = new ArtifactIncludeNode( newArtifact( "g:a:v", "s" ) );
-
-        Dependency dependency = node.getDependency();
-
-        assertEquals( "g", dependency.getGroupId() );
-        assertEquals( "a", dependency.getArtifactId() );
-        assertEquals( "v", dependency.getVersion() );
-        assertEquals( "", dependency.getClassifier() );
-        assertEquals( "jar", dependency.getType() );
-        assertEquals( "s", dependency.getScope() );
-    }
-
-    @Test
-    public void testOptional() throws Exception
-    {
-        Node node = new ArtifactIncludeNode( newArtifact( "g:a:pom:v", null, null ) );
-        
-        assertEquals( "false", node.getDependency().getOptional()  );
-        assertEquals( false, node.getDependency().isOptional()  );
-        
-        node = new ArtifactIncludeNode( newArtifact( "g:a:pom:v", null, true ) );
-        assertEquals( "true", node.getDependency().getOptional()  );
-        assertEquals( true, node.getDependency().isOptional()  );
-
-        node = new ArtifactIncludeNode( newArtifact( "g:a:pom:v", null, false ) );
-        assertEquals( "false", node.getDependency().getOptional()  );
-        assertEquals( false, node.getDependency().isOptional()  );
-    }
-
-    private Artifact newArtifact( String coor, String scope )
-        throws Exception
-    {
-        return newArtifact( coor, scope, null );
-    }
-
-    private Artifact newArtifact( String coor, String scope, Boolean optional )
-        throws Exception
-    {
-        String[] gav = coor.split( ":" );
-        String groupId = gav[0];
-        String artifactId = gav[1];
-        String version = null;
-        String classifier = null;
-        String type = null;
-
-        if ( gav.length == 3 )
-        {
-            version = gav[2];
-        }
-        else if ( gav.length == 4 )
-        {
-            type = gav[2];
-            version = gav[3];
-        }        
-        else if ( gav.length == 5 )
-        {
-            type = gav[2];
-            classifier = gav[3];
-            version = gav[4];
-        }        
-        
-        if( optional != null )
-        {
-            VersionRange versionRange = VersionRange.createFromVersion( version );
-            return artifactFactory.createArtifact( groupId, artifactId, versionRange, scope, type, classifier, optional );
-        }
-        else if ( gav.length == 3 )
-        {
-            return artifactFactory.createArtifact( groupId, artifactId, version, scope );
-        }
-        else if ( gav.length == 4 )
-        {
-            return artifactFactory.createArtifact( groupId, artifactId, version, scope, type, null );
-        }
-        else if ( gav.length == 5 )
-        {
-            return artifactFactory.createArtifact( groupId, artifactId, version, scope, type, classifier );
-        }
-        else
-        {
-            throw new IllegalArgumentException( "Can't translate coor to an Artifact" );
-        }
-    }
-}
+package org.apache.maven.shared.artifact.filter.resolve.transform;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.plugin.testing.ArtifactStubFactory;
+import org.apache.maven.shared.artifact.filter.resolve.Node;
+import org.eclipse.aether.graph.DependencyNode;
+import org.junit.Test;
+
+public class ArtifactIncludeNodeTest
+{
+    private ArtifactStubFactory artifactFactory = new ArtifactStubFactory();
+
+    @Test
+    public void testGAV() throws Exception
+    {
+        Node node = new ArtifactIncludeNode( newArtifact( "g:a:v", null ) );
+
+        Dependency dependency = node.getDependency();
+
+        assertEquals( "g", dependency.getGroupId() );
+        assertEquals( "a", dependency.getArtifactId() );
+        assertEquals( "v", dependency.getVersion() );
+        assertEquals( "", dependency.getClassifier() );
+        // This is different compared to AetherNodes. Here it's based on artifact, which in the end always has a type.
+        assertEquals( "jar", dependency.getType() );
+    }
+
+    @Test
+    public void testClassifier() throws Exception
+    {
+        Node node = new ArtifactIncludeNode( newArtifact( "g:a::c:v", null ) );
+
+        Dependency dependency = node.getDependency();
+
+        assertEquals( "g", dependency.getGroupId() );
+        assertEquals( "a", dependency.getArtifactId() );
+        assertEquals( "v", dependency.getVersion() );
+        assertEquals( "c", dependency.getClassifier() );
+        // empty type stays empty type when using ArtifactStubFactory
+        assertEquals( "", dependency.getType() );
+    }
+
+    @Test
+    public void testType() throws Exception
+    {
+        Node node = new ArtifactIncludeNode( newArtifact( "g:a:pom:v", null ) );
+
+        Dependency dependency = node.getDependency();
+
+        assertEquals( "g", dependency.getGroupId() );
+        assertEquals( "a", dependency.getArtifactId() );
+        assertEquals( "v", dependency.getVersion() );
+        assertEquals( null, dependency.getClassifier() );
+        assertEquals( "pom", dependency.getType() );
+    }
+
+    @Test
+    public void testScope() throws Exception
+    {
+        Node node = new ArtifactIncludeNode( newArtifact( "g:a:v", "s" ) );
+
+        Dependency dependency = node.getDependency();
+
+        assertEquals( "g", dependency.getGroupId() );
+        assertEquals( "a", dependency.getArtifactId() );
+        assertEquals( "v", dependency.getVersion() );
+        assertEquals( "", dependency.getClassifier() );
+        assertEquals( "jar", dependency.getType() );
+        assertEquals( "s", dependency.getScope() );
+    }
+
+    @Test
+    public void testOptional() throws Exception
+    {
+        Node node = new ArtifactIncludeNode( newArtifact( "g:a:pom:v", null, null ) );
+        
+        assertEquals( "false", node.getDependency().getOptional()  );
+        assertEquals( false, node.getDependency().isOptional()  );
+        
+        node = new ArtifactIncludeNode( newArtifact( "g:a:pom:v", null, true ) );
+        assertEquals( "true", node.getDependency().getOptional()  );
+        assertEquals( true, node.getDependency().isOptional()  );
+
+        node = new ArtifactIncludeNode( newArtifact( "g:a:pom:v", null, false ) );
+        assertEquals( "false", node.getDependency().getOptional()  );
+        assertEquals( false, node.getDependency().isOptional()  );
+    }
+
+    private Artifact newArtifact( String coor, String scope )
+        throws Exception
+    {
+        return newArtifact( coor, scope, null );
+    }
+
+    private Artifact newArtifact( String coor, String scope, Boolean optional )
+        throws Exception
+    {
+        String[] gav = coor.split( ":" );
+        String groupId = gav[0];
+        String artifactId = gav[1];
+        String version = null;
+        String classifier = null;
+        String type = null;
+
+        if ( gav.length == 3 )
+        {
+            version = gav[2];
+        }
+        else if ( gav.length == 4 )
+        {
+            type = gav[2];
+            version = gav[3];
+        }        
+        else if ( gav.length == 5 )
+        {
+            type = gav[2];
+            classifier = gav[3];
+            version = gav[4];
+        }        
+        
+        if( optional != null )
+        {
+            VersionRange versionRange = VersionRange.createFromVersion( version );
+            return artifactFactory.createArtifact( groupId, artifactId, versionRange, scope, type, classifier, optional );
+        }
+        else if ( gav.length == 3 )
+        {
+            return artifactFactory.createArtifact( groupId, artifactId, version, scope );
+        }
+        else if ( gav.length == 4 )
+        {
+            return artifactFactory.createArtifact( groupId, artifactId, version, scope, type, null );
+        }
+        else if ( gav.length == 5 )
+        {
+            return artifactFactory.createArtifact( groupId, artifactId, version, scope, type, classifier );
+        }
+        else
+        {
+            throw new IllegalArgumentException( "Can't translate coor to an Artifact" );
+        }
+    }
+}

Propchange: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/ArtifactIncludeNodeTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherNodeTest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherNodeTest.java?rev=1694580&r1=1694579&r2=1694580&view=diff
==============================================================================
--- maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherNodeTest.java (original)
+++ maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherNodeTest.java Thu Aug  6 21:52:07 2015
@@ -1,136 +1,136 @@
-package org.apache.maven.shared.artifact.filter.resolve.transform;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-
-import org.apache.maven.shared.artifact.filter.resolve.Node;
-import org.eclipse.aether.artifact.DefaultArtifact;
-import org.eclipse.aether.graph.DefaultDependencyNode;
-import org.eclipse.aether.graph.Dependency;
-import org.eclipse.aether.graph.DependencyNode;
-import org.eclipse.aether.graph.Exclusion;
-import org.junit.Test;
-
-public class EclipseAetherNodeTest
-{
-    @Test
-    public void testGAV()
-    {
-        Node node = new EclipseAetherNode( newDependencyNode( "g:a:v", null ) );
-        
-        org.apache.maven.model.Dependency mavenDependency = node.getDependency();
-        
-        assertEquals( "g", mavenDependency.getGroupId()  );
-        assertEquals( "a", mavenDependency.getArtifactId()  );
-        assertEquals( "v", mavenDependency.getVersion() );
-        assertEquals( "", mavenDependency.getClassifier() );
-        assertEquals( null, mavenDependency.getType() );
-        assertEquals( "", mavenDependency.getScope() );
-    }
-
-    @Test
-    public void testClassifier()
-    {
-        Node node = new EclipseAetherNode( newDependencyNode( "g:a::c:v", null ) );
-        
-        org.apache.maven.model.Dependency mavenDependency = node.getDependency();
-        
-        assertEquals( "g", mavenDependency.getGroupId()  );
-        assertEquals( "a", mavenDependency.getArtifactId()  );
-        assertEquals( "v", mavenDependency.getVersion() );
-        assertEquals( "c", mavenDependency.getClassifier() );
-        assertEquals( null, mavenDependency.getType() );
-        assertEquals( "", mavenDependency.getScope() );
-    }
-    
-    @Test
-    public void testScope()
-    {
-        Node node = new EclipseAetherNode( newDependencyNode( "g:a:c:v", "s" ) );
-        
-        org.apache.maven.model.Dependency mavenDependency = node.getDependency();
-        
-        assertEquals( "g", mavenDependency.getGroupId()  );
-        assertEquals( "a", mavenDependency.getArtifactId()  );
-        assertEquals( "v", mavenDependency.getVersion() );
-        assertEquals( "", mavenDependency.getClassifier() );
-        assertEquals( null, mavenDependency.getType() );
-        assertEquals( "s", mavenDependency.getScope() );
-    }
-
-    @Test
-    public void testOptional()
-    {
-        Node node = new EclipseAetherNode( newDependencyNode( "g:a:v", null, (Boolean) null ) );
-        
-        assertEquals( null, node.getDependency().getOptional()  );
-        assertEquals( false, node.getDependency().isOptional()  );
-        
-        node = new EclipseAetherNode( newDependencyNode( "g:a:v", null, true ) );
-        assertEquals( "true", node.getDependency().getOptional()  );
-        assertEquals( true, node.getDependency().isOptional()  );
-
-        node = new EclipseAetherNode( newDependencyNode( "g:a:v", null, false ) );
-        assertEquals( "false", node.getDependency().getOptional()  );
-        assertEquals( false, node.getDependency().isOptional()  );
-    }
-    
-    @Test
-    public void testExclusions()
-    {
-        Node node = new EclipseAetherNode( newDependencyNode( "g:a:v", null, Collections.singletonList( "eg:ea" ) ) );
-        assertEquals( 1, node.getDependency().getExclusions().size() );
-        
-        org.apache.maven.model.Exclusion mavenExclusion = node.getDependency().getExclusions().get( 0 );
-        assertEquals( "eg", mavenExclusion.getGroupId() );
-        assertEquals( "ea", mavenExclusion.getArtifactId() );
-    }
-
-    private DependencyNode newDependencyNode( String coor, String scope )
-    {
-        return new DefaultDependencyNode( new Dependency( new DefaultArtifact( coor ), scope ) );
-    }
-    
-    private DependencyNode newDependencyNode( String coor, String scope, Boolean optional )
-    {
-        return new DefaultDependencyNode( new Dependency( new DefaultArtifact( coor ), scope, optional ) );
-    }
-
-    private DependencyNode newDependencyNode( String coor, String scope, Collection<String> exclusions )
-    {
-        Dependency dependency = new Dependency( new DefaultArtifact( coor ), scope );
-        
-        Collection<Exclusion> aetherExclusions = new ArrayList<Exclusion>( exclusions.size() );
-        for ( String exclusion : exclusions )
-        {
-            String[] ga = exclusion.split( ":" );
-            aetherExclusions.add( new Exclusion( ga[0], ga[1], null, null ) );
-        }
-        dependency = dependency.setExclusions( aetherExclusions );
-        
-        return new DefaultDependencyNode( dependency );
-    }
-
-}
+package org.apache.maven.shared.artifact.filter.resolve.transform;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+
+import org.apache.maven.shared.artifact.filter.resolve.Node;
+import org.eclipse.aether.artifact.DefaultArtifact;
+import org.eclipse.aether.graph.DefaultDependencyNode;
+import org.eclipse.aether.graph.Dependency;
+import org.eclipse.aether.graph.DependencyNode;
+import org.eclipse.aether.graph.Exclusion;
+import org.junit.Test;
+
+public class EclipseAetherNodeTest
+{
+    @Test
+    public void testGAV()
+    {
+        Node node = new EclipseAetherNode( newDependencyNode( "g:a:v", null ) );
+        
+        org.apache.maven.model.Dependency mavenDependency = node.getDependency();
+        
+        assertEquals( "g", mavenDependency.getGroupId()  );
+        assertEquals( "a", mavenDependency.getArtifactId()  );
+        assertEquals( "v", mavenDependency.getVersion() );
+        assertEquals( "", mavenDependency.getClassifier() );
+        assertEquals( null, mavenDependency.getType() );
+        assertEquals( "", mavenDependency.getScope() );
+    }
+
+    @Test
+    public void testClassifier()
+    {
+        Node node = new EclipseAetherNode( newDependencyNode( "g:a::c:v", null ) );
+        
+        org.apache.maven.model.Dependency mavenDependency = node.getDependency();
+        
+        assertEquals( "g", mavenDependency.getGroupId()  );
+        assertEquals( "a", mavenDependency.getArtifactId()  );
+        assertEquals( "v", mavenDependency.getVersion() );
+        assertEquals( "c", mavenDependency.getClassifier() );
+        assertEquals( null, mavenDependency.getType() );
+        assertEquals( "", mavenDependency.getScope() );
+    }
+    
+    @Test
+    public void testScope()
+    {
+        Node node = new EclipseAetherNode( newDependencyNode( "g:a:c:v", "s" ) );
+        
+        org.apache.maven.model.Dependency mavenDependency = node.getDependency();
+        
+        assertEquals( "g", mavenDependency.getGroupId()  );
+        assertEquals( "a", mavenDependency.getArtifactId()  );
+        assertEquals( "v", mavenDependency.getVersion() );
+        assertEquals( "", mavenDependency.getClassifier() );
+        assertEquals( null, mavenDependency.getType() );
+        assertEquals( "s", mavenDependency.getScope() );
+    }
+
+    @Test
+    public void testOptional()
+    {
+        Node node = new EclipseAetherNode( newDependencyNode( "g:a:v", null, (Boolean) null ) );
+        
+        assertEquals( null, node.getDependency().getOptional()  );
+        assertEquals( false, node.getDependency().isOptional()  );
+        
+        node = new EclipseAetherNode( newDependencyNode( "g:a:v", null, true ) );
+        assertEquals( "true", node.getDependency().getOptional()  );
+        assertEquals( true, node.getDependency().isOptional()  );
+
+        node = new EclipseAetherNode( newDependencyNode( "g:a:v", null, false ) );
+        assertEquals( "false", node.getDependency().getOptional()  );
+        assertEquals( false, node.getDependency().isOptional()  );
+    }
+    
+    @Test
+    public void testExclusions()
+    {
+        Node node = new EclipseAetherNode( newDependencyNode( "g:a:v", null, Collections.singletonList( "eg:ea" ) ) );
+        assertEquals( 1, node.getDependency().getExclusions().size() );
+        
+        org.apache.maven.model.Exclusion mavenExclusion = node.getDependency().getExclusions().get( 0 );
+        assertEquals( "eg", mavenExclusion.getGroupId() );
+        assertEquals( "ea", mavenExclusion.getArtifactId() );
+    }
+
+    private DependencyNode newDependencyNode( String coor, String scope )
+    {
+        return new DefaultDependencyNode( new Dependency( new DefaultArtifact( coor ), scope ) );
+    }
+    
+    private DependencyNode newDependencyNode( String coor, String scope, Boolean optional )
+    {
+        return new DefaultDependencyNode( new Dependency( new DefaultArtifact( coor ), scope, optional ) );
+    }
+
+    private DependencyNode newDependencyNode( String coor, String scope, Collection<String> exclusions )
+    {
+        Dependency dependency = new Dependency( new DefaultArtifact( coor ), scope );
+        
+        Collection<Exclusion> aetherExclusions = new ArrayList<Exclusion>( exclusions.size() );
+        for ( String exclusion : exclusions )
+        {
+            String[] ga = exclusion.split( ":" );
+            aetherExclusions.add( new Exclusion( ga[0], ga[1], null, null ) );
+        }
+        dependency = dependency.setExclusions( aetherExclusions );
+        
+        return new DefaultDependencyNode( dependency );
+    }
+
+}

Propchange: maven/shared/trunk/maven-common-artifact-filters/src/test/java/org/apache/maven/shared/artifact/filter/resolve/transform/EclipseAetherNodeTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message