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 PatternExcludesArtifactFilterTest
28      extends TestCase
29  {
30  
31      private final PatternArtifactFilterTCK tck = new PatternArtifactFilterTCK()
32      {
33  
34          @Override
35          protected ArtifactFilter createFilter( final List patterns )
36          {
37              return new PatternExcludesArtifactFilter( patterns );
38          }
39  
40          @Override
41          protected ArtifactFilter createFilter( final List patterns, final boolean actTransitively )
42          {
43              return new PatternExcludesArtifactFilter( patterns, actTransitively );
44          }
45  
46          @Override
47          protected boolean isInclusionExpected()
48          {
49              return false;
50          }
51  
52      };
53  
54      public void testShouldTriggerBothPatternsWithNonColonWildcards()
55      {
56          tck.testShouldTriggerBothPatternsWithNonColonWildcards();
57      }
58  
59      public void testIncludeWhenPatternMatchesDepTrailWithTransitivityUsingNonColonWildcard()
60      {
61          tck.testIncludeWhenPatternMatchesDepTrailWithTransitivityUsingNonColonWildcard();
62      }
63  
64      public void testShouldTriggerBothPatternsWithWildcards()
65      {
66          tck.testShouldTriggerBothPatternsWithWildcards();
67      }
68  
69      public void testShouldNotIncludeDirectlyMatchedArtifactByDependencyConflictId()
70      {
71          tck.testShouldIncludeDirectlyMatchedArtifactByDependencyConflictId();
72      }
73  
74      public void testShouldNotIncludeDirectlyMatchedArtifactByGroupIdArtifactId()
75      {
76          tck.testShouldIncludeDirectlyMatchedArtifactByGroupIdArtifactId();
77      }
78  
79      public void testShouldNotIncludeWhenPatternMatchesDependencyTrailAndTransitivityIsEnabled()
80      {
81          tck.testShouldIncludeWhenPatternMatchesDependencyTrailAndTransitivityIsEnabled();
82      }
83  
84      public void testShouldIncludeWhenArtifactIdDiffers()
85      {
86          tck.testShouldNotIncludeWhenArtifactIdDiffers();
87      }
88  
89      public void testShouldIncludeWhenBothIdElementsDiffer()
90      {
91          tck.testShouldNotIncludeWhenBothIdElementsDiffer();
92      }
93  
94      public void testShouldIncludeWhenGroupIdDiffers()
95      {
96          tck.testShouldNotIncludeWhenGroupIdDiffers();
97      }
98  
99      public void testShouldIncludeWhenNegativeMatch()
100     {
101         tck.testShouldNotIncludeWhenNegativeMatch();
102     }
103 
104     public void testShouldNotIncludeWhenWildcardMatchesInsideSequence()
105     {
106         tck.testShouldIncludeWhenWildcardMatchesInsideSequence();
107     }
108 
109     public void testShouldIncludeWhenWildcardMatchesOutsideSequence()
110     {
111         tck.testShouldIncludeWhenWildcardMatchesOutsideSequence();
112     }
113 
114     public void testShouldIncludeTransitiveDependencyWhenWildcardMatchesButDoesntMatchParent()
115     {
116         tck.testShouldIncludeTransitiveDependencyWhenWildcardMatchesButDoesntMatchParent();
117     }
118 
119     public void testShouldIncludeWhenWildcardMatchesMiddleOfArtifactId()
120     {
121         tck.testShouldIncludeWhenWildcardMatchesMiddleOfArtifactId();
122     }
123 
124     public void testShouldIncludeWhenWildcardCoversPartOfGroupIdAndEverythingElse()
125     {
126         tck.testShouldIncludeWhenWildcardCoversPartOfGroupIdAndEverythingElse();
127     }
128 
129     public void testShouldIncludeDirectlyMatchedArtifactByGroupIdArtifactId()
130     {
131         tck.testShouldIncludeDirectlyMatchedArtifactByGroupIdArtifactId();
132     }
133 
134     public void testShouldIncludeDirectlyMatchedArtifactByDependencyConflictId()
135     {
136         tck.testShouldIncludeDirectlyMatchedArtifactByDependencyConflictId();
137     }
138 
139     public void testShouldNotIncludeWhenGroupIdDiffers()
140     {
141         tck.testShouldNotIncludeWhenGroupIdDiffers();
142     }
143 
144     public void testShouldNotIncludeWhenArtifactIdDiffers()
145     {
146         tck.testShouldNotIncludeWhenArtifactIdDiffers();
147     }
148 
149     public void testShouldNotIncludeWhenBothIdElementsDiffer()
150     {
151         tck.testShouldNotIncludeWhenBothIdElementsDiffer();
152     }
153 
154     public void testShouldIncludeWhenPatternMatchesDependencyTrailAndTransitivityIsEnabled()
155     {
156         tck.testShouldIncludeWhenPatternMatchesDependencyTrailAndTransitivityIsEnabled();
157     }
158 
159     public void testShouldNotIncludeWhenNegativeMatch()
160     {
161         tck.testShouldNotIncludeWhenNegativeMatch();
162     }
163 
164     public void testShouldIncludeWhenWildcardMatchesInsideSequence()
165     {
166         tck.testShouldIncludeWhenWildcardMatchesInsideSequence();
167     }
168 
169     // See comment in TCK.
170     // public void testShouldIncludeDirectDependencyWhenInvertedWildcardMatchesButDoesntMatchTransitiveChild()
171     // {
172     // tck.testShouldIncludeDirectDependencyWhenInvertedWildcardMatchesButDoesntMatchTransitiveChild();
173     // }
174 }