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 PatternArtifactFilterTCK tck = new PatternArtifactFilterTCK()
32      {
33  
34          protected ArtifactFilter createFilter( List patterns )
35          {
36              return new PatternExcludesArtifactFilter( patterns );
37          }
38  
39          protected ArtifactFilter createFilter( List patterns, boolean actTransitively )
40          {
41              return new PatternExcludesArtifactFilter( patterns, actTransitively );
42          }
43  
44      };
45  
46      public void testShouldTriggerBothPatternsWithWildcards()
47      {
48          tck.testShouldTriggerBothPatternsWithWildcards( true );
49      }
50  
51      public void testShouldNotIncludeDirectlyMatchedArtifactByDependencyConflictId()
52      {
53          tck.testShouldIncludeDirectlyMatchedArtifactByDependencyConflictId( true );
54      }
55  
56      public void testShouldNotIncludeDirectlyMatchedArtifactByGroupIdArtifactId()
57      {
58          tck.testShouldIncludeDirectlyMatchedArtifactByGroupIdArtifactId( true );
59      }
60  
61      public void testShouldNotIncludeWhenPatternMatchesDependencyTrailAndTransitivityIsEnabled()
62      {
63          tck.testShouldIncludeWhenPatternMatchesDependencyTrailAndTransitivityIsEnabled( true );
64      }
65  
66      public void testShouldIncludeWhenArtifactIdDiffers()
67      {
68          tck.testShouldNotIncludeWhenArtifactIdDiffers( true );
69      }
70  
71      public void testShouldIncludeWhenBothIdElementsDiffer()
72      {
73          tck.testShouldNotIncludeWhenBothIdElementsDiffer( true );
74      }
75  
76      public void testShouldIncludeWhenGroupIdDiffers()
77      {
78          tck.testShouldNotIncludeWhenGroupIdDiffers( true );
79      }
80  
81      public void testShouldIncludeWhenNegativeMatch()
82      {
83          tck.testShouldNotIncludeWhenNegativeMatch( true );
84      }
85  
86      public void testShouldNotIncludeWhenWildcardMatchesInsideSequence()
87      {
88          tck.testShouldIncludeWhenWildcardMatchesInsideSequence( true );
89      }
90  
91      public void testShouldIncludeWhenWildcardMatchesOutsideSequence()
92      {
93          tck.testShouldIncludeWhenWildcardMatchesOutsideSequence( true );
94      }
95  
96      public void testShouldIncludeTransitiveDependencyWhenWildcardMatchesButDoesntMatchParent()
97      {
98          tck.testShouldIncludeTransitiveDependencyWhenWildcardMatchesButDoesntMatchParent( true );
99      }
100 
101     // See comment in TCK.
102 //    public void testShouldIncludeDirectDependencyWhenInvertedWildcardMatchesButDoesntMatchTransitiveChild()
103 //    {
104 //        tck.testShouldIncludeDirectDependencyWhenInvertedWildcardMatchesButDoesntMatchTransitiveChild( true );
105 //    }
106 }