View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.shared.artifact.filter;
20  
21  import java.util.List;
22  
23  import junit.framework.TestCase;
24  
25  import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
26  
27  public class PatternIncludesArtifactFilterTest
28      extends TestCase
29  {
30      private final PatternArtifactFilterTCK tck = new PatternArtifactFilterTCK()
31      {
32  
33          @Override
34          protected ArtifactFilter createFilter( final List patterns )
35          {
36              return new PatternIncludesArtifactFilter( patterns );
37          }
38  
39          @Override
40          protected ArtifactFilter createFilter( final List patterns, final boolean actTransitively )
41          {
42              return new PatternIncludesArtifactFilter( patterns, actTransitively );
43          }
44  
45          @Override
46          protected boolean isInclusionExpected()
47          {
48              return true;
49          }
50  
51      };
52  
53      public void testShouldTriggerBothPatternsWithNonColonWildcards()
54      {
55          tck.testShouldTriggerBothPatternsWithNonColonWildcards();
56      }
57  
58      public void testShouldTriggerBothPatternsWithWildcards()
59      {
60          tck.testShouldTriggerBothPatternsWithWildcards();
61      }
62  
63      public void testShouldIncludeDirectlyMatchedArtifactByDependencyConflictId()
64      {
65          tck.testShouldIncludeDirectlyMatchedArtifactByDependencyConflictId();
66      }
67  
68      public void testShouldIncludeDirectlyMatchedArtifactByGroupIdArtifactId()
69      {
70          tck.testShouldIncludeDirectlyMatchedArtifactByGroupIdArtifactId();
71      }
72  
73      public void testShouldIncludeWhenPatternMatchesDependencyTrailAndTransitivityIsEnabled()
74      {
75          tck.testShouldIncludeWhenPatternMatchesDependencyTrailAndTransitivityIsEnabled();
76      }
77  
78      public void testIncludeWhenPatternMatchesDepTrailWithTransitivityUsingNonColonWildcard()
79      {
80          tck.testIncludeWhenPatternMatchesDepTrailWithTransitivityUsingNonColonWildcard();
81      }
82  
83      public void testShouldNotIncludeWhenArtifactIdDiffers()
84      {
85          tck.testShouldNotIncludeWhenArtifactIdDiffers();
86      }
87  
88      public void testShouldNotIncludeWhenBothIdElementsDiffer()
89      {
90          tck.testShouldNotIncludeWhenBothIdElementsDiffer();
91      }
92  
93      public void testShouldNotIncludeWhenGroupIdDiffers()
94      {
95          tck.testShouldNotIncludeWhenGroupIdDiffers();
96      }
97  
98      public void testShouldNotIncludeWhenNegativeMatch()
99      {
100         tck.testShouldNotIncludeWhenNegativeMatch();
101     }
102 
103     public void testShouldIncludeWhenWildcardMatchesInsideSequence()
104     {
105         tck.testShouldIncludeWhenWildcardMatchesInsideSequence();
106     }
107 
108     public void testShouldIncludeWhenWildcardMatchesOutsideSequence()
109     {
110         tck.testShouldIncludeWhenWildcardMatchesOutsideSequence();
111     }
112 
113     public void testShouldIncludeTransitiveDependencyWhenWildcardMatchesButDoesntMatchParent()
114     {
115         tck.testShouldIncludeTransitiveDependencyWhenWildcardMatchesButDoesntMatchParent();
116     }
117 
118     public void testShouldIncludeWhenWildcardMatchesMiddleOfArtifactId()
119     {
120         tck.testShouldIncludeWhenWildcardMatchesMiddleOfArtifactId();
121     }
122 
123     public void testShouldIncludeWhenWildcardCoversPartOfGroupIdAndEverythingElse()
124     {
125         tck.testShouldIncludeWhenWildcardCoversPartOfGroupIdAndEverythingElse();
126     }
127 
128     // See comment in TCK.
129     // public void testShouldIncludeDirectDependencyWhenInvertedWildcardMatchesButDoesntMatchTransitiveChild()
130     // {
131     // tck.testShouldIncludeDirectDependencyWhenInvertedWildcardMatchesButDoesntMatchTransitiveChild();
132     // }
133 }